From a7ab4b610972e20753dfedb3e5d80e4d9f017d07 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期五, 14 八月 2020 10:39:08 +0800
Subject: [PATCH] 临时备份,测试1

---
 ZigbeeApp/Shared/Common/House.cs |  120 ++++++++++++++++++++++++++++++------------------------------
 1 files changed, 60 insertions(+), 60 deletions(-)

diff --git a/ZigbeeApp/Shared/Common/House.cs b/ZigbeeApp/Shared/Common/House.cs
index d368109..87e9aee 100755
--- a/ZigbeeApp/Shared/Common/House.cs
+++ b/ZigbeeApp/Shared/Common/House.cs
@@ -60,19 +60,63 @@
         /// </summary>
         public string ResidenceAddressName = string.Empty;
         /// <summary>
-        /// 鎴块棿鍒楄〃(鎴块棿鐨処D)
-        /// </summary>
-        public List<string> ListRooms = new List<string>();
-        /// <summary>
         /// 妤煎眰瀛楀吀
         /// key:FloorId
         /// value:FloorName
         /// </summary>
         public Dictionary<string,string> FloorDics = new Dictionary<string,string> { };
         /// <summary>
-        /// 褰撳墠妤煎眰Id
+        /// -1:鏈厤缃�(闇�瑕侀噸鏂伴�夋嫨) 1:鏃犳ā鏉挎湁璁惧  2:鏈夋ā鏉挎湁璁惧  3:鏃犳ā鏉挎棤璁惧(璇锋棤瑙嗚繖涓彉閲�)
         /// </summary>
-        public string CurrentFloorId = string.Empty;
+        public int TemplateMode = -1;
+        /// <summary>
+        /// 璇ヤ綇瀹呮槸鍚︽槸灞曠ず妯℃澘(姝ゅ彉閲忔槸缁欐煡鐪嬫ā鏉挎暟鎹椂浣跨敤鐨�,璇锋棤瑙嗚繖涓彉閲�)
+        /// </summary>
+        [Newtonsoft.Json.JsonIgnore]
+        public bool IsShowTemplate = false;
+        /// <summary>
+        /// 褰撳墠浣忓畢閫夋嫨鐨勬ā鏉垮悕瀛�(璇锋棤瑙嗚繖涓彉閲�)
+        /// </summary>
+        public string SelectTemplate = string.Empty;
+        /// <summary>
+        /// 鑷畾涔夊崟鍏冪殑鏍囬鍚嶇О(涓嶭istUintContent涓暟鍖归厤,璇锋棤瑙嗚繖涓彉閲�)
+        /// </summary>
+        public List<string> ListUintName = new List<string>();
+        /// <summary>
+        /// 鑷畾涔夊崟鍏冪殑鍐呭(涓嶭istUintName涓暟鍖归厤,璇锋棤瑙嗚繖涓彉閲�)
+        /// </summary>
+        public List<string> ListUintContent = new List<string>();
+        /// <summary>
+        /// 鏈�鍚庣紪杈戠殑浜嬩欢(2020.05.26杩藉姞) 1970/12/31 23:59鏍煎紡
+        /// </summary>
+        public string LastEditorTime = "1970/12/31 23:59";
+        /// <summary>
+        /// 鏍囪瘑姝や綇瀹呯殑鏁版嵁鏄惁宸茬粡鍙戦�佽繃妯℃澘鏁版嵁缁欑綉鍏�(鍙拡瀵筎emplateMode=2,璇锋棤瑙嗚繖涓彉閲�)
+        /// </summary>
+        public bool SendTemplateSuccess = false;
+        /// <summary>
+        /// 杩欎釜浣忓畢涓嬫墍鎷ユ湁鐨勭綉鍏砳d(2020.05.26杩藉姞,null浠h〃娌℃湁澶勭悊杩�,璇锋棤瑙嗚繖涓彉閲�)
+        /// </summary>
+        [Newtonsoft.Json.JsonIgnore]
+        public List<string> listGatewayId = null;
+        /// <summary>
+        /// <para>鏍囪瘑浣忓畢鏁版嵁鐨勫尯鍒�(鏂囦欢璇诲彇鏃堕厤缃�,璇锋棤瑙嗚繖涓彉閲�)锛�</para>
+        /// <para>1:鏈韩鑷繁鐨勬暟鎹�(鏂囦欢澶瑰悕瀛椾负浣忓畢id)</para>
+        /// <para>2:鑷繁鎵嬪姩鍒涘缓鐨勪繚瀛樺湪鏈満鐨勫浠�(鏂囦欢澶瑰悕瀛椾互銆怋ackupResidenceData銆戝紑澶�)</para>
+        /// <para>3:姝ゆ暟鎹粠浜戠涓嬭浇鑰屾潵(鏂囦欢澶瑰悕瀛椾互銆怐ownLoadResidenceData銆戝紑澶�)</para>
+        /// </summary>
+        [Newtonsoft.Json.JsonIgnore]
+        public int HouseDataDiv = 1;
+        /// <summary>
+        /// 褰撳墠浣忓畢鐨勫湪绾跨姸鎬� -1:铏氭嫙 0:绂荤嚎 1:鏈湴 2:杩滅▼ 3:璇诲彇涓�(璇锋棤瑙嗚繖涓彉閲�)
+        /// </summary>
+        [Newtonsoft.Json.JsonIgnore]
+        public string NowHomeOnlineStatu = "3";
+        /// <summary>
+        /// 褰撳墠瀛樻斁浣忓畢鏁版嵁鐨勬枃浠跺す鍚嶅瓧(姝ゅ彉閲忔槸缁欐湰鏈哄浠�,鎴栬�呬簯绔笅杞藉浠戒娇鐢ㄧ殑,璇锋棤瑙嗚繖涓彉閲�)
+        /// </summary>
+        [Newtonsoft.Json.JsonIgnore]
+        public string SaveDirctoryName = string.Empty;
 
         #endregion
 
