| | |
| | | /// <summary>
|
| | | /// 获取到的历史记录
|
| | | /// </summary>
|
| | | private List<HistoryInfo> listHistoryInfo = null;
|
| | | private List<DoorHistoryLogInfo> listHistoryInfo = null;
|
| | | /// <summary>
|
| | | /// 其他消息的主键,它存在另外的一张数据库表中
|
| | | /// </summary>
|
| | |
| | | /// <summary>
|
| | | /// 画面显示(底层会固定调用此方法,借以完成画面创建)
|
| | | /// </summary>
|
| | | /// <param name="i_DeviceMac">门锁的Mac地址</param> |
| | | public void ShowForm(string i_DeviceMac) |
| | | /// <param name="i_DeviceMac">门锁的Mac地址</param>
|
| | | public void ShowForm(string i_DeviceMac)
|
| | | {
|
| | | this.DeviceDoor = Common.LocalDevice.Current.GetDevicesByMac(i_DeviceMac, false)[0]; |
| | | |
| | | //设置头部信息 |
| | | base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uHistoryLog)); |
| | | |
| | | //成员不允许清空记录 |
| | | if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
|
| | | this.DeviceDoor = HdlDeviceCommonLogic.Current.GetDevicesByMac(i_DeviceMac, false)[0];
|
| | |
|
| | | //设置头部信息
|
| | | base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uHistoryLog));
|
| | |
|
| | | //成员不允许清空记录
|
| | | if (HdlUserCenterResourse.ResidenceOption.AuthorityNo == 1 || HdlUserCenterResourse.ResidenceOption.AuthorityNo == 2)
|
| | | {
|
| | | //删除
|
| | | var btnDelete = new MostRightIconControl(69, 69);
|
| | |
| | | });
|
| | | });
|
| | | };
|
| | | } |
| | | |
| | | //初始化中部信息 |
| | | this.InitMiddleFrame(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 初始化中部信息 |
| | | /// </summary> |
| | | private void InitMiddleFrame() |
| | | }
|
| | |
|
| | | //初始化中部信息
|
| | | this.InitMiddleFrame();
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化中部信息
|
| | | /// </summary>
|
| | | private void InitMiddleFrame()
|
| | | {
|
| | | //清空bodyFrame
|
| | | this.ClearBodyFrame(); |
| | | |
| | | //初始化头部检索控件 |
| | | this.ClearBodyFrame();
|
| | |
|
| | | //初始化头部检索控件
|
| | | this.InitTitleSearchControl();
|
| | |
|
| | | //初始化记录列表
|
| | |
| | | /// </summary>
|
| | | private void InitTitleSearchControl()
|
| | | {
|
| | | var frameTitle = new FrameRowControl(); |
| | | frameTitle.UseClickStatu = false; |
| | | frameTitle.Height = Application.GetRealHeight(115); |
| | | frameTitle.BackgroundColor = topFrameLayout.BackgroundColor; |
| | | var frameTitle = new FrameRowControl();
|
| | | frameTitle.UseClickStatu = false;
|
| | | frameTitle.Height = Application.GetRealHeight(115);
|
| | | frameTitle.BackgroundColor = topFrameLayout.BackgroundColor;
|
| | | bodyFrameLayout.AddChidren(frameTitle);
|
| | |
|
| | | var btnDateIcon = frameTitle.AddLeftIcon(69);
|
| | |
| | | var dicMemberName = new Dictionary<string, string>();
|
| | | for (int i = 0; i < listMenberInfo.Count; i++)
|
| | | {
|
| | | dicMemberName.Add(listMenberInfo[i].SubAccountDistributedMark, string.IsNullOrEmpty(listMenberInfo[i].UserName) == false ? listMenberInfo[i].UserName : listMenberInfo[i].Account);
|
| | | dicMemberName.Add(listMenberInfo[i].ChildAccountId, listMenberInfo[i].ShowName);
|
| | | }
|
| | | //历史记录
|
| | | var historyLog = this.GetHistoryLogInfo(dicMemberName);
|
| | |
| | | //把自己也加进去
|
| | | var myInfo = new MemberInfoRes()
|
| | | {
|
| | | Account = UserCenterResourse.UserInfo.Account,
|
| | | UserName = UserCenterResourse.UserInfo.UserName,
|
| | | SubAccountDistributedMark = Common.Config.Instance.Guid
|
| | | ChildAccountEmail = HdlUserCenterResourse.UserInfo.UserEmail,
|
| | | ChildAccountPhone = HdlUserCenterResourse.UserInfo.UserPhone,
|
| | | ChildNickName = HdlUserCenterResourse.UserInfo.NickName,
|
| | | ChildAccountId = Common.Config.Instance.Guid
|
| | | };
|
| | | listMenberInfo.Add(myInfo);
|
| | | if (UserCenterResourse.UserInfo.AuthorityNo == 3)
|
| | | if (HdlUserCenterResourse.ResidenceOption.AuthorityNo == 3)
|
| | | {
|
| | | //成员只能看自己的
|
| | | return true;
|
| | | }
|
| | |
|
| | | var pra = new MemberListInfoPra();
|
| | | string result = UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", false, pra);
|
| | | if (string.IsNullOrEmpty(result) == true)
|
| | | //获取成员列表
|
| | | var listInfo = HdlMemberLogic.Current.GetMemberListInfo(ShowNetCodeMode.YES);
|
| | | if (listInfo == null)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | List<MemberInfoRes> listInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<List<MemberInfoRes>>(result);
|
| | | var checkList = new List<string>();
|
| | | foreach (MemberInfoRes infoRes in listInfo)
|
| | | {
|
| | | if (checkList.Contains(infoRes.DistributedMark) == true)
|
| | | if (checkList.Contains(infoRes.ChildAccountId) == true)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | checkList.Add(infoRes.DistributedMark);
|
| | | checkList.Add(infoRes.ChildAccountId);
|
| | | listMenberInfo.Add(infoRes);
|
| | | }
|
| | | return true;
|
| | |
| | | /// <param name="historyInfo">历史记录</param>
|
| | | /// <param name="dicName">名字</param>
|
| | | /// <param name="addLine">添加底线</param>
|
| | | private void AddLogInfoRow(HistoryInfo historyInfo, Dictionary<string, string> dicName, bool addLine = true)
|
| | | private void AddLogInfoRow(DoorHistoryLogInfo historyInfo, Dictionary<string, string> dicName, bool addLine = true)
|
| | | {
|
| | | var frameTable = new FrameRowControl(listView.rowSpace / 2);
|
| | | frameTable.UseClickStatu = false;
|
| | |
| | | //信息
|
| | | var btnMsg = frameTable.AddTopView("", 600);
|
| | | //人物
|
| | | string perName = dicName.ContainsKey(historyInfo.CloudAccountId) == true ? dicName[historyInfo.CloudAccountId] : Language.StringByID(R.MyInternationalizationString.uOther);
|
| | | string perName = dicName.ContainsKey(historyInfo.UserId) == true ? dicName[historyInfo.UserId] : Language.StringByID(R.MyInternationalizationString.uOther);
|
| | | frameTable.AddBottomView(perName, 600);
|
| | | //时间
|
| | | if (this.dateFromControl.dateValue == this.dateToControl.dateValue)
|
| | | {
|
| | | //如果日期范围一样,则不显示年月日
|
| | | frameTable.AddMostRightView(UserCenterLogic.ConvertUtcTimeToLocalTime(historyInfo.UnlockTime).ToString("HH:mm:ss"), 400);
|
| | | frameTable.AddMostRightView(HdlCommonLogic.Current.ConvertUtcTimeToLocalTime2(historyInfo.UnlockTime).ToString("HH:mm:ss"), 400);
|
| | | }
|
| | | else
|
| | | {
|
| | | //如果日期范围不一样,则显示年月日
|
| | | frameTable.AddMostRightView(UserCenterLogic.ConvertUtcTimeToLocalTime(historyInfo.UnlockTime).ToString("yyyy/MM/dd HH:mm:ss"), 700);
|
| | | frameTable.AddMostRightView(HdlCommonLogic.Current.ConvertUtcTimeToLocalTime2(historyInfo.UnlockTime).ToString("yyyy/MM/dd HH:mm:ss"), 700);
|
| | | }
|
| | | //底线
|
| | | if (addLine == true)
|
| | |
| | | }
|
| | |
|
| | | //其他消息
|
| | | if (historyInfo.OpenLockMode == -1)
|
| | | if (historyInfo.UnLockMode == -1)
|
| | | {
|
| | | //图片
|
| | | var device = Common.LocalDevice.Current.GetDevice(historyInfo.DeviceMac, historyInfo.DeviceEpoint);
|
| | | var device = HdlDeviceCommonLogic.Current.GetDevice(historyInfo.DeviceMac, historyInfo.DeviceEpoint);
|
| | | if (device == null)
|
| | | {
|
| | | btnIcon.UnSelectedImagePath = "Device/IntelligentLocks.png";
|
| | | }
|
| | | else
|
| | | {
|
| | | Common.LocalDevice.Current.SetDeviceIconToControl(btnIcon, device);
|
| | | HdlDeviceCommonLogic.Current.SetDeviceIconToControl(btnIcon, device);
|
| | | }
|
| | | //消息
|
| | | btnMsg.Text = historyInfo.AlarmMsg;
|
| | | }
|
| | | //门锁常开模式
|
| | | else if (historyInfo.OpenLockMode == 9000)
|
| | | else if (historyInfo.UnLockMode == 9000)
|
| | | {
|
| | | //图片
|
| | | btnIcon.UnSelectedImagePath = "Item/NormallyOpen.png";
|
| | | //消息
|
| | | if (historyInfo.OtherOpenLockMode == 9001)
|
| | | {
|
| | | //常开模式手动开启
|
| | | btnMsg.TextID = R.MyInternationalizationString.uNormallyOpenModeManualOpen;
|
| | | }
|
| | | else if (historyInfo.OtherOpenLockMode == 9002)
|
| | | {
|
| | | //常开模式手动取消
|
| | | btnMsg.TextID = R.MyInternationalizationString.uNormallyOpenModeManualClose;
|
| | | }
|
| | | else if (historyInfo.OtherOpenLockMode == 9003)
|
| | | {
|
| | | //常开模式启用{0}小时
|
| | | btnMsg.Text = Language.StringByID(R.MyInternationalizationString.uNormallyOpenModeOpenSomeTime).Replace("{0}", historyInfo.NormallyOpenContinuedTime);
|
| | | }
|
| | | else if (historyInfo.OtherOpenLockMode == 9004)
|
| | | {
|
| | | //常开自动化手动取消
|
| | | btnMsg.Text = Language.StringByID(R.MyInternationalizationString.uNormallyOpenLogicManualClose);
|
| | | }
|
| | | else
|
| | | {
|
| | | //上面是App手动推送,这里是网关或者门锁自己推送
|
| | | btnMsg.Text = historyInfo.AlarmMsg;
|
| | | }
|
| | | //这里是网关或者门锁自己推送
|
| | | btnMsg.Text = historyInfo.AlarmMsg;
|
| | | }
|
| | | //常开模式手动开启
|
| | | else if (historyInfo.UnLockMode == 9001)
|
| | | {
|
| | | //图片
|
| | | btnIcon.UnSelectedImagePath = "Item/NormallyOpen.png";
|
| | | btnMsg.TextID = R.MyInternationalizationString.uNormallyOpenModeManualOpen;
|
| | | }
|
| | | //常开模式手动取消
|
| | | else if (historyInfo.UnLockMode == 9002)
|
| | | {
|
| | | //图片
|
| | | btnIcon.UnSelectedImagePath = "Item/NormallyOpen.png";
|
| | | btnMsg.TextID = R.MyInternationalizationString.uNormallyOpenModeManualClose;
|
| | | }
|
| | | //常开模式启用{0}小时
|
| | | else if (historyInfo.UnLockMode == 9003)
|
| | | {
|
| | | //图片
|
| | | btnIcon.UnSelectedImagePath = "Item/NormallyOpen.png";
|
| | | btnMsg.Text = Language.StringByID(R.MyInternationalizationString.uNormallyOpenModeOpenSomeTime).Replace("{0}", historyInfo.NormallyOpenContinuedTime);
|
| | | }
|
| | | //常开自动化手动取消
|
| | | else if (historyInfo.UnLockMode == 9004)
|
| | | {
|
| | | //图片
|
| | | btnIcon.UnSelectedImagePath = "Item/NormallyOpen.png";
|
| | | btnMsg.Text = Language.StringByID(R.MyInternationalizationString.uNormallyOpenLogicManualClose);
|
| | | }
|
| | | //开锁成功
|
| | | else if (historyInfo.UnlockIsSuccess == true)
|
| | | else if (historyInfo.IsUnlockSuccess == true)
|
| | | {
|
| | | //图片
|
| | | btnIcon.UnSelectedImagePath = "Item/UnLockSuccess.png";
|
| | | //消息
|
| | | if (historyInfo.OpenLockMode == 0)
|
| | | if (historyInfo.UnLockMode == 0)
|
| | | {
|
| | | //密码开锁成功
|
| | | btnMsg.TextID = R.MyInternationalizationString.uUnlockByPasswordSuccess;
|
| | | }
|
| | | else if (historyInfo.OpenLockMode == 3)
|
| | | else if (historyInfo.UnLockMode == 3)
|
| | | {
|
| | | //IC卡开锁成功
|
| | | btnMsg.TextID = R.MyInternationalizationString.uUnlockByICcardSuccess;
|
| | | }
|
| | | else if (historyInfo.OpenLockMode == 13)
|
| | | else if (historyInfo.UnLockMode == 13)
|
| | | {
|
| | | //静脉纹开锁成功
|
| | | btnMsg.TextID = R.MyInternationalizationString.uStriaVenosusUnLockSuccess;
|
| | | }
|
| | | else if (historyInfo.OpenLockMode == 14)
|
| | | else if (historyInfo.UnLockMode == 14)
|
| | | {
|
| | | //人脸识别开锁成功
|
| | | btnMsg.TextID = R.MyInternationalizationString.uFaceRecognitionUnLockSuccess;
|
| | | }
|
| | | else if (historyInfo.OpenLockMode == 15)
|
| | | else if (historyInfo.UnLockMode == 15)
|
| | | {
|
| | | //指纹开锁成功
|
| | | btnMsg.TextID = R.MyInternationalizationString.uUnlockByFingerPrintSuccess;
|
| | |
| | | //图片
|
| | | btnIcon.UnSelectedImagePath = "Item/UnLockFail.png";
|
| | | //消息
|
| | | if (historyInfo.OpenLockMode == 0)
|
| | | if (historyInfo.UnLockMode == 0)
|
| | | {
|
| | | //密码开锁失败
|
| | | btnMsg.TextID = R.MyInternationalizationString.uUnlockByPasswordFail;
|
| | | }
|
| | | else if (historyInfo.OpenLockMode == 3)
|
| | | else if (historyInfo.UnLockMode == 3)
|
| | | {
|
| | | //IC卡开锁失败
|
| | | btnMsg.TextID = R.MyInternationalizationString.uUnlockByICcardFail;
|
| | | }
|
| | | else if (historyInfo.OpenLockMode == 13)
|
| | | else if (historyInfo.UnLockMode == 13)
|
| | | {
|
| | | //静脉纹开锁失败
|
| | | btnMsg.TextID = R.MyInternationalizationString.uStriaVenosusUnLockFail;
|
| | | }
|
| | | else if (historyInfo.OpenLockMode == 14)
|
| | | else if (historyInfo.UnLockMode == 14)
|
| | | {
|
| | | //人脸识别开锁失败
|
| | | btnMsg.TextID = R.MyInternationalizationString.uFaceRecognitionUnLockFail;
|
| | | }
|
| | | else if (historyInfo.OpenLockMode == 15)
|
| | | else if (historyInfo.UnLockMode == 15)
|
| | | {
|
| | | //指纹开锁失败
|
| | | btnMsg.TextID = R.MyInternationalizationString.uUnlockByFingerPrintFail;
|
| | |
| | | var dic = new Dictionary<string, string>();
|
| | | for (int i = 0; i < listMenberInfo.Count; i++)
|
| | | {
|
| | | dic.Add(listMenberInfo[i].SubAccountDistributedMark, string.IsNullOrEmpty(listMenberInfo[i].UserName) == false ? listMenberInfo[i].UserName : listMenberInfo[i].Account);
|
| | | dic.Add(listMenberInfo[i].ChildAccountId, listMenberInfo[i].ShowName);
|
| | | }
|
| | | //显示底部类型筛选
|
| | | var form = new DoorLockScreeningTypeForm();
|
| | |
| | | /// 筛选历史记录
|
| | | /// </summary>
|
| | | /// <returns></returns>
|
| | | private List<HistoryInfo> ScreeningHistoryData(Dictionary<string, string> dicMemberName)
|
| | | private List<DoorHistoryLogInfo> ScreeningHistoryData(Dictionary<string, string> dicMemberName)
|
| | | {
|
| | | //历史记录太麻烦了,存在不同的数据库表里,并且数据还不一样,只能这样一个个判断了
|
| | | var listScreeningData = new List<HistoryInfo>();
|
| | | var listScreeningData = new List<DoorHistoryLogInfo>();
|
| | | //清除掉之前的记录
|
| | | this.listOtherMsgId = new List<string>();
|
| | |
|
| | |
| | | /// <param name="selectAllUser">是否选择全选用户</param>
|
| | | /// <param name="selectOtherUser">是否单选了其他</param>
|
| | | /// <param name="slectAllLockMode">是否选择全选开锁方式</param>
|
| | | private bool CheckHistoryDataCanShow(HistoryInfo info, Dictionary<string, string> dicMemberName,
|
| | | private bool CheckHistoryDataCanShow(DoorHistoryLogInfo info, Dictionary<string, string> dicMemberName,
|
| | | bool selectAllUser, bool selectOtherUser, bool slectAllLockMode)
|
| | | {
|
| | | //如果没有选择 全选用户
|
| | | if (selectAllUser == false)
|
| | | {
|
| | | //如果这个用户ID不包含在指定选择的成员列表里面
|
| | | if (this.listSearchUserId.Contains(info.CloudAccountId) == false)
|
| | | if (this.listSearchUserId.Contains(info.UserId) == false)
|
| | | {
|
| | | if (dicMemberName.ContainsKey(info.CloudAccountId) == true)
|
| | | if (dicMemberName.ContainsKey(info.UserId) == true)
|
| | | {
|
| | | //如果能够识别这个id的话,则表示它不属于其他类,并且也不再选择目标内
|
| | | return false;
|
| | |
| | | }
|
| | | }
|
| | | //如果是成员身份,并且用户ID不为空
|
| | | if (UserCenterResourse.UserInfo.AuthorityNo == 3 && info.CloudAccountId != string.Empty)
|
| | | if (HdlUserCenterResourse.ResidenceOption.AuthorityNo == 3 && info.UserId != string.Empty)
|
| | | {
|
| | | //成员不能看到 其他人的记录(成员的时候,这个变量里面只有他自己一个)
|
| | | if (dicMemberName.ContainsKey(info.CloudAccountId) == false)
|
| | | if (dicMemberName.ContainsKey(info.UserId) == false)
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
| | | if (slectAllLockMode == false)
|
| | | {
|
| | | //如果这个开锁方式不在选择的列表里面的话
|
| | | if (this.listSearchLockId.Contains(info.OpenLockMode) == false)
|
| | | if (this.listSearchLockId.Contains(info.UnLockMode) == false)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | //另一张表的数据主键
|
| | | if (info.OpenLockMode == -1 || info.OpenLockMode == 9000)
|
| | | if (info.UnLockMode == -1 || info.UnLockMode == 9000)
|
| | | {
|
| | | if (info.MsgKeyId != string.Empty)
|
| | | {
|
| | |
| | | /// 获取历史记录
|
| | | /// </summary>
|
| | | /// <returns></returns>
|
| | | private List<HistoryInfo> GetHistoryLogInfo(Dictionary<string, string> dicMemberName)
|
| | | private List<DoorHistoryLogInfo> GetHistoryLogInfo(Dictionary<string, string> dicMemberName)
|
| | | {
|
| | | if (this.listHistoryInfo != null)
|
| | | {
|
| | | //不二次获取,主要针对的是筛选功能
|
| | | return this.ScreeningHistoryData(dicMemberName);
|
| | | }
|
| | | //获取访问云端接口的启动参数
|
| | | var pra = this.GetReadHistoryPra();
|
| | |
|
| | | var dateFrom = new DateTime(dateFromControl.Year, dateFromControl.Month, dateFromControl.Day, 0, 0, 0);
|
| | | var dateTo = new DateTime(dateToControl.Year, dateToControl.Month, dateToControl.Day, 23, 59, 59);
|
| | |
|
| | | //获取门锁的打开和关闭记录
|
| | | var listAllLog = this.GetDoorOpenHistoryLog(pra);
|
| | | var listAllLog = HdlDeviceDoorLockLogic.Current.GetDoorHistoryLogInfo(this.GetDoorId(), dateFrom, dateTo);
|
| | |
|
| | | //获取门锁的其他记录
|
| | | var listOtherLog = this.GetDoorOtherHistoryLog(pra.UnlockTimeBegin, pra.UnlockTimeEnd);
|
| | | var listOtherLog = this.GetDoorOtherHistoryLog(dateFrom, dateTo);
|
| | | listAllLog.AddRange(listOtherLog);
|
| | |
|
| | | //排序一下
|
| | | var dicAllData = new Dictionary<string, List<HistoryInfo>>();
|
| | | var dicAllData = new Dictionary<string, List<DoorHistoryLogInfo>>();
|
| | | var listSortTime = new List<string>();
|
| | |
|
| | | foreach (var data in listAllLog)
|
| | |
| | | //按时间分组
|
| | | if (dicAllData.ContainsKey(data.UnlockTime) == false)
|
| | | {
|
| | | dicAllData[data.UnlockTime] = new List<HistoryInfo>();
|
| | | dicAllData[data.UnlockTime] = new List<DoorHistoryLogInfo>();
|
| | | listSortTime.Add(data.UnlockTime);
|
| | | }
|
| | | dicAllData[data.UnlockTime].Add(data);
|
| | |
| | |
|
| | | //执行排序,时间大的在前面
|
| | | listSortTime.Sort();
|
| | | this.listHistoryInfo = new List<HistoryInfo>();
|
| | | this.listHistoryInfo = new List<DoorHistoryLogInfo>();
|
| | | for (int i = listSortTime.Count - 1; i >= 0; i--)
|
| | | {
|
| | | this.listHistoryInfo.AddRange(dicAllData[listSortTime[i]]);
|
| | | }
|
| | | //筛选历史记录
|
| | | return this.ScreeningHistoryData(dicMemberName);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 获取门锁的打开和关闭记录
|
| | | /// </summary>
|
| | | /// <param name="i_pra"></param>
|
| | | /// <returns></returns>
|
| | | private List<HistoryInfo> GetDoorOpenHistoryLog(GetHistoryDataPra i_pra)
|
| | | {
|
| | | var listLog = new List<HistoryInfo>();
|
| | |
|
| | | int nowPage = 0;
|
| | | while (true)
|
| | | {
|
| | | //访问云端
|
| | | var result = UserCenterLogic.GetResponseDataByRequestHttps("DoorLock/GetDoorLockHistoryPager", true, i_pra);
|
| | | if (string.IsNullOrEmpty(result) == true)
|
| | | {
|
| | | return null;
|
| | | }
|
| | | var dataInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<GetHistoryDataResult>(result);
|
| | | foreach (var data in dataInfo.PageData)
|
| | | {
|
| | | //不知道为什么会有上报了虚拟9000的那个特殊的东西
|
| | | if (data.OpenLockMode == 9000 && data.OtherOpenLockMode <= 9000)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | if (data.CloudAccountId == null)
|
| | | {
|
| | | data.CloudAccountId = string.Empty;
|
| | | }
|
| | | listLog.Add(data);
|
| | | }
|
| | |
|
| | | if (dataInfo.HasNextPage == false)
|
| | | {
|
| | | break;
|
| | | }
|
| | | //获取下一页
|
| | | nowPage++;
|
| | | i_pra.PageSetting.Page = nowPage;
|
| | | }
|
| | |
|
| | | return listLog;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | /// 获取门锁的其他记录
|
| | | /// </summary>
|
| | | /// <returns></returns>
|
| | | private List<HistoryInfo> GetDoorOtherHistoryLog(string beginTime, string endTime)
|
| | | private List<DoorHistoryLogInfo> GetDoorOtherHistoryLog(DateTime beginTime, DateTime endTime)
|
| | | {
|
| | | var listLog = new List<HistoryInfo>();
|
| | | var listLog = new List<DoorHistoryLogInfo>();
|
| | | //转为utc时间
|
| | | var utcFrom = beginTime.ToUniversalTime();
|
| | | var utcTo = endTime.ToUniversalTime();
|
| | |
|
| | | //获取门锁其他类信息上报
|
| | | var pra2 = new MessageInfoPra();
|
| | | pra2.BeginTime = beginTime;
|
| | | pra2.EndTime = endTime;
|
| | | pra2.Topic = "/Alarms/SendAlarmInform";
|
| | | pra2.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
|
| | | var result = UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", true, pra2);
|
| | | if (string.IsNullOrEmpty(result) == true)
|
| | | //去另一张表去获取它的其他消息记录
|
| | | var listMsg = HdlMessageLogic.Current.GetListMessageFromDb();
|
| | | if (listMsg == null)
|
| | | {
|
| | | return null;
|
| | | return listLog;
|
| | | }
|
| | | this.AdjustDoorOtherAlarmData(ref listLog, result);
|
| | |
|
| | | //从自动化中,获取常开模式记录
|
| | | pra2.Topic = "/Logic/Execute_Respon";
|
| | | result = UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", true, pra2);
|
| | | if (string.IsNullOrEmpty(result) == true)
|
| | | foreach (var msgInfo in listMsg)
|
| | | {
|
| | | return null;
|
| | | //时间不是13位的都不理
|
| | | if (msgInfo.CreateTime.Length != 13) { continue; }
|
| | | //获取门锁其他类信息上报
|
| | | if (msgInfo.MessageTitle == "/Alarms/SendAlarmInform")
|
| | | {
|
| | | //判断是不是这个时间段
|
| | | var checkDate = HdlCommonLogic.Current.ConvertUtcTimeToLocalTime2(msgInfo.CreateTime);
|
| | | if (utcFrom <= checkDate && checkDate <= utcTo)
|
| | | {
|
| | | this.AdjustDoorOtherAlarmData(ref listLog, msgInfo);
|
| | | }
|
| | | }
|
| | | //从自动化中,获取常开模式记录
|
| | | else if (msgInfo.MessageTitle == "/Logic/Execute_Respon")
|
| | | {
|
| | | //判断是不是这个时间段
|
| | | var checkDate = HdlCommonLogic.Current.ConvertUtcTimeToLocalTime2(msgInfo.CreateTime);
|
| | | if (utcFrom <= checkDate && checkDate <= utcTo)
|
| | | {
|
| | | this.AdjustDoorNormallyOpenData(ref listLog, msgInfo);
|
| | | }
|
| | | }
|
| | | //获取门锁临时密码开锁记录
|
| | | else if (msgInfo.MessageTitle == "/DoorLock/DoorLockOperatingEventNotificationCommand")
|
| | | {
|
| | | //判断是不是这个时间段
|
| | | var checkDate = HdlCommonLogic.Current.ConvertUtcTimeToLocalTime2(msgInfo.CreateTime);
|
| | | if (utcFrom <= checkDate && checkDate <= utcTo)
|
| | | {
|
| | | this.AdjustDoorTemporaryPasswordData(ref listLog, msgInfo);
|
| | | }
|
| | | }
|
| | | }
|
| | | this.AdjustDoorNormallyOpenData(ref listLog, result);
|
| | |
|
| | | //获取门锁临时密码开锁记录
|
| | | pra2.Topic = "/DoorLock/DoorLockOperatingEventNotificationCommand";
|
| | | result = UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", true, pra2);
|
| | | if (string.IsNullOrEmpty(result) == true)
|
| | | {
|
| | | return null;
|
| | | }
|
| | | this.AdjustDoorTemporaryPasswordData(ref listLog, result);
|
| | |
|
| | | return listLog;
|
| | | }
|
| | |
| | | /// 处理门锁常开模式记录信息
|
| | | /// </summary>
|
| | | /// <param name="listLog"></param>
|
| | | /// <param name="result"></param>
|
| | | private void AdjustDoorOtherAlarmData(ref List<HistoryInfo> listLog, string result)
|
| | | /// <param name="i_msgData"></param>
|
| | | private void AdjustDoorOtherAlarmData(ref List<DoorHistoryLogInfo> listLog, MessageRecordInfo i_msgData)
|
| | | {
|
| | | var dataInfo2 = Newtonsoft.Json.JsonConvert.DeserializeObject<MessageCentetInfo>(result);
|
| | | string doorKey = this.DeviceDoor.DeviceAddr + "_" + this.DeviceDoor.DeviceEpoint;
|
| | | foreach (var myInfo in dataInfo2.PageData)
|
| | | string doorKey = this.GetDoorId();
|
| | | //设备对象
|
| | | var jobject = Newtonsoft.Json.Linq.JObject.Parse(i_msgData.MessageExpand);
|
| | | string deviceAddr = jobject.Value<string>("DeviceAddr");
|
| | | int deviceEpoint = jobject.Value<int>("Epoint");
|
| | | if (doorKey != deviceAddr + "_" + deviceEpoint)
|
| | | {
|
| | | //设备对象
|
| | | var jobject = Newtonsoft.Json.Linq.JObject.Parse(myInfo.PayloadJson);
|
| | | string deviceAddr = jobject.Value<string>("DeviceAddr");
|
| | | int deviceEpoint = jobject.Value<int>("Epoint");
|
| | | if (doorKey != deviceAddr + "_" + deviceEpoint)
|
| | | {
|
| | | //不是同一个门锁的记录
|
| | | continue;
|
| | | }
|
| | |
|
| | | var data = new HistoryInfo();
|
| | | data.DeviceMac = deviceAddr;
|
| | | data.DeviceEpoint = deviceEpoint;
|
| | | //消息
|
| | | var msgInfo = HdlAlarmsLogic.Current.GetDoorLockAlarmInfo(jobject);
|
| | | data.AlarmMsg = msgInfo != null ? msgInfo.AlarmMsg : Language.StringByID(R.MyInternationalizationString.uDoorLocksAlarmHadTriggered);
|
| | | //时间
|
| | | data.UnlockTime = myInfo.CreatedOnUtc;
|
| | | //主键
|
| | | data.MsgKeyId = myInfo.Id;
|
| | | //消息区分
|
| | | if (msgInfo.MsgDiv == 9000)
|
| | | {
|
| | | data.OpenLockMode = 9000;
|
| | | }
|
| | | listLog.Add(data);
|
| | | //不是同一个门锁的记录
|
| | | return;
|
| | | }
|
| | |
|
| | | var data = new DoorHistoryLogInfo();
|
| | | data.DeviceMac = deviceAddr;
|
| | | data.DeviceEpoint = deviceEpoint;
|
| | | //消息
|
| | | var msgInfo = HdlAlarmsLogic.Current.GetDoorLockAlarmInfo(jobject);
|
| | | data.AlarmMsg = msgInfo != null ? msgInfo.AlarmMsg : Language.StringByID(R.MyInternationalizationString.uDoorLocksAlarmHadTriggered);
|
| | | //时间
|
| | | data.UnlockTime = i_msgData.CreateTime;
|
| | | //主键
|
| | | data.MsgKeyId = i_msgData.Id;
|
| | | //消息区分
|
| | | if (msgInfo.MsgDiv == 9000)
|
| | | {
|
| | | data.UnLockMode = 9000;
|
| | | }
|
| | | listLog.Add(data);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 处理门锁常开模式信息上报
|
| | | /// </summary>
|
| | | /// <param name="listLog"></param>
|
| | | /// <param name="result"></param>
|
| | | private void AdjustDoorNormallyOpenData(ref List<HistoryInfo> listLog, string result)
|
| | | /// <param name="i_msgData"></param>
|
| | | private void AdjustDoorNormallyOpenData(ref List<DoorHistoryLogInfo> listLog, MessageRecordInfo i_msgData)
|
| | | {
|
| | | var dataInfo2 = Newtonsoft.Json.JsonConvert.DeserializeObject<MessageCentetInfo>(result);
|
| | | string doorKey = this.DeviceDoor.DeviceAddr + "_" + this.DeviceDoor.DeviceEpoint;
|
| | | foreach (var myInfo in dataInfo2.PageData)
|
| | | string doorKey = this.GetDoorId();
|
| | | var jobject = Newtonsoft.Json.Linq.JObject.Parse(i_msgData.MessageExpand);
|
| | | var myActionData = Newtonsoft.Json.JsonConvert.DeserializeObject<LogicPushResult>(jobject["Data"].ToString());
|
| | | if (myActionData.ActionData == null || myActionData.ActionData.Actiontype != 8)
|
| | | {
|
| | | var jobject = Newtonsoft.Json.Linq.JObject.Parse(myInfo.PayloadJson);
|
| | | var myActionData = Newtonsoft.Json.JsonConvert.DeserializeObject<LogicPushResult>(jobject["Data"].ToString());
|
| | | if (myActionData.ActionData == null || myActionData.ActionData.Actiontype != 8)
|
| | | {
|
| | | //不是常开模式的自动化
|
| | | continue;
|
| | | }
|
| | | string deviceAddr = myActionData.ActionData.MacStr;
|
| | | int deviceEpoint = myActionData.ActionData.Epoint;
|
| | | if (doorKey != deviceAddr + "_" + deviceEpoint)
|
| | | {
|
| | | //不是同一个门锁的记录
|
| | | continue;
|
| | | }
|
| | |
|
| | | var data = new HistoryInfo();
|
| | | data.DeviceMac = deviceAddr;
|
| | | data.DeviceEpoint = deviceEpoint;
|
| | | //消息
|
| | | if (myActionData.ActionData.PassDataString == "055704010112")
|
| | | {
|
| | | //常开模式开启(自动化触发)
|
| | | data.AlarmMsg = Language.StringByID(R.MyInternationalizationString.uDoorLockAlarmMsg11);
|
| | | }
|
| | | else if (myActionData.ActionData.PassDataString == "055704010113")
|
| | | {
|
| | | //常开模式结束(自动化触发)
|
| | | data.AlarmMsg = Language.StringByID(R.MyInternationalizationString.uDoorLockAlarmMsg12);
|
| | | }
|
| | | else
|
| | | {
|
| | | continue;
|
| | | }
|
| | | //时间
|
| | | data.UnlockTime = myInfo.CreatedOnUtc;
|
| | | //主键
|
| | | data.MsgKeyId = myInfo.Id;
|
| | | //消息区分
|
| | | data.OpenLockMode = 9000;
|
| | |
|
| | | listLog.Add(data);
|
| | | //不是常开模式的自动化
|
| | | return;
|
| | | }
|
| | | string deviceAddr = myActionData.ActionData.MacStr;
|
| | | int deviceEpoint = myActionData.ActionData.Epoint;
|
| | | if (doorKey != deviceAddr + "_" + deviceEpoint)
|
| | | {
|
| | | //不是同一个门锁的记录
|
| | | return;
|
| | | }
|
| | |
|
| | | var data = new DoorHistoryLogInfo();
|
| | | data.DeviceMac = deviceAddr;
|
| | | data.DeviceEpoint = deviceEpoint;
|
| | | //消息
|
| | | if (myActionData.ActionData.PassDataString == "055704010112")
|
| | | {
|
| | | //常开模式开启(自动化触发)
|
| | | data.AlarmMsg = Language.StringByID(R.MyInternationalizationString.uDoorLockAlarmMsg11);
|
| | | }
|
| | | else if (myActionData.ActionData.PassDataString == "055704010113")
|
| | | {
|
| | | //常开模式结束(自动化触发)
|
| | | data.AlarmMsg = Language.StringByID(R.MyInternationalizationString.uDoorLockAlarmMsg12);
|
| | | }
|
| | | else
|
| | | {
|
| | | return;
|
| | | }
|
| | | //时间
|
| | | data.UnlockTime = i_msgData.CreateTime;
|
| | | //主键
|
| | | data.MsgKeyId = i_msgData.Id;
|
| | | //消息区分
|
| | | data.UnLockMode = 9000;
|
| | |
|
| | | listLog.Add(data);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 处理门锁临时密码上报
|
| | | /// </summary>
|
| | | /// <param name="listLog"></param>
|
| | | /// <param name="result"></param>
|
| | | private void AdjustDoorTemporaryPasswordData(ref List<HistoryInfo> listLog, string result)
|
| | | /// <param name="i_msgData"></param>
|
| | | private void AdjustDoorTemporaryPasswordData(ref List<DoorHistoryLogInfo> listLog, MessageRecordInfo i_msgData)
|
| | | {
|
| | | var dataInfo2 = Newtonsoft.Json.JsonConvert.DeserializeObject<MessageCentetInfo>(result);
|
| | | string doorKey = this.DeviceDoor.DeviceAddr + "_" + this.DeviceDoor.DeviceEpoint;
|
| | | foreach (var myInfo in dataInfo2.PageData)
|
| | | string doorKey = this.GetDoorId();
|
| | | var jobject = Newtonsoft.Json.Linq.JObject.Parse(i_msgData.MessageExpand);
|
| | | string deviceAddr = jobject.Value<string>("DeviceAddr");
|
| | | int deviceEpoint = jobject.Value<int>("Epoint");
|
| | | if (doorKey != deviceAddr + "_" + deviceEpoint)
|
| | | {
|
| | | var jobject = Newtonsoft.Json.Linq.JObject.Parse(myInfo.PayloadJson);
|
| | | string deviceAddr = jobject.Value<string>("DeviceAddr");
|
| | | int deviceEpoint = jobject.Value<int>("Epoint");
|
| | | if (doorKey != deviceAddr + "_" + deviceEpoint)
|
| | | {
|
| | | //不是同一个门锁的记录
|
| | | continue;
|
| | | }
|
| | | var myActionData = Newtonsoft.Json.JsonConvert.DeserializeObject<PasswordOperationData>(jobject["Data"].ToString());
|
| | | if (myActionData.UserID != 246)
|
| | | {
|
| | | //不是临时密码
|
| | | continue;
|
| | | }
|
| | | var data = new HistoryInfo();
|
| | | data.DeviceMac = deviceAddr;
|
| | | data.DeviceEpoint = deviceEpoint;
|
| | | //消息
|
| | | if (myActionData.OperationEventCode == 2)
|
| | | {
|
| | | //临时密码开锁成功
|
| | | data.AlarmMsg = Language.StringByID(R.MyInternationalizationString.uDoorLockAlarmMsg13);
|
| | | }
|
| | | else
|
| | | {
|
| | | //临时密码开锁失败
|
| | | data.AlarmMsg = Language.StringByID(R.MyInternationalizationString.uDoorLockAlarmMsg14);
|
| | | }
|
| | | //时间
|
| | | data.UnlockTime = myInfo.CreatedOnUtc;
|
| | | //主键
|
| | | data.MsgKeyId = myInfo.Id;
|
| | |
|
| | | listLog.Add(data);
|
| | | //不是同一个门锁的记录
|
| | | return;
|
| | | }
|
| | | var myActionData = Newtonsoft.Json.JsonConvert.DeserializeObject<PasswordOperationData>(jobject["Data"].ToString());
|
| | | if (myActionData.UserID != 246)
|
| | | {
|
| | | //不是临时密码
|
| | | return;
|
| | | }
|
| | | var data = new DoorHistoryLogInfo();
|
| | | data.DeviceMac = deviceAddr;
|
| | | data.DeviceEpoint = deviceEpoint;
|
| | | //消息
|
| | | if (myActionData.OperationEventCode == 2)
|
| | | {
|
| | | //临时密码开锁成功
|
| | | data.AlarmMsg = Language.StringByID(R.MyInternationalizationString.uDoorLockAlarmMsg13);
|
| | | }
|
| | | else
|
| | | {
|
| | | //临时密码开锁失败
|
| | | data.AlarmMsg = Language.StringByID(R.MyInternationalizationString.uDoorLockAlarmMsg14);
|
| | | }
|
| | | //时间
|
| | | data.UnlockTime = i_msgData.CreateTime;
|
| | | //主键
|
| | | data.MsgKeyId = i_msgData.Id;
|
| | |
|
| | | listLog.Add(data);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | /// </summary>
|
| | | private void ClearAllHistoryLog()
|
| | | {
|
| | | //获取访问云端接口的启动参数(2020.05.08:全部清空)
|
| | | var pra = this.GetDeleteDataPra();
|
| | |
|
| | | DateTime dateFrom = new DateTime(dateFromControl.Year, dateFromControl.Month, dateFromControl.Day, 0, 0, 0);
|
| | | DateTime dateTo = new DateTime(dateToControl.Year, dateToControl.Month, dateToControl.Day, 23, 59, 59);
|
| | | //打开进度条
|
| | | this.ShowProgressBar();
|
| | | var result = UserCenterLogic.GetResultStatuByRequestHttps("DoorLock/ClearDoorLockHistory", true, pra);
|
| | | if (result == false)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | //删除其他消息
|
| | | if (listOtherMsgId.Count > 0)
|
| | | {
|
| | | var pra2 = new MessageReadStatuPra();
|
| | | pra2.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
|
| | | for (int i = 0; i < listOtherMsgId.Count; i++)
|
| | | {
|
| | | pra2.Id = listOtherMsgId[i];
|
| | | result = UserCenterLogic.GetResultStatuByRequestHttps("MessageCenter/DelMessageCenterItem", true, pra2);
|
| | | if (result == false)
|
| | | {
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | | //关闭进度条
|
| | | this.CloseProgressBar();
|
| | | if (result == false)
|
| | | {
|
| | | return;
|
| | | }
|
| | | //不管结果
|
| | | var result = HdlDeviceDoorLockLogic.Current.ClearAllDoorHistoryLog(this.GetDoorId(), dateFrom, dateTo, listOtherMsgId);
|
| | |
|
| | | //清空
|
| | | this.listOtherMsgId = new List<string>();
|
| | |
| | |
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | this.listView.frameTable.RemoveAll();
|
| | | listView.frameTable.Height = bodyFrameLayout.Height - Application.GetRealHeight(115 - 3);
|
| | | //重新刷新界面
|
| | | this.InitLogListInfo(true);
|
| | | });
|
| | | }
|
| | |
|
| | |
| | | #region ■ 一般方法___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 获取访问云端接口的启动参数
|
| | | /// 获取访问云端的DoorID
|
| | | /// </summary>
|
| | | /// <returns></returns>
|
| | | private GetHistoryDataPra GetReadHistoryPra()
|
| | | private string GetDoorId()
|
| | | {
|
| | | DateTime dateFrom = new DateTime(dateFromControl.Year, dateFromControl.Month, dateFromControl.Day, 0, 0, 0);
|
| | | DateTime dateTo = new DateTime(dateToControl.Year, dateToControl.Month, dateToControl.Day, 23, 59, 59);
|
| | |
|
| | | //全部读取
|
| | | var pra = new GetHistoryDataPra();
|
| | | pra.UnlockTimeBegin = dateFrom.ToUniversalTime().ToString();
|
| | | pra.UnlockTimeEnd = dateTo.ToUniversalTime().ToString();
|
| | | pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
|
| | | pra.DoorLockId = this.DeviceDoor.DeviceAddr + "_" + this.DeviceDoor.DeviceEpoint;
|
| | |
|
| | | return pra;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 获取删除数据的云端接口的启动参数
|
| | | /// </summary>
|
| | | /// <returns></returns>
|
| | | private DeleteHistoryDataPra GetDeleteDataPra()
|
| | | {
|
| | | DateTime dateFrom = new DateTime(dateFromControl.Year, dateFromControl.Month, dateFromControl.Day, 0, 0, 0);
|
| | | DateTime dateTo = new DateTime(dateToControl.Year, dateToControl.Month, dateToControl.Day, 23, 59, 59);
|
| | |
|
| | | var pra = new DeleteHistoryDataPra();
|
| | | pra.UnlockTimeBegin = dateFrom.ToUniversalTime().ToString();
|
| | | pra.UnlockTimeEnd = dateTo.ToUniversalTime().ToString();
|
| | | pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
|
| | | pra.DoorLockId = this.DeviceDoor.DeviceAddr + "_" + this.DeviceDoor.DeviceEpoint;
|
| | |
|
| | | return pra;
|
| | | return this.DeviceDoor.DeviceAddr + "_" + this.DeviceDoor.DeviceEpoint;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 结构体_____________________________
|
| | |
|
| | | /// <summary> |
| | | /// 获取历史记录数据 |
| | | /// </summary> |
| | | private class GetHistoryDataPra : IfacePraCommon
|
| | | {
|
| | | /// <summary> |
| | | /// RequestVersion |
| | | /// </summary> |
| | | public string RequestVersion = Common.CommonPage.RequestVersion;
|
| | | /// <summary> |
| | | /// Token |
| | | /// </summary> |
| | | public string LoginAccessToken = string.Empty;
|
| | | /// <summary> |
| | | /// 住宅ID |
| | | /// </summary> |
| | | public string HomeId = Common.Config.Instance.Home.Id;
|
| | | /// <summary>
|
| | | /// 门锁的Mac地址
|
| | | /// </summary>
|
| | | public string DoorLockId = string.Empty;
|
| | | /// <summary>
|
| | | /// Config.Instance.Guid 或者 MemberInfoRes.SubAccountDistributedMark
|
| | | /// </summary>
|
| | | public List<string> CloudAccountIdArr = new List<string>();
|
| | | /// <summary>
|
| | | /// 开锁方式(0:密码、15:指纹、3:IC卡)
|
| | | /// </summary>
|
| | | public List<int> OpenLockModeArr = null;
|
| | | /// <summary>
|
| | | /// 开锁是否成功
|
| | | /// </summary>
|
| | | public bool? UnlockIsSuccess = null;
|
| | | /// <summary>
|
| | | /// 搜索开锁开始时间
|
| | | /// </summary>
|
| | | public string UnlockTimeBegin;
|
| | | /// <summary>
|
| | | /// 搜索开锁结束时间
|
| | | /// </summary>
|
| | | public string UnlockTimeEnd;
|
| | | /// <summary>
|
| | | /// 页数
|
| | | /// </summary>
|
| | | public PageSettingInfo PageSetting = new PageSettingInfo() { PageSize = 100 };
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 获取历史记录的结果
|
| | | /// </summary>
|
| | | private class GetHistoryDataResult
|
| | | {
|
| | | /// <summary>
|
| | | /// 数据
|
| | | /// </summary>
|
| | | public List<HistoryInfo> PageData = null;
|
| | | /// <summary>
|
| | | /// 是否存在下一页的数据
|
| | | /// </summary>
|
| | | public bool HasNextPage = false;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 删除历史记录数据
|
| | | /// </summary>
|
| | | private class DeleteHistoryDataPra : IfacePraCommon
|
| | | {
|
| | | /// <summary>
|
| | | /// RequestVersion
|
| | | /// </summary>
|
| | | public string RequestVersion = Common.CommonPage.RequestVersion;
|
| | | /// <summary>
|
| | | /// Token
|
| | | /// </summary>
|
| | | public string LoginAccessToken = string.Empty;
|
| | | /// <summary>
|
| | | /// 住宅ID
|
| | | /// </summary>
|
| | | public string HomeId = Common.Config.Instance.Home.Id;
|
| | | /// <summary>
|
| | | /// 门锁的Mac地址
|
| | | /// </summary>
|
| | | public string DoorLockId = string.Empty;
|
| | | /// <summary>
|
| | | /// Config.Instance.Guid 或者 MemberInfoRes.SubAccountDistributedMark
|
| | | /// </summary>
|
| | | public List<string> CloudAccountIds = null;
|
| | | /// <summary>
|
| | | /// 开锁方式(0:密码、15:指纹、3:IC卡)
|
| | | /// </summary>
|
| | | public List<int> OpenLockModes = null;
|
| | | /// <summary>
|
| | | /// 搜索开锁开始时间
|
| | | /// </summary>
|
| | | public string UnlockTimeBegin;
|
| | | /// <summary>
|
| | | /// 搜索开锁结束时间
|
| | | /// </summary>
|
| | | public string UnlockTimeEnd;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 历史记录的结果
|
| | | /// </summary>
|
| | | private class HistoryInfo
|
| | | {
|
| | | /// <summary>
|
| | | /// 开锁方式 0:密码 13:静脉纹 14:人脸识别 15:指纹 3:IC卡 9000:常开模式(自定义的)
|
| | | /// </summary>
|
| | | public int OpenLockMode = -1;
|
| | | /// <summary>
|
| | | /// 开锁时间
|
| | | /// </summary>
|
| | | public string UnlockTime = string.Empty;
|
| | | /// <summary>
|
| | | /// 开锁是否成功
|
| | | /// </summary>
|
| | | public bool UnlockIsSuccess = false;
|
| | | /// <summary>
|
| | | /// 账号的ID
|
| | | /// </summary>
|
| | | public string CloudAccountId = string.Empty;
|
| | | /// <summary>
|
| | | /// 其他开锁方式(OpenLockMode=9000时有效) 9001:常开打开 9002:常开取消 9003:常开持续 9004:常开自动化手动取消
|
| | | /// </summary>
|
| | | public int? OtherOpenLockMode = -1;
|
| | | /// <summary>
|
| | | /// 常开持续时间(1~72小时 OtherOpenLockMode=9003的时候有效)
|
| | | /// </summary>
|
| | | public string NormallyOpenContinuedTime = string.Empty;
|
| | | /// <summary>
|
| | | /// 当开锁方式为-1时使用,它属于其他类
|
| | | /// </summary>
|
| | | public string AlarmMsg = string.Empty;
|
| | | /// <summary>
|
| | | /// 当开锁方式为-1时使用,设备Mac
|
| | | /// </summary>
|
| | | public string DeviceMac = string.Empty;
|
| | | /// <summary>
|
| | | /// 当开锁方式为-1时使用,设备端点
|
| | | /// </summary>
|
| | | public int DeviceEpoint = 0;
|
| | | /// <summary>
|
| | | /// 当开锁方式为-1时使用,消息的数据库主键 |
| | | /// </summary>
|
| | | public string MsgKeyId = string.Empty;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 临时密码数据
|