From 9f326f4000847e6167d8166fa2f6a66f53cb3734 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 17 十二月 2020 09:07:13 +0800
Subject: [PATCH] 新云端Ver1.3

---
 ZigbeeApp/Shared/Phone/Common/Logic/HdlDeviceCommonLogic.cs |   53 ++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 34 insertions(+), 19 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Common/Logic/HdlDeviceCommonLogic.cs b/ZigbeeApp/Shared/Phone/Common/Logic/HdlDeviceCommonLogic.cs
index f075ec2..cfa7c87 100644
--- a/ZigbeeApp/Shared/Phone/Common/Logic/HdlDeviceCommonLogic.cs
+++ b/ZigbeeApp/Shared/Phone/Common/Logic/HdlDeviceCommonLogic.cs
@@ -160,7 +160,7 @@
                 if (bolSave == true)
                 {
                     //鍒犳帀杩欎釜鏂囦欢,閲嶆柊鐢熸垚
-                    HdlAutoBackupLogic.DeleteFile(file);
+                    HdlBackupLogic.Current.DeleteAutoBackFileStatu(file);
                     Global.DeleteFilebyHomeId(file);
                 }
 
@@ -170,7 +170,7 @@
                     //涓嶅瓨鍦ㄧ殑璇濓紝閲嶆柊鐢熸垚
                     device.IconPath = string.Empty;
                     device.ReSave();
-                    HdlAutoBackupLogic.AddOrEditorFile(device.FilePath);
+                    HdlBackupLogic.Current.AddOrEditorAutoBackFileStatu(device.FilePath);
 
                     bolSave = false;
                 }
@@ -178,7 +178,7 @@
                 if (bolSave == true)
                 {
                     device.ReSave();
-                    HdlAutoBackupLogic.AddOrEditorFile(device.FilePath);
+                    HdlBackupLogic.Current.AddOrEditorAutoBackFileStatu(device.FilePath);
                 }
             }
             //鎴愬憳韬唤鐨勬椂鍊�,鍒犻櫎鎺夐潪娉曠殑缃戝叧鏂囦欢
@@ -393,7 +393,7 @@
                 if (exists == false)
                 {
                     //娣诲姞鑷姩澶囦唤
-                    HdlAutoBackupLogic.AddOrEditorFile(device.FilePath);
+                    HdlBackupLogic.Current.AddOrEditorAutoBackFileStatu(device.FilePath);
                 }
                 return;
             }
@@ -431,7 +431,7 @@
             if (exists2 == false)
             {
                 //娣诲姞鑷姩澶囦唤
-                HdlAutoBackupLogic.AddOrEditorFile(device.FilePath);
+                HdlBackupLogic.Current.AddOrEditorAutoBackFileStatu(device.FilePath);
             }
         }
 
@@ -631,7 +631,7 @@
             //濡傛灉褰撳墠鏄櫄鎷熶綇瀹�
             if (Common.Config.Instance.Home.IsVirtually == true)
             {
-                return Phone.TemplateData.TemplateDeviceDataLogic.Current.ReDeviceMacName(device, macName);
+                return Phone.HdlTemplateDeviceDataLogic.Current.ReDeviceMacName(device, macName);
             }
 
             //鑾峰彇缂栬緫璁惧Mac鍚嶅瓧鐨勫懡浠ゅ瓧绗�
@@ -642,7 +642,7 @@
                 return null;
             }
             //鍔犵紦瀛�
-            Phone.TemplateData.TemplateDeviceDataLogic.Current.ReDeviceMacName(device, macName);
+            Phone.HdlTemplateDeviceDataLogic.Current.ReDeviceMacName(device, macName);
 
             var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.RenameDeviceMacNameData>(result.ReceiptData);
             return new CommonDevice.RenameDeviceMacNameAllData { renameDeviceMacNameData = tempData };
@@ -659,7 +659,7 @@
             //濡傛灉褰撳墠鏄櫄鎷熶綇瀹�
             if (Common.Config.Instance.Home.IsVirtually == true)
             {
-                return Phone.TemplateData.TemplateDeviceDataLogic.Current.ReDeviceEpointName(device, deviceName);
+                return Phone.HdlTemplateDeviceDataLogic.Current.ReDeviceEpointName(device, deviceName);
             }
             //鑾峰彇缂栬緫璁惧绔偣鍚嶅瓧鐨勫懡浠ゅ瓧绗�
             var sendData = this.GetReDeviceEpointNameCommandText(device.DeviceAddr, device.DeviceEpoint, deviceName);
@@ -669,7 +669,7 @@
                 return null;
             }
             //鍔犵紦瀛�
-            Phone.TemplateData.TemplateDeviceDataLogic.Current.ReDeviceEpointName(device, deviceName);
+            Phone.HdlTemplateDeviceDataLogic.Current.ReDeviceEpointName(device, deviceName);
 
             var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.DeviceRenameResponseData>(result.ReceiptData);
             return new CommonDevice.DeviceRenameAllData { deviceRenameData = tempData };