@@ -86,62 +130,15 @@
         public string GetCurrentFloorName
         {
             get
-            {
+            {
                 return HdlResidenceLogic.Current.GetFloorNameById(CurrentFloorId);
             }
-        }
-
-        /// <summary>
-        /// 璁剧疆褰撳墠妤煎眰鐨処D
+        }
+        /// <summary>
+        /// 褰撳墠妤煎眰ID
         /// </summary>
-        public void SetCurrentFloorId()
-        {
-            if (Config.Instance.Home.FloorDics.Count > 0 && string.IsNullOrEmpty(CurrentFloorId))
-            {
-                foreach (var floor in Config.Instance.Home.FloorDics)
-                {
-                    CurrentFloorId = floor.Key;
-                    Save(false);
-                    return;
-                }
-            }
-        }
-
-        #endregion
-
-        #region 鈼� 娣诲姞鎴块棿璺緞_________________________
-
-        /// <summary>
-        /// 娣诲姞鎴块棿ID
-        /// </summary>
-        /// <returns><c>true</c>, if room list file path was added, <c>false</c> otherwise.</returns>
-        /// <param name="roomFilePath">Room file path.</param>
-        public void AddRoomId(string roomId)
-        {
-            if (ListRooms.Contains(roomId) == false)
-            {
-                ListRooms.Add(roomId);
-                this.Save();
-            }
-        }
-
-        #endregion
-
-        #region 鈼� 鍒犻櫎鎴块棿璺緞_________________________
-
-        /// <summary>
-        /// 绉婚櫎鎴块棿Id
-        /// </summary>
-        /// <returns><c>true</c>, if room list file path was added, <c>false</c> otherwise.</returns>
-        /// <param name="roomFilePath">Room file path.</param>
-        public void RemoveRoomId(string roomId)
-        {
-            if (ListRooms.Contains(roomId)==true)
-            {
-                ListRooms.Remove(roomId);
-                Save();
-            }
-        }
+        [Newtonsoft.Json.JsonIgnore]
+        public string CurrentFloorId = string.Empty;
 
         #endregion
 
@@ -153,6 +150,8 @@
         /// <param name="autoBackup">鏄惁澶囦唤</param>
         public void Save(bool autoBackup = true)
         {
+            //淇敼鏃堕棿
+            this.LastEditorTime = DateTime.Now.ToString("yyyy/MM/dd HH:mm");
             var path = System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, Config.Instance.Guid, Id);
             //濡傛灉娌℃湁瀛樺湪浣忓畢鐩綍锛屽厛鍒涘缓
             if (!System.IO.Directory.Exists(path))
@@ -160,7 +159,8 @@
                 System.IO.Directory.CreateDirectory(path);
             }
             path = System.IO.Path.Combine(path, FileName);
-            Shared.IO.FileUtils.WriteFileByBytes(path, System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this)));
+            HdlFileLogic.Current.SaveFileContent(path, this);
+
             if (autoBackup == true && Id == Config.Instance.HomeId)
             {
                 HdlAutoBackupLogic.AddOrEditorFile(FileName);

--
Gitblit v1.8.0