From 18a7f9f40e5fab3bee5d4ac3d8fd0273dea052d6 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期日, 26 四月 2020 12:05:28 +0800
Subject: [PATCH] 先上传一个非最新的版本

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs |  551 +++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 370 insertions(+), 181 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs
index aeb1f8a..39a09ef 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs
@@ -335,9 +335,33 @@
             this.listView.AddChidrenFrame2(frameTable);
             //鍥炬爣
             var btnIcon = frameTable.AddLeftIcon();
+            //淇℃伅
+            var btnMsg = frameTable.AddTopView("", 600);
+            //浜虹墿
+            string perName = dicName.ContainsKey(historyInfo.CloudAccountId) == true ? dicName[historyInfo.CloudAccountId] : 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);
+            }
+            else
+            {
+                //濡傛灉鏃ユ湡鑼冨洿涓嶄竴鏍�,鍒欐樉绀哄勾鏈堟棩
+                frameTable.AddMostRightView(UserCenterLogic.ConvertUtcTimeToLocalTime(historyInfo.UnlockTime).ToString("yyyy/MM/dd HH:mm:ss"), 700);
+            }
+            //搴曠嚎
+            if (addLine == true)
+            {
+                
+                frameTable.AddBottomLine();
+            }
+
+            //鍏朵粬娑堟伅
             if (historyInfo.OpenLockMode == -1)
             {
-                //鍏朵粬娑堟伅
+                //鍥剧墖
                 var device = Common.LocalDevice.Current.GetDevice(historyInfo.DeviceMac, historyInfo.DeviceEpoint);
                 if (device == null)
                 {
@@ -347,29 +371,42 @@
                 {
                     Common.LocalDevice.Current.SetDeviceIconToControl(btnIcon, device);
                 }
-            }
-            else if (historyInfo.OpenLockMode == 9000)
-            {
-                btnIcon.UnSelectedImagePath = "Item/NormallyOpen.png";
-            }
-            else if (historyInfo.UnlockIsSuccess == true)
-            {
-                btnIcon.UnSelectedImagePath = "Item/UnLockSuccess.png";
-            }
-            else
-            {
-                btnIcon.UnSelectedImagePath = "Item/UnLockFail.png";
-            }
-
-            //淇℃伅
-            var btnMsg = frameTable.AddTopView("", 600);
-            if (historyInfo.OpenLockMode == -1 || historyInfo.OpenLockMode == 9000)
-            {
-                //鍏朵粬娑堟伅
+                //娑堟伅
                 btnMsg.Text = historyInfo.AlarmMsg;
             }
+            //闂ㄩ攣甯稿紑妯″紡
+            else if (historyInfo.OpenLockMode == 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
+                {
+                    //涓婇潰鏄疉pp鎵嬪姩鎺ㄩ��,杩欓噷鏄綉鍏虫垨鑰呴棬閿佽嚜宸辨帹閫�
+                    btnMsg.Text = historyInfo.AlarmMsg;
+                }
+            }
+            //寮�閿佹垚鍔�
             else if (historyInfo.UnlockIsSuccess == true)
             {
+                //鍥剧墖
+                btnIcon.UnSelectedImagePath = "Item/UnLockSuccess.png";
+                //娑堟伅
                 if (historyInfo.OpenLockMode == 0)
                 {
                     //瀵嗙爜寮�閿佹垚鍔�
@@ -386,8 +423,12 @@
                     btnMsg.TextID = R.MyInternationalizationString.uUnlockByFingerPrintSuccess;
                 }
             }
+            //寮�閿佸け璐�
             else
             {
+                //鍥剧墖
+                btnIcon.UnSelectedImagePath = "Item/UnLockFail.png";
+                //娑堟伅
                 if (historyInfo.OpenLockMode == 0)
                 {
                     //瀵嗙爜寮�閿佸け璐�
@@ -403,28 +444,6 @@
                     //鎸囩汗寮�閿佸け璐�
                     btnMsg.TextID = R.MyInternationalizationString.uUnlockByFingerPrintFail;
                 }
-            }
-
-            //浜虹墿
-            string perName = dicName.ContainsKey(historyInfo.CloudAccountId) == true ? dicName[historyInfo.CloudAccountId] : 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);
-            }
-            else
-            {
-                //濡傛灉鏃ユ湡鑼冨洿涓嶄竴鏍�,鍒欐樉绀哄勾鏈堟棩
-                frameTable.AddMostRightView(UserCenterLogic.ConvertUtcTimeToLocalTime(historyInfo.UnlockTime).ToString("yyyy/MM/dd HH:mm:ss"), 700);
-            }
-
-            if (addLine == true)
-            {
-                //搴曠嚎
-                frameTable.AddBottomLine();
             }
         }
 
