From f14dcfd967404e197e7ec995ca8d6f2b090d3b7d Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期五, 11 九月 2020 09:16:59 +0800
Subject: [PATCH] 优化多功能面板:绑定温湿度传感器目标,和设备列表回路显示。优化数据矫正功能温湿度度不设置的情况。优化门锁时间设置最后一天和最后最后一个月的时间显示等 细节

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs |   31 +++++++++++--------------------
 1 files changed, 11 insertions(+), 20 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs
index d1d8ec5..05702e2 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs
@@ -77,7 +77,7 @@
                 this.ShowTipMsg(msg);
                 return false;
             }
-            var mainWayId = HdlGatewayLogic.Current.GetGatewayId(mainGateway);
+            var mainWayId = mainGateway.GwId;
 
             //涓婚鏁板浐瀹�5+3+1
             int topicCount = 9;
@@ -104,7 +104,7 @@
                 {
                     var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
 
-                    var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZigBee.Device.Safeguard.ErrorResponData>(jobject["Data"].ToString());
+                    var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString());
                     if (temp != null)
                     {
                         string msg = HdlCheckLogic.Current.CheckCommonErrorCode(temp.Error);
@@ -231,6 +231,9 @@
             zoneInfo.ZoneId = allData.ZoneId;
             zoneInfo.ZoneName = allData.ZoneName;
 
+            //淇℃伅鎺ㄩ��
+            zoneInfo.InformationPush = allData.IsDisablePushMessage;
+
             //澶勭悊璁惧
             foreach (var data2 in allData.DeviceList)
             {
@@ -285,9 +288,6 @@
 
             zoneInfo.dicAlarmDevice.Clear();
             zoneInfo.dicScenes.Clear();
-
-            //淇℃伅鎺ㄩ��
-            zoneInfo.InformationPush = resData.IsDisablePushMessage;
 
             foreach (var data in resData.Actions)
             {
@@ -1366,7 +1366,7 @@
 
             if (this.UserPassword == null)
             {
-                var data = Global.ReadFileByDirectory(DirNameResourse.LocalMemoryDirectory, DirNameResourse.SafeguardUserPassword);
+                var data = HdlFileLogic.Current.ReadFileByteContent(DirNameResourse.SafeguardUserPassword);
                 if (data != null)
                 {
                     this.UserPassword = System.Text.Encoding.UTF8.GetString(data);
@@ -1384,7 +1384,7 @@
                 if (result != GarrisonMode.None && result != GarrisonMode.RemoveGarrison)
                 {
                     //淇濆瓨鍔犲瘑鐨勫瘑鐮佸埌鏈湴
-                    Global.WriteFileToDirectoryByBytes(DirNameResourse.LocalMemoryDirectory, DirNameResourse.SafeguardUserPassword, System.Text.Encoding.UTF8.GetBytes(this.UserPassword));
+                    HdlFileLogic.Current.SaveTextToFile(DirNameResourse.SafeguardUserPassword, this.UserPassword);
                 }
                 return result;
             }
@@ -1473,7 +1473,7 @@
                     if (result2 != GarrisonMode.None && result2 != GarrisonMode.RemoveGarrison)
                     {
                         //淇濆瓨鍔犲瘑瀵嗙爜鍒版湰鍦�
-                        Global.WriteFileToDirectoryByBytes(DirNameResourse.LocalMemoryDirectory, DirNameResourse.SafeguardUserPassword, System.Text.Encoding.UTF8.GetBytes(this.UserPassword));
+                        HdlFileLogic.Current.SaveTextToFile(DirNameResourse.SafeguardUserPassword, this.UserPassword);
                     }
                     return result2;
                 }
@@ -1588,7 +1588,7 @@
                     if (result2 != -1)
                     {
                         //淇濆瓨鍒板姞瀵嗗瘑鐮佹湰鍦�
-                        Global.WriteFileToDirectoryByBytes(DirNameResourse.LocalMemoryDirectory, DirNameResourse.SafeguardUserPassword, System.Text.Encoding.UTF8.GetBytes(this.UserPassword));
+                        HdlFileLogic.Current.SaveTextToFile(DirNameResourse.SafeguardUserPassword, this.UserPassword);
                     }
                     return result2;
                 }
@@ -1708,11 +1708,6 @@
             {
                 return false;
             }
-
-            if (zoneId > 3)
-            {
-                zoneId = 3;
-            }
             //鐘舵�佸彉鏇�
             var result = await Safeguard.DisablePushMessageAsync(zoneId, statu);
             if (result == null || result.disablePushMessageResponseData == null || result.disablePushMessageResponseData.Result == 1)
@@ -1742,10 +1737,6 @@
         /// <returns>0:鎺ㄩ��  1:涓嶆帹閫�</returns>
         public int GetGarrisonInformationPushStatu(int zoneId)
         {
-            if (zoneId > 3)
-            {
-                zoneId = 3;
-            }
             if (this.dicAllZoneInfo.ContainsKey(zoneId) == false)
             {
                 return 1;
@@ -2154,7 +2145,7 @@
             bool success = false;
             //瓒呮椂鏃堕棿
             int TimeOut = 0;
-            string checkTopic = HdlGatewayLogic.Current.GetGatewayId(realWay) + "/Security/AdminSetNewPassword_Respon";
+            string checkTopic = realWay.GwId + "/Security/AdminSetNewPassword_Respon";
             Action<string, string> getResultAction = (topic, message) =>
             {
                 try
@@ -2340,7 +2331,7 @@
             /// </summary>
             public string ZoneName;
             /// <summary>
-            /// 淇℃伅鎺ㄩ�� 0:鎺ㄩ��  1:涓嶆帹閫� (鍙湁闃插尯ID:1,2,3鎵嶄細鏈夈��4,5鐨勯兘褰掍负3,鍥犱负瀹冩槸浠ラ槻鍖烘ā寮廔D(ActionType)涓哄崟浣嶇殑)
+            /// 淇℃伅鎺ㄩ�� 0:鎺ㄩ��  1:涓嶆帹閫� 
             /// </summary>
             public int InformationPush = 1;
             /// <summary>

--
Gitblit v1.8.0