From 4e78c9c795dff269ebea37f4e7572d8c8b7d4a69 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期三, 20 五月 2020 15:14:17 +0800
Subject: [PATCH] 请合并门锁最新代码【1、优化门锁常开模式推送和增加机械门锁开锁功能;2、优化面板调光目标】

---
 ZigbeeApp20200519/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs |  134 +++++++++++++++++++++++---------------------
 1 files changed, 70 insertions(+), 64 deletions(-)

diff --git a/ZigbeeApp20200519/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs b/ZigbeeApp20200519/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs
old mode 100755
new mode 100644
index f64c0b6..de85ddf
--- a/ZigbeeApp20200519/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs
+++ b/ZigbeeApp20200519/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs
@@ -599,50 +599,48 @@
         /// </summary>
         /// <param name="receiveData"></param>
         private void DoorLockDeviceReportPush(JObject receiveData)
-        {
-            //鍙湁寰愭鐨勯棬閿佺晫闈㈡病鏈夋墦寮�鐨勬儏鍐典笅,鎵嶄細澶勭悊杩欎釜涓滆タ
-            if (ControlCommonResourse.IsDoorLockPageOpen == false && UserCenterResourse.UserInfo.AuthorityNo == 1)
-            {
-                var device = Common.LocalDevice.Current.GetDevice(receiveData.Value<string>("DeviceAddr"), receiveData.Value<int>("Epoint"));
-                if (device.Type != DeviceType.DoorLock)
-                {
-                    //瀹冧笉鏄棬閿�
-                    return;
-                }
-                var info = Newtonsoft.Json.JsonConvert.DeserializeObject<DoorLockAlarmsResult>(receiveData["Data"].ToString());
-                if (info.Clusterid == 257)
-                {
-                    //甯稿紑妯″紡鍏抽棴
-                    if (info.AlarmCode == 217 || info.AlarmCode == 219)
-                    {
-                        HdlThreadLogic.Current.RunThread(async () =>
-                        {
-                            //娓╁眳鍩庣殑瑕佺綉鍏充腑鏄惁鏈夐�昏緫瀛樺湪 
-                            //鍙傛暟:2-甯稿紑鑷姩鍖�;3-澶辨晥鏃堕棿鑷姩鍖�
-                            var result = await Shared.Phone.Device.Logic.SkipView.Exist(3, (ZigBee.Device.DoorLock)device);
-                            HdlThreadLogic.Current.RunMain(() =>
-                            {
-                                //寮瑰嚭寰愭鐨勯偅涓獥鍙�
-                                DoorLock.DoorLockCommonInfo.NomallyOpenModeInvalidDialog((ZigBee.Device.DoorLock)device, DoorLock.DoorLockCommonInfo.DoorLockMessType.ServicePush,
-                                    result != 0 ? true : false, null);
-                            });
-                        });
-                    }
-                }
-            }
-            //鏄剧ず鏈夋柊娑堟伅鐨勭壒鏁�
-            this.ShowHadNewMessageAppeal();
-        }
-
+        {
+            if (UserCenterResourse.UserInfo.AuthorityNo == 1)
+            {
+                var device = Common.LocalDevice.Current.GetDevice(receiveData.Value<string>("DeviceAddr"), receiveData.Value<int>("Epoint"));
+                if (device.Type != DeviceType.DoorLock)
+                {
+                    //瀹冧笉鏄棬閿�
+                    return;
+                }
+
+                var info = Newtonsoft.Json.JsonConvert.DeserializeObject<DoorLockAlarmsResult>(receiveData["Data"].ToString());
+                if (info.Clusterid == 257)
+                {
+                    //216锛氶攣涓婅缃殑甯稿紑 
+                    if (info.AlarmCode == 216)
+                    {
+                        HdlThreadLogic.Current.RunThread(async () =>
+                        {
+                            HdlThreadLogic.Current.RunMain(() =>
+                           {
+                               //鏇存柊闂ㄩ攣娑夊強鐨勫父寮�/甯稿叧鐨勭晫闈�
+                               if (UserCenter.DoorLock.DoorLockCommonInfo.UpdateCurrentDoorlockAction != null)
+                               {
+                                   UserCenter.DoorLock.DoorLockCommonInfo.UpdateCurrentDoorlockAction(device.DeviceAddr + device.DeviceEpoint, true);
+                               }
+                           });
+                        });
+                    }
+                }
+                //鏄剧ず鏈夋柊娑堟伅鐨勭壒鏁�
+                this.ShowHadNewMessageAppeal();
+            }
+        }
         #endregion