@@ -454,143 +473,6 @@
                 //鍒濆鍖栬褰曞垪琛�
                 this.InitLogListInfo(false);
             };
-        }
-
-        #endregion
-
-        #region 鈻� 鑾峰彇璁板綍___________________________
-
-        /// <summary>
-        /// 鑾峰彇鍘嗗彶璁板綍
-        /// </summary>
-        /// <returns></returns>
-        private async Task<List<HistoryInfo>> GetHistoryLogInfo(Dictionary<string, string> dicMemberName)
-        {
-            if (this.listHistoryInfo != null)
-            {
-                //涓嶄簩娆¤幏鍙�,涓昏閽堝鐨勬槸绛涢�夊姛鑳�
-                return this.ScreeningHistoryData(dicMemberName);
-            }
-            //鑾峰彇璁块棶浜戠鎺ュ彛鐨勫惎鍔ㄥ弬鏁�
-            var pra = this.GetReadHistoryPra();
-
-            //鑾峰彇闂ㄩ攣鐨勬墦寮�鍜屽叧闂褰�
-            var listAllLog = await this.GetDoorOpenHistoryLog(pra);
-            //鑾峰彇闂ㄩ攣鐨勫叾浠栬褰�
-            var listOtherLog = await this.GetDoorOtherHistoryLog(pra.UnlockTimeBegin, pra.UnlockTimeEnd);
-            listAllLog.AddRange(listOtherLog);
-
-            //鎺掑簭涓�涓�
-            var dicAllData = new Dictionary<string, List<HistoryInfo>>();
-            var listSortTime = new List<string>();
-
-            foreach (var data in listAllLog)
-            {
-                //鎸夋椂闂村垎缁�
-                if (dicAllData.ContainsKey(data.UnlockTime) == false)
-                {
-                    dicAllData[data.UnlockTime] = new List<HistoryInfo>();
-                    listSortTime.Add(data.UnlockTime);
-                }
-                dicAllData[data.UnlockTime].Add(data);
-            }
-
-            //鎵ц鎺掑簭,鏃堕棿澶х殑鍦ㄥ墠闈�
-            listSortTime.Sort();
-            this.listHistoryInfo = new List<HistoryInfo>();
-            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 async Task<List<HistoryInfo>> GetDoorOpenHistoryLog(GetHistoryDataPra i_pra)
-        {
-            var listLog = new List<HistoryInfo>();
-
-            int nowPage = 0;
-            while (true)
-            {
-                //璁块棶浜戠
-                var result = await UserCenterLogic.GetResponseDataByRequestHttps("DoorLock/GetDoorLockHistoryPager", true, i_pra);
-                if (result == null)
-                {
-                    return null;
-                }
-                var dataInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<GetHistoryDataResult>(result);
-                listLog.AddRange(dataInfo.PageData);
-
-                if (dataInfo.HasNextPage == false)
-                {
-                    break;
-                }
-                //鑾峰彇涓嬩竴椤�
-                nowPage++;
-                i_pra.PageSetting.Page = nowPage;
-            }
-
-            return listLog;
-        }
-
-        /// <summary>
-        /// 鑾峰彇闂ㄩ攣鐨勫叾浠栬褰�
-        /// </summary>
-        /// <returns></returns>
-        private async Task<List<HistoryInfo>> GetDoorOtherHistoryLog(string beginTime, string endTime)
-        {
-            var listLog = new List<HistoryInfo>();
-
-            //鍘昏幏鍙栧叾浠栦俊鎭�
-            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)
-            {
-                return null;
-            }
-            var dataInfo2 = Newtonsoft.Json.JsonConvert.DeserializeObject<MessageCentetInfo>(result);
-            string doorKey = this.DeviceDoor.DeviceAddr + "_" + this.DeviceDoor.DeviceEpoint;
-            foreach (var myInfo in dataInfo2.PageData)
-            {
-                //璁惧瀵硅薄
-                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 listLog;
         }
 
         #endregion
@@ -699,6 +581,286 @@
 
         #endregion
 
+        #region 鈻� 鑾峰彇闂ㄩ攣鎵撳紑璁板綍___________________
+
+        /// <summary>
+        /// 鑾峰彇鍘嗗彶璁板綍
+        /// </summary>
+        /// <returns></returns>
+        private async Task<List<HistoryInfo>> GetHistoryLogInfo(Dictionary<string, string> dicMemberName)
+        {
+            if (this.listHistoryInfo != null)
+            {
+                //涓嶄簩娆¤幏鍙�,涓昏閽堝鐨勬槸绛涢�夊姛鑳�
+                return this.ScreeningHistoryData(dicMemberName);
+            }
+            //鑾峰彇璁块棶浜戠鎺ュ彛鐨勫惎鍔ㄥ弬鏁�
+            var pra = this.GetReadHistoryPra();
+
+            //鑾峰彇闂ㄩ攣鐨勬墦寮�鍜屽叧闂褰�
+            var listAllLog = await this.GetDoorOpenHistoryLog(pra);
+            //鑾峰彇闂ㄩ攣鐨勫叾浠栬褰�
+            var listOtherLog = await this.GetDoorOtherHistoryLog(pra.UnlockTimeBegin, pra.UnlockTimeEnd);
+            listAllLog.AddRange(listOtherLog);
+
+            //鎺掑簭涓�涓�
+            var dicAllData = new Dictionary<string, List<HistoryInfo>>();
+            var listSortTime = new List<string>();
+
+            foreach (var data in listAllLog)
+            {
+                //鎸夋椂闂村垎缁�
+                if (dicAllData.ContainsKey(data.UnlockTime) == false)
+                {
+                    dicAllData[data.UnlockTime] = new List<HistoryInfo>();
+                    listSortTime.Add(data.UnlockTime);
+                }
+                dicAllData[data.UnlockTime].Add(data);
+            }
+
+            //鎵ц鎺掑簭,鏃堕棿澶х殑鍦ㄥ墠闈�
+            listSortTime.Sort();
+            this.listHistoryInfo = new List<HistoryInfo>();
+            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 async Task<List<HistoryInfo>> GetDoorOpenHistoryLog(GetHistoryDataPra i_pra)
+        {
+            var listLog = new List<HistoryInfo>();
+
+            int nowPage = 0;
+            while (true)
+            {
+                //璁块棶浜戠
+                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)
+                {
+                    //涓嶇煡閬撲负浠�涔堜細鏈変笂鎶ヤ簡铏氭嫙9000鐨勯偅涓壒娈婄殑涓滆タ
+                    if (data.OpenLockMode == 9000 && data.OtherOpenLockMode <= 9000)
+                    {
+                        continue;
+                    }
+                    listLog.Add(data);
+                }
+
+                if (dataInfo.HasNextPage == false)
+                {
+                    break;
+                }
+                //鑾峰彇涓嬩竴椤�
+                nowPage++;
+                i_pra.PageSetting.Page = nowPage;
+            }
+
+            return listLog;
+        }
+
+        #endregion
+
+        #region 鈻� 鑾峰彇闂ㄩ攣鍏朵粬璁板綍___________________
+
+        /// <summary>
+        /// 鑾峰彇闂ㄩ攣鐨勫叾浠栬褰�
+        /// </summary>
+        /// <returns></returns>
+        private async Task<List<HistoryInfo>> GetDoorOtherHistoryLog(string beginTime, string endTime)
+        {
+            var listLog = new List<HistoryInfo>();
+
+            //鑾峰彇闂ㄩ攣鍏朵粬绫讳俊鎭笂鎶�
+            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)
+            {
+                return null;
+            }
+            this.AdjustDoorOtherAlarmData(ref listLog, result);
+
+            //浠庤嚜鍔ㄥ寲涓�,鑾峰彇甯稿紑妯″紡璁板綍
+            pra2.Topic = "/Logic/Execute_Respon";
+            result = await UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", true, pra2);
+            if (result == null)
+            {
+                return null;
+            }
+            this.AdjustDoorNormallyOpenData(ref listLog, result);
+
+            //鑾峰彇闂ㄩ攣涓存椂瀵嗙爜寮�閿佽褰�
+            pra2.Topic = "/DoorLock/DoorLockOperatingEventNotificationCommand";
+            result = await UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", true, pra2);
+            if (result == null)
+            {
+                return null;
+            }
+            this.AdjustDoorTemporaryPasswordData(ref listLog, result);
+
+            return listLog;
+        }
+
+        /// <summary>
+        /// 澶勭悊闂ㄩ攣甯稿紑妯″紡璁板綍淇℃伅
+        /// </summary>
+        /// <param name="listLog"></param>
+        /// <param name="result"></param>
+        private void AdjustDoorOtherAlarmData(ref List<HistoryInfo> listLog, string result)
+        {
+            var dataInfo2 = Newtonsoft.Json.JsonConvert.DeserializeObject<MessageCentetInfo>(result);
+            string doorKey = this.DeviceDoor.DeviceAddr + "_200";
+            foreach (var myInfo in dataInfo2.PageData)
+            {
+                //璁惧瀵硅薄
+                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);
+            }
+        }
+
+        /// <summary>
+        /// 澶勭悊闂ㄩ攣甯稿紑妯″紡淇℃伅涓婃姤
+        /// </summary>
+        /// <param name="listLog"></param>
+        /// <param name="result"></param>
+        private void AdjustDoorNormallyOpenData(ref List<HistoryInfo> listLog, string result)
+        {
+            var dataInfo2 = Newtonsoft.Json.JsonConvert.DeserializeObject<MessageCentetInfo>(result);
+            string doorKey = this.DeviceDoor.DeviceAddr + "_200";
+            foreach (var myInfo in dataInfo2.PageData)
+            {
+                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);
+            }
+        }
+
+        /// <summary>
+        /// 澶勭悊闂ㄩ攣涓存椂瀵嗙爜涓婃姤
+        /// </summary>
+        /// <param name="listLog"></param>
+        /// <param name="result"></param>
+        private void AdjustDoorTemporaryPasswordData(ref List<HistoryInfo> listLog, string result)
+        {
+            var dataInfo2 = Newtonsoft.Json.JsonConvert.DeserializeObject<MessageCentetInfo>(result);
+            string doorKey = this.DeviceDoor.DeviceAddr + "_200";
+            foreach (var myInfo in dataInfo2.PageData)
+            {
+                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);
+            }
+        }
+
+        #endregion
+
         #region 鈻� 娓呯┖璁板綍___________________________
 
         /// <summary>