@@ -732,7 +732,7 @@
                     device.ReSave();
 
                     //娣诲姞鑷姩澶囦唤
-                    HdlAutoBackupLogic.AddOrEditorFile(device.FilePath);
+                    HdlBackupLogic.Current.AddOrEditorAutoBackFileStatu(device.FilePath);
                 }
                 else if (this.dicOTADevice.ContainsKey(mainKeys) == true)
                 {
@@ -741,7 +741,7 @@
                     device.ReSave();
 
                     //娣诲姞鑷姩澶囦唤
-                    HdlAutoBackupLogic.AddOrEditorFile(device.FilePath);
+                    HdlBackupLogic.Current.AddOrEditorAutoBackFileStatu(device.FilePath);
 
                 }
             }
@@ -825,7 +825,7 @@
                 }
             }
             //鍒犻櫎妯℃澘鏁版嵁
-            Phone.TemplateData.TemplateCommonLogic.Current.DeleteDevice(device);
+            Phone.HdlTemplateCommonLogic.Current.DeleteDevice(device);
 
             //鍒犻櫎璁惧鏂囦欢
             string filePath = device.FilePath;
@@ -841,7 +841,7 @@
                     //鍙樻洿锛氭悶鎺夊畠,涓嶇暀浜�
                     Global.DeleteFilebyHomeId(filePath);
                     //鍒犻櫎鑷姩澶囦唤
-                    HdlAutoBackupLogic.DeleteFile(device.FilePath);
+                    HdlBackupLogic.Current.DeleteAutoBackFileStatu(device.FilePath);
                 }
             }
         }
@@ -870,7 +870,7 @@
                         //鍙樻洿锛氭悶鎺夊畠,涓嶇暀浜�
                         Global.DeleteFilebyHomeId(otaFile);
                         //鍒犻櫎鑷姩澶囦唤
-                        HdlAutoBackupLogic.DeleteFile(otaFile);
+                        HdlBackupLogic.Current.DeleteAutoBackFileStatu(otaFile);
                     }
                 }
                 this.dicOTADevice.Remove(otaKeys);
@@ -1468,7 +1468,7 @@
                         {
                             //閲嶆柊鐢熸垚缂撳瓨
                             tempDevice.ReSave();
-                            HdlAutoBackupLogic.AddOrEditorFile(tempDevice.FilePath);
+                            HdlBackupLogic.Current.AddOrEditorAutoBackFileStatu(tempDevice.FilePath);
                             //鍏ㄩ儴涓婚〉鑿滃崟闇�瑕佸埛鏂�
                             Phone.UserView.UserPage.Instance.RefreshAllForm = true;
                         }
@@ -1720,7 +1720,7 @@
             device.IsCustomizeImage = true;
             device.ReSave();
 
-            HdlAutoBackupLogic.AddOrEditorFile(device.FilePath);
+            HdlBackupLogic.Current.AddOrEditorAutoBackFileStatu(device.FilePath);
         }
 
         /// <summary>
@@ -3170,7 +3170,7 @@
                                 {
                                     //閲嶆柊鐢熸垚缂撳瓨
                                     tempDevice.ReSave();
-                                    HdlAutoBackupLogic.AddOrEditorFile(tempDevice.FilePath);
+                                    HdlBackupLogic.Current.AddOrEditorAutoBackFileStatu(tempDevice.FilePath);
                                     //鍏ㄩ儴涓婚〉鑿滃崟闇�瑕佸埛鏂�
                                     Phone.UserView.UserPage.Instance.RefreshAllForm = true;
                                 }
@@ -3327,7 +3327,7 @@
             }
             //鍒犻櫎鏈湴鏂囦欢
             HdlFileLogic.Current.DeleteFile(oldFile);
-            HdlAutoBackupLogic.DeleteFile(oldLocalDevice.FilePath);
+            HdlBackupLogic.Current.DeleteAutoBackFileStatu(oldLocalDevice.FilePath);
 
             //閲嶆柊鐢熸垚鏂囦欢
             if (newDevice.IsCustomizeImage == false)
@@ -3835,7 +3835,22 @@
             }
             myGateway.Actions -= receiptAction;
             receiptAction = null;
-            if (listCheckTopic.Count != listReceiptTopic.Count)
+
+            int receveCount = listCheckTopic.Count;
+            if (receveCount > 1)
+            {
+                //鐪嬬湅閲岄潰鏈夋病鏈夐噸澶嶇殑
+                var listTemp = new HashSet<string>();
+                foreach (var value in listCheckTopic)
+                {
+                    if (listTemp.Contains(value) == false)
+                    {
+                        listTemp.Add(value);
+                    }
+                }
+                receveCount = listTemp.Count;
+            }
+            if (receveCount != listReceiptTopic.Count)
             {
                 reResult.ErrorMsgDiv = 0;
             }

--
Gitblit v1.8.0