-
+
         #region 鈻� 璁惧鍦ㄧ嚎鐘舵�佹洿鏂板弽棣坃______________
-
+
         /// <summary>
         /// 璁惧鍦ㄧ嚎鐘舵�佹洿鏂板弽棣�
         /// </summary>
         /// <param name="receiveData"></param>
-        private void DeviceOnlineChangePush (JObject receiveData)
+        private void DeviceOnlineChangePush(JObject receiveData)
         {
             if (this.dicDeviceEvent.Count == 0)
             {
@@ -825,35 +823,43 @@
         private void LogicExecutePush(JObject receiveData)
         {
             //鏄剧ず鏈夋柊娑堟伅鐨勭壒鏁�
-            this.ShowHadNewMessageAppeal();
+            this.ShowHadNewMessageAppeal();
+
+            // 閫昏緫鎵ц甯稿紑妯″紡澶辨晥鐨勬儏鍐�
+            if (UserCenterResourse.UserInfo.AuthorityNo == 1)
+            {
+                //鑷姩鍖栨墽琛� 甯稿紑鍏抽棴
+                var data = Newtonsoft.Json.JsonConvert.DeserializeObject<LogicPushResult>(receiveData["Data"].ToString());
+                if (data != null && data.ActionData != null)
+                {
+                    var deviceAddr = data.ActionData.MacStr;
+                    var epoint = 1; //data.ActionData.Epoint;  闂ㄩ攣鍙戦�佹椂鏄�200锛屼絾鏄笂浼犳椂瑕佹妸鐪熷疄鐨勭鐐圭粰缃戝叧涓婃姤
+                    var device = Common.LocalDevice.Current.GetDevice(deviceAddr, epoint);
+                    if (device.Type != DeviceType.DoorLock)
+                    {
+                        return;
+                    }
 
-            //杩欎釜涓滆タ鏆傛椂涓嶅鐞�
-            ////鍙湁寰愭鐨勯棬閿佺晫闈㈡病鏈夋墦寮�鐨勬儏鍐典笅,鎵嶄細澶勭悊杩欎釜涓滆タ
-            //if (ControlCommonResourse.IsDoorLockPageOpen == false && UserCenterResourse.UserInfo.AuthorityNo == 1)
-            //{
-            //    var device = Common.LocalDevice.Current.GetDevice(receiveData.Value<string>("DeviceAddr"), receiveData.Value<int>("Epoint"));
-            //    if (device.Type != DeviceType.DoorLock)
-            //    {
-            //        return;
-            //    }
-            //    //鑷姩鍖栨墽琛� 甯稿紑鍏抽棴
-            //    var data = Newtonsoft.Json.JsonConvert.DeserializeObject<LogicPushResult>(receiveData["Data"].ToString());
-            //    if (data.ActionData != null && data.ActionData.Actiontype == 8
-            //        && data.ActionData.PassDataString == "055704010113")
-            //    {
-            //        HdlThreadLogic.Current.RunMain(() =>
-            //        {
-            //            //寮瑰嚭寰愭鐨勯偅涓獥鍙�
-            //            DoorLock.DoorLockCommonInfo.NomallyOpenModeInvalidDialog((ZigBee.Device.DoorLock)device, DoorLock.DoorLockCommonInfo.DoorLockMessType.ServicePush, null);
-            //        });
-            //    }
-            //}
-        }
-
+                    if (data.ActionData.Actiontype == 8 && data.ActionData.PassDataString == "055704010113")
+                    {
+                        HdlThreadLogic.Current.RunThread(async () =>
+                        {
+                            var result = await Shared.Phone.Device.Logic.SkipView.Exist(3, (ZigBee.Device.DoorLock)device);
+                            HdlThreadLogic.Current.RunMain(() =>
+                            {
+                                //寮瑰嚭寰愭鐨勯偅涓獥鍙�
+                                DoorLock.DoorLockCommonInfo.NomallyOpenModeInvalidDialog((ZigBee.Device.DoorLock)device, DoorLock.DoorLockCommonInfo.DoorLockMessType.ServicePush,
+                                    result != 0 ? true : false, ControlCommonResourse.UpdateDoorLockStatusAction);
+                            });
+                        });
+                    }
+                }
+            }
+        }
         #endregion
-
+
         #region 鈻� 鍦烘櫙瑙﹀彂涓婃姤_______________________
-
+
         /// <summary>
         /// 鍦烘櫙瑙﹀彂涓婃姤
         /// </summary>

--
Gitblit v1.8.0