| | |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using Java.Util; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Shared; |
| | |
| | | |
| | | #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 = 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> |
| | | /// 用户管理发送数据回复 |
| | |
| | | /// PrimaryId 门锁云端主 键(非更新字段,以下均为更新字段) -->键名 : PrimaryId默认值: null |
| | | /// </summary> |
| | | public string PrimaryId = ""; |
| | | /// <summary> |
| | | /// 云端帐号Id -->键名 : CloudAccountId |
| | | /// </summary> |
| | | public string CloudAccountId = ""; |
| | | /// <summary> |
| | | /// OpenLockMode 开锁方式(密码、指纹、IC卡) -->键名 : OpenLockMode (可选) |
| | | /// </summary> |
| | |
| | | public async System.Threading.Tasks.Task<DoorlockUserInfo> GetDoorlockUserInfoAsync() |
| | | { |
| | | DoorlockUserInfo result = null; |
| | | int totalNum = 0; |
| | | int currentNum = -1; |
| | | DoorLockUserDetailData doorLockUserDetailData = new DoorLockUserDetailData { }; |
| | | if (Gateway == null) |
| | | { |
| | |
| | | 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()); |
| | | |