gxc
2019-11-07 a4924de3136289d10cabbf2f61a228387d44ded7
ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs
old mode 100755 new mode 100644
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Java.Util;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Shared;
@@ -20,18 +21,29 @@
        #region 门锁本地变量
        /// <summary>
        /// 门锁本地用户列表
        /// 本地门锁用户和账户列表
        /// key:门锁用户ID
        /// </summary>
        /// <returns></returns>
        public Dictionary<int, LocaDoorLockObj> localDoorLockUserList = new Dictionary<int, LocaDoorLockObj>();
        public string currentUserDisplayMethod = string.Empty;
        /// <summary>
        /// 本地门账户列表
        /// key:账户ID(主账户是GUID,子账户是分享过来的账户ID)
        /// </summary>
        /// <returns></returns>
        public Dictionary<string, LocaDoorLockObj> localDoorLockAccountList = new Dictionary<string, LocaDoorLockObj>();
        public string currentUserDisplayMethod = string.Empty;//当前用户显示方式
        //本地所有账户列表
        public List<Shared.Phone.UserCenter.MemberInfoRes> localAllAccountList = new List<Shared.Phone.UserCenter.MemberInfoRes> { };
        public static int RemoteUnlockCount = 3;//远程开锁次数限制
        public static int RemoteUnlockCount = 5;//远程开锁次数限制
        public static string RemoteUnlockPassword = string.Empty;//远程开锁密码
        public static DateTime maxValue = DateTime.MaxValue;
        public static DateTime minValue = DateTime.MinValue;
        public string LocalTempPassword = string.Empty;//本地生成的临时密码
        public Dictionary<string, bool> IsFreezeAccount = new Dictionary<string, bool> { };//是否冻结子账户
        public Dictionary<string, bool> HasRemoteUnlockAccess = new Dictionary<string, bool> { };//是否给子账户拥有远程开锁的条件
        public Dictionary<string, bool> IsFailedToGetDoorLockInfo = new Dictionary<string, bool> { };//是否获取门锁数据失败
        #region 临时密码信息
        /// <summary>
        /// 用户管理发送数据回复
@@ -169,10 +181,6 @@
            /// PrimaryId 门锁云端主 键(非更新字段,以下均为更新字段) -->键名 : PrimaryId默认值: null
            /// </summary>
            public string PrimaryId = "";
            /// <summary>
            /// 云端帐号Id -->键名 : CloudAccountId
            /// </summary>
            public string CloudAccountId = "";
            /// <summary>
            /// OpenLockMode 开锁方式(密码、指纹、IC卡) -->键名 : OpenLockMode (可选)
            /// </summary>
@@ -622,12 +630,12 @@
        {
            DoorLockAccountList.Clear();
            return await System.Threading.Tasks.Task.Run((Func<System.Threading.Tasks.Task<List<Shared.Phone.UserCenter.MemberInfoRes>>>)(async () =>
           {
               var pra = new Shared.Phone.UserCenter.MemberListInfoPra();
               string result = await UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", false, pra);
               var listInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Shared.Phone.UserCenter.MemberInfoRes>>(result);
               return listInfo;
           }));
            {
                var pra = new Shared.Phone.UserCenter.MemberListInfoPra();
                string result = await UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", false, pra);
                var listInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Shared.Phone.UserCenter.MemberInfoRes>>(result);
                return listInfo;
            }));
        }
        /// <summary>
@@ -1122,7 +1130,7 @@
                            result = new DefaultControlResponseAllData { errorMessageBase = "网关返回的数据为空" };
                        }
                        else
                        {
                        {
                            if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
                            {
                                var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
@@ -1960,6 +1968,8 @@
        public async System.Threading.Tasks.Task<DoorlockUserInfo> GetDoorlockUserInfoAsync()
        {
            DoorlockUserInfo result = null;
            int totalNum = 0;
            int currentNum = -1;
            DoorLockUserDetailData doorLockUserDetailData = new DoorLockUserDetailData { };
            if (Gateway == null)
            {
@@ -2025,15 +2035,15 @@
                    var data = new JObject { { "PassData", passData } };
                    jObject.Add("Data", data);
                    Gateway.Send(("ClientDataPassthrough"), jObject.ToString());
                }
                catch { }
                //接收一个包最多等5秒,没有收到就退出
                while ((DateTime.Now - dateTime).TotalMilliseconds < 5000)
                //接收一个包最多等3秒,没有收到就退出
                while ((DateTime.Now - dateTime).TotalMilliseconds < 3000)
                {
                    await System.Threading.Tasks.Task.Delay(100);
                }
                Gateway.Actions -= action;
                DebugPrintLog("ClientDataPassthrough_Actions 退出" + System.DateTime.Now.ToString());
@@ -2124,4 +2134,4 @@
        #endregion
    }
}
}