From 4dce704aaf8587cf3f91cf88f2208315a03c4cbb Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期三, 08 四月 2020 13:54:58 +0800 Subject: [PATCH] 先上传一个版本 --- ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs | 431 +++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 314 insertions(+), 117 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs index 98bb400..c309fd3 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Text; using System.Threading.Tasks; +using ZigBee.Device; namespace Shared.Phone.UserCenter.DeviceDoorLock { @@ -15,7 +16,7 @@ /// <summary> /// 鍒楄〃鎺т欢 /// </summary> - private VerticalListControl listView = null; + private VerticalFrameRefreshControl listView = null; /// <summary> /// 鏃ユ湡From鎺т欢 /// </summary> @@ -29,9 +30,9 @@ /// </summary> private List<MemberInfoRes> listMenberInfo = null; /// <summary> - /// 璁惧鐨凪ac鍦板潃 + /// 璁惧瀵硅薄 /// </summary> - private string DeviceMac = string.Empty; + private CommonDevice DeviceDoor = null; /// <summary> /// 妫�绱㈠璞$殑ID(-1:鎵�鏈� 绌哄瓧绗︿覆:鍏朵粬) /// </summary> @@ -40,6 +41,14 @@ /// 妫�绱㈠紑閿佹柟寮忕殑ID(-1:鎵�鏈� 0:瀵嗙爜 15:鎸囩汗 3:IC鍗�) /// </summary> private List<int> listSearchLockId = new List<int>() { -1 }; + /// <summary> + /// 鍏朵粬娑堟伅鐨勪富閿�,瀹冨瓨鍦ㄥ彟澶栫殑涓�寮犳暟鎹簱琛ㄤ腑 + /// </summary> + private List<string> listOtherMsgId = new List<string>(); + /// <summary> + /// 鏃犳硶璇嗗埆鐨勫紑閿佽褰曠殑鐢ㄦ埛ID(鍥犱负閭d釜瀵嗙爜鏈夊彲鑳芥病鏈夊垎閰嶇粰鎴愬憳) + /// </summary> + private List<string> listOtherUserId = new List<string>(); #endregion @@ -50,8 +59,8 @@ /// </summary> /// <param name="i_DeviceMac">闂ㄩ攣鐨凪ac鍦板潃</param> public void ShowForm(string i_DeviceMac) - { - this.DeviceMac = i_DeviceMac; + { + this.DeviceDoor = Common.LocalDevice.Current.GetDevicesByMac(i_DeviceMac, false)[0]; //璁剧疆澶撮儴淇℃伅 base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uHistoryLog)); @@ -63,11 +72,11 @@ btnDelete.InitControl(); btnDelete.ButtonClickEvent += (sender, e) => { - var form = new TopRightMenuControl(1, 449); + var form = new TopRightMenuControl(1, 2); //娓呯┖璁板綍 form.AddRowMenu(Language.StringByID(R.MyInternationalizationString.uClearLog), "Item/DeleteIcon2.png", "Item/DeleteIcon2Selected.png", () => { - if (this.listView.ChildrenCount == 0) + if (this.listView.frameTable.ChildrenCount == 0) { //鏃犳暟鎹彲鍒� return; @@ -75,8 +84,11 @@ //纭娓呯┖褰撳墠璁板綍锛� this.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.uConfirmClearNowLog), () => { - //娓呯┖鎵�鏈夎褰� - this.ClearAllHistoryLog(); + HdlThreadLogic.Current.RunThread(() => + { + //娓呯┖鎵�鏈夎褰� + this.ClearAllHistoryLog(); + }); }); }); }; @@ -94,18 +106,10 @@ this.ClearBodyFrame(); //鍒濆鍖栧ご閮ㄦ绱㈡帶浠� - this.InitTitleSearchControl(); - - //涓荤嚎绋嬬殑寮傛浼氶樆濉炰富绾跨▼,瀵艰嚧鐣岄潰鏈夋鏃堕棿浼氱櫧灞�,鎵�浠ヨ繖鏍峰瓙璁╃晫闈㈠厛鍑烘潵 - //鐒跺悗鍐嶅埛鏂版暟鎹� - HdlThreadLogic.Current.RunThread(() => - { - Application.RunOnMainThread(() => - { - //鍒濆鍖栬褰曞垪琛� - this.InitLogListInfo(); - }); - }); + this.InitTitleSearchControl(); + + //鍒濆鍖栬褰曞垪琛� + this.InitLogListInfo(); } /// <summary> @@ -167,15 +171,25 @@ btnScreeningIcon.Gravity = Gravity.CenterVertical; btnScreeningIcon.UnSelectedImagePath = "Item/ScreeningType.png"; frameTitle.AddChidren(btnScreeningIcon, ChidrenBindMode.NotBind); + btnScreeningIcon.ButtonClickEvent += (sender, e) => + { + //鏄剧ず绫诲瀷绛涢�夌晫闈� + this.ShowDoorLockScreeningTypeForm(); + }; //搴曠嚎 frameTitle.AddBottomLine(); - this.listView = new VerticalListControl(29); + this.listView = new VerticalFrameRefreshControl(29); listView.Y = frameTitle.Bottom - Application.GetRealHeight(3); - listView.BackgroundColor = UserCenterColor.Current.White; listView.Height = bodyFrameLayout.Height - frameTitle.Bottom + Application.GetRealHeight(3); bodyFrameLayout.AddChidren(listView); + listView.frameTable.BackgroundColor = UserCenterColor.Current.White; + listView.BeginHeaderRefreshingAction += () => + { + //涓嬫媺鍒锋柊 + this.InitLogListInfo(); + }; } #endregion @@ -185,10 +199,10 @@ /// <summary> /// 鍒濆鍖栬褰曞垪琛� /// </summary> - private async void InitLogListInfo() + private void InitLogListInfo() { - this.listView.RemoveAll(); - listView.Height = bodyFrameLayout.Height - Application.GetRealHeight(115 - 3); + this.listView.frameTable.RemoveAll(); + listView.frameTable.Height = bodyFrameLayout.Height - Application.GetRealHeight(115 - 3); //濡傛灉From>To鐨勬椂鍊欙紝涓嶉笩瀹� if (Convert.ToInt32(dateFromControl.dateValue) > Convert.ToInt32(dateToControl.dateValue)) @@ -197,51 +211,52 @@ this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.uFromTimeIsOverToTime)); return; } - //鎵撳紑杩涘害鏉� - this.ShowProgressBar(); - //鎴愬憳鍒楄〃 - var result = await this.GetMemberListInfo(); - if (result == false) + HdlThreadLogic.Current.RunThread(async () => { + //鎵撳紑杩涘害鏉� + this.ShowProgressBar(); + //鎴愬憳鍒楄〃 + var result = await this.GetMemberListInfo(); + if (result == false) + { + //鍏抽棴杩涘害鏉� + this.CloseProgressBar(ShowReLoadMode.YES); + return; + } + //鍘嗗彶璁板綍 + var historyLog = await this.GetHistoryLogInfo(); + if (historyLog == null) + { + //鍏抽棴杩涘害鏉� + this.CloseProgressBar(ShowReLoadMode.YES); + return; + } //鍏抽棴杩涘害鏉� - this.CloseProgressBar(ShowReLoadMode.YES); - return; - } - //鍘嗗彶璁板綍 - var historyLog = await this.GetHistoryLogInf(); - if (historyLog == null) - { - //鍏抽棴杩涘害鏉� - this.CloseProgressBar(ShowReLoadMode.YES); - return; - } - //鍏抽棴杩涘害鏉� - this.CloseProgressBar(); + this.CloseProgressBar(); - 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); - } - for (int i = 0; i < historyLog.Count; i++) - { - //娣诲姞璁板綍琛� - this.AddLogInfoRow(historyLog[i], dic, i != historyLog.Count - 1); - } + 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); + } + HdlThreadLogic.Current.RunMain(() => + { + for (int i = 0; i < historyLog.Count; i++) + { + //娣诲姞璁板綍琛� + this.AddLogInfoRow(historyLog[i], dic, i != historyLog.Count - 1); + } + //闅愯棌涓嬫媺鍒锋柊鐗规晥 + listView.EndHeaderRefreshing(); - if (listView.ChildrenCount == 0) - { - return; - } - - //璋冩暣鍒楄〃鎺т欢鐨勯珮搴� - var realHeight = listView.ChildrenCount * listView.GetChildren(0).Height; - realHeight += Application.GetRealHeight(23 + 3); - if (realHeight < listView.Height) - { - //缂╁皬鎺т欢楂樺害 - listView.Height = realHeight; - } + if (listView.frameTable.ChildrenCount == 0) + { + return; + } + //璋冩暣鍒楄〃鎺т欢鐨勯珮搴� + listView.AdjustTableHeight(Application.GetRealHeight(23)); + }); + }); } /// <summary> @@ -304,25 +319,39 @@ { var frameTable = new FrameRowControl(listView.rowSpace / 2); frameTable.UseClickStatu = false; - this.listView.AddChidren(frameTable); + this.listView.AddChidrenFrame2(frameTable); //鍥炬爣 var btnIcon = frameTable.AddLeftIcon(); - if (historyInfo.UnlockIsSuccess == true) + if (historyInfo.OpenLockMode == -1) + { + //鍏朵粬娑堟伅 + var device = Common.LocalDevice.Current.GetDevice(historyInfo.DeviceMac, historyInfo.DeviceEpoint); + if (device == null) + { + btnIcon.UnSelectedImagePath = "Device/IntelligentLocks.png"; + } + else + { + Common.LocalDevice.Current.SetDeviceIconToControl(btnIcon, device); + } + } + else if (historyInfo.UnlockIsSuccess == true) { btnIcon.UnSelectedImagePath = "Item/UnLockSuccess.png"; } else { - btnIcon.UnSelectedImagePath = "Item/UnLockSuccess.png"; + btnIcon.UnSelectedImagePath = "Item/UnLockFail.png"; } //淇℃伅 - var btnMsg = frameTable.AddLeftCaption("", 600, 60); - btnMsg.TextSize = 15; - //杩欎釜鍧愭爣鏈夌偣鐗规畩 - btnMsg.Y = Application.GetRealHeight(12) + frameTable.chidrenYaxis; - frameTable.AddChidren(btnMsg, ChidrenBindMode.NotBind); - if (historyInfo.UnlockIsSuccess == true) + var btnMsg = frameTable.AddTopView("", 600); + if (historyInfo.OpenLockMode == -1) + { + //鍏朵粬娑堟伅 + btnMsg.Text = historyInfo.AlarmMsg; + } + else if (historyInfo.UnlockIsSuccess == true) { if (historyInfo.OpenLockMode == 0) { @@ -361,15 +390,20 @@ //浜虹墿 string perName = dicName.ContainsKey(historyInfo.CloudAccountId) == true ? dicName[historyInfo.CloudAccountId] : Language.StringByID(R.MyInternationalizationString.uOther); - var btnpersion = frameTable.AddLeftCaption(perName, 600, 50, true); - //杩欎釜鍧愭爣鏈夌偣鐗规畩 - btnpersion.Y = Application.GetRealHeight(72) + frameTable.chidrenYaxis; - btnpersion.TextSize = 12; - btnpersion.TextColor = UserCenterColor.Current.TextGrayColor1; - frameTable.AddChidren(btnpersion, ChidrenBindMode.NotBind); + frameTable.AddBottomView(perName, 600); //鏃堕棿 - frameTable.AddMostRightView(historyInfo.UnlockTime, 400); + if (this.dateFromControl.dateValue == this.dateToControl.dateValue) + { + //濡傛灉鏃ユ湡鑼冨洿涓�鏍�,鍒欎笉鏄剧ず骞存湀鏃� + frameTable.AddMostRightView(UserCenterLogic.ConvertUtcTimeToLocalTime(historyInfo.UnlockTime).ToString("HH:mm:ss"), 400); + } + else + { + //濡傛灉鏃ユ湡鑼冨洿涓嶄竴鏍�,鍒欐樉绀哄勾鏈堟棩 + frameTable.AddMostRightView(UserCenterLogic.ConvertUtcTimeToLocalTime(historyInfo.UnlockTime).ToString("yyyy/MM/dd HH:mm:ss"), 700); + } + if (addLine == true) { //搴曠嚎 @@ -413,60 +447,158 @@ /// 鑾峰彇鍘嗗彶璁板綍 /// </summary> /// <returns></returns> - private async Task<List<HistoryInfo>> GetHistoryLogInf() + private async Task<List<HistoryInfo>> GetHistoryLogInfo() { //鑾峰彇璁块棶浜戠鎺ュ彛鐨勫惎鍔ㄥ弬鏁� var pra = this.GetDbInterfacePra(); - int nowPage = 0; + //娓呯┖涓婁竴娆$殑鍏朵粬ID + this.listOtherMsgId = new List<string>(); + this.listOtherUserId = new List<string>(); + + //鍏ㄩ儴鎴愬憳淇℃伅 + 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); + } + + //鑾峰彇闂ㄩ攣鐨勬墦寮�鍜屽叧闂褰� + var listAllLog = await this.GetDoorOpenHistoryLog(pra, dicMemberName); + //鑾峰彇闂ㄩ攣鐨勫叾浠栬褰� + var listOtherLog = await this.GetDoorOtherHistoryLog(pra.UnlockTimeBegin, pra.UnlockTimeEnd); + listAllLog.AddRange(listOtherLog); + + //鎺掑簭涓�涓� + var dicAllData = new Dictionary<string, List<HistoryInfo>>(); + var listSortTime = new List<string>(); + //鏄惁鍖呭惈鍏朵粬 + bool getOtherFlage = this.listSearchUserId.Contains(""); + foreach (var data in listAllLog) + { + //濡傛灉鍗曠嫭鎸囧畾鏈夎璐﹀彿,鍙互鏄剧ず + if (this.listSearchUserId.Contains(data.CloudAccountId) == false) + { + //濡傛灉杩欎釜璐﹀彿娌℃湁鎸囧畾,骞朵笖鎸囧畾鏄剧ず鍏朵粬鐨勮瘽,骞朵笖鏃犳硶璇嗗埆杩欎釜鐢ㄦ埛ID鎵嶆樉绀� + if (getOtherFlage == true && dicMemberName.ContainsKey(data.CloudAccountId) == true) + { + continue; + } + } + //鎸夋椂闂村垎缁� + if (dicAllData.ContainsKey(data.UnlockTime) == false) + { + dicAllData[data.UnlockTime] = new List<HistoryInfo>(); + listSortTime.Add(data.UnlockTime); + } + dicAllData[data.UnlockTime].Add(data); + } + + //鎵ц鎺掑簭,鏃堕棿澶х殑鍦ㄥ墠闈� + listSortTime.Sort(); + var listSortLog = new List<HistoryInfo>(); + for (int i = listSortTime.Count - 1; i >= 0; i--) + { + listSortLog.AddRange(dicAllData[listSortTime[i]]); + } + + return listSortLog; + } + + /// <summary> + /// 鑾峰彇闂ㄩ攣鐨勬墦寮�鍜屽叧闂褰� + /// </summary> + /// <param name="i_pra"></param> + /// <returns></returns> + private async Task<List<HistoryInfo>> GetDoorOpenHistoryLog(GetHistoryDataPra i_pra, Dictionary<string, string> dicMemberName) + { var listLog = new List<HistoryInfo>(); + + int nowPage = 0; while (true) { //璁块棶浜戠 - var result = await UserCenterLogic.GetResponseDataByRequestHttps("DoorLock/GetDoorLockHistoryPager", true, pra); + var result = await UserCenterLogic.GetResponseDataByRequestHttps("DoorLock/GetDoorLockHistoryPager", true, i_pra); if (result == null) { return null; } var dataInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<GetHistoryDataResult>(result); + foreach (var data in dataInfo.PageData) + { + if (dicMemberName.ContainsKey(data.CloudAccountId) == false + && this.listOtherUserId.Contains(data.CloudAccountId) == false) + { + //鏀堕泦鏃犳硶璇嗗埆鐨勭敤鎴稩D + this.listOtherUserId.Add(data.CloudAccountId); + } + listLog.Add(data); + } + if (dataInfo.HasNextPage == false) { break; } //鑾峰彇涓嬩竴椤� nowPage++; - pra.PageSetting.Page = nowPage; + i_pra.PageSetting.Page = nowPage; } - //鎺掑簭涓�涓� - var dic = new Dictionary<string, List<HistoryInfo>>(); - var listSort = new List<string>(); + return listLog; + } + + /// <summary> + /// 鑾峰彇闂ㄩ攣鐨勫叾浠栬褰� + /// </summary> + /// <returns></returns> + private async Task<List<HistoryInfo>> GetDoorOtherHistoryLog(string beginTime, string endTime) + { + var listLog = new List<HistoryInfo>(); + //鏄惁鍖呭惈鍏朵粬 - bool flage = this.listSearchUserId.Contains("") || this.listSearchUserId.Contains("-1"); - foreach (var data in listLog) + bool getOtherFlage = this.listSearchUserId.Contains("") || this.listSearchUserId.Contains("-1"); + if (getOtherFlage == true) { - if (flage == false && string.IsNullOrEmpty(data.CloudAccountId) == true) + //鍘昏幏鍙栧叾浠栦俊鎭� + var pra2 = new MessageInfoPra(); + pra2.BeginTime = beginTime; + pra2.EndTime = endTime; + pra2.Topic = "/Alarms/SendAlarmInform"; + pra2.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); + var result = await UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", true, pra2); + if (result == null) { - //娌℃湁鎸囧畾鏄剧ず鍏朵粬 - continue; + return null; } - if (dic.ContainsKey(data.UnlockTime) == false) + var dataInfo2 = Newtonsoft.Json.JsonConvert.DeserializeObject<MessageCentetInfo>(result); + string doorKey = this.DeviceDoor.DeviceAddr + "_" + this.DeviceDoor.DeviceEpoint; + foreach (var myInfo in dataInfo2.PageData) { - dic[data.UnlockTime] = new List<HistoryInfo>(); - listSort.Add(data.UnlockTime); + //璁惧瀵硅薄 + 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; + + listLog.Add(data); + this.listOtherMsgId.Add(myInfo.Id); } - dic[data.UnlockTime].Add(data); } - //鎵ц鎺掑簭,鏃堕棿澶х殑鍦ㄥ墠闈� - listSort.Sort(); - var listSortLog = new List<HistoryInfo>(); - for (int i = listSort.Count - 1; i >= 0; i--) - { - listSortLog.AddRange(dic[listSort[i]]); - } - - return listSortLog; + return listLog; } #endregion @@ -480,17 +612,62 @@ { //鑾峰彇璁块棶浜戠鎺ュ彛鐨勫惎鍔ㄥ弬鏁� var pra = this.GetDbInterfacePra(); + if (listSearchUserId.Contains("") == true) + { + //濡傛灉鎸囧畾鏈夊叾浠�,鍒欑敤鎴稩D閲嶆柊璁剧疆 + pra.CloudAccountIdArr = new List<string>(); + pra.CloudAccountIdArr.AddRange(listSearchUserId); + pra.CloudAccountIdArr.Remove(""); + if (this.listOtherUserId.Count > 0) + { + pra.CloudAccountIdArr.AddRange(listOtherUserId); + } + else + { + //杩欎竴姝ュ緢閲嶈,涓嶇劧鏈夊彲鑳藉崟鐙�夋嫨鍏朵粬鐨勬椂鍊� + //鍦ㄦ病鏈夋暟鎹殑鎯呭喌涓�,浼氭竻绌烘帀鍏ㄩ儴鐨勬暟鎹� + pra.CloudAccountIdArr.Add("other"); + } + } + //鎵撳紑杩涘害鏉� this.ShowProgressBar(); + var result = await 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 = await UserCenterLogic.GetResultStatuByRequestHttps("MessageCenter/DelMessageCenterItem", true, pra2); + if (result == false) + { + return; + } + } + } //鍏抽棴杩涘害鏉� this.CloseProgressBar(); if (result == false) { return; } - this.listView.RemoveAll(); - listView.Height = bodyFrameLayout.Height - Application.GetRealHeight(115 - 3); + + //娓呯┖ + this.listOtherMsgId = new List<string>(); + HdlThreadLogic.Current.RunMain(() => + { + this.listView.frameTable.RemoveAll(); + listView.frameTable.Height = bodyFrameLayout.Height - Application.GetRealHeight(115 - 3); + }); } #endregion @@ -506,10 +683,16 @@ 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); - //鍏ㄩ�夊垯涓簄ull List<string> listUser = null; - if (listSearchUserId.Contains("-1") == false) + //涓�鏃︽寚瀹氫簡鍏朵粬,鍒欓渶瑕佸叏閮ㄨ鍙�,鍥犱负鏈変簺寮�閿侊紝瀹冪敤鐨勫瘑鐮佸苟娌℃湁鍒嗛厤缁欐垚鍛� + if (listSearchUserId.Contains("-1") == true || listSearchUserId.Contains("") == true) { + //鍏ㄩ�夊嵆涓篘ull + } + else + { + //鎸囧畾鐢ㄦ埛 + listUser = new List<string>(); listUser.AddRange(listSearchUserId); //绉婚櫎鍏朵粬,鍥犱负浜戠鍥哄畾浼氱粰 listUser.Remove(""); @@ -519,16 +702,18 @@ List<int> listLock = null; if (listSearchLockId.Contains(-1) == false) { + listLock = new List<int>(); listLock.AddRange(listSearchLockId); } var pra = new GetHistoryDataPra(); + pra.UnlockTimeBegin = dateFrom.ToUniversalTime().ToString(); + pra.UnlockTimeEnd = dateTo.ToUniversalTime().ToString(); pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); - pra.DoorLockId = this.DeviceMac; + pra.DoorLockId = this.DeviceDoor.DeviceAddr + "_" + this.DeviceDoor.DeviceEpoint; pra.CloudAccountIdArr = listUser; pra.OpenLockModeArr = listLock; - pra.UnlockTimeBegin = dateFrom; - pra.UnlockTimeEnd = dateTo; + return pra; } @@ -572,11 +757,11 @@ /// <summary> /// 鎼滅储寮�閿佸紑濮嬫椂闂� /// </summary> - public DateTime UnlockTimeBegin; + public string UnlockTimeBegin; /// <summary> /// 鎼滅储寮�閿佺粨鏉熸椂闂� /// </summary> - public DateTime UnlockTimeEnd; + public string UnlockTimeEnd; /// <summary> /// 椤垫暟 /// </summary> @@ -619,6 +804,18 @@ /// 璐﹀彿鐨処D /// </summary> public string CloudAccountId = 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; } #endregion -- Gitblit v1.8.0