@@ -769,7 +931,7 @@
             pra.UnlockTimeBegin = dateFrom.ToUniversalTime().ToString();
             pra.UnlockTimeEnd = dateTo.ToUniversalTime().ToString();
             pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
-            pra.DoorLockId = this.DeviceDoor.DeviceAddr + "_" + this.DeviceDoor.DeviceEpoint;
+            pra.DoorLockId = this.DeviceDoor.DeviceAddr + "_200";
 
             return pra;
         }
@@ -808,7 +970,7 @@
             pra.UnlockTimeBegin = dateFrom.ToUniversalTime().ToString();
             pra.UnlockTimeEnd = dateTo.ToUniversalTime().ToString();
             pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
-            pra.DoorLockId = this.DeviceDoor.DeviceAddr + "_" + this.DeviceDoor.DeviceEpoint;
+            pra.DoorLockId = this.DeviceDoor.DeviceAddr + "_200";
             pra.CloudAccountIds = listUser;
             pra.OpenLockModes = listLock;
 
@@ -942,6 +1104,14 @@
             /// </summary>
             public string CloudAccountId = string.Empty;
             /// <summary>
+            /// 鍏朵粬寮�閿佹柟寮�(OpenLockMode=9000鏃舵湁鏁�) 9001:甯稿紑鎵撳紑 9002:甯稿紑鍙栨秷 9003:甯稿紑鎸佺画 
+            /// </summary>
+            public int? OtherOpenLockMode = -1;
+            /// <summary>
+            /// 甯稿紑鎸佺画鏃堕棿(1~72灏忔椂 OtherOpenLockMode=9003鐨勬椂鍊欐湁鏁�)
+            /// </summary>
+            public string NormallyOpenContinuedTime = string.Empty;
+            /// <summary>
             /// 褰撳紑閿佹柟寮忎负-1鏃朵娇鐢�,瀹冨睘浜庡叾浠栫被
             /// </summary>
             public string AlarmMsg = string.Empty;
@@ -959,6 +1129,25 @@
             public string MsgKeyId = string.Empty;
         }
 
+        /// <summary>
+        /// 涓存椂瀵嗙爜鏁版嵁
+        /// </summary>
+        private class PasswordOperationData
+        {
+            /// <summary>
+            /// 0:瀵嗙爜 15:鎸囩汗 3:IC鍗�
+            /// </summary>
+            public int OperationEventSoure = -1;
+            /// <summary>
+            /// 2:寮�閿佹垚鍔�
+            /// </summary>
+            public int OperationEventCode = -1;
+            /// <summary>
+            /// 246浠h〃涓存椂瀵嗙爜
+            /// </summary>
+            public int UserID = -1;
+        }
+
         #endregion
     }
 }

--
Gitblit v1.8.0