From f5b46f80546aac860ade6e4c53821e43df833b39 Mon Sep 17 00:00:00 2001
From: tzy <hxb@hdlchina.com.cn>
Date: 星期三, 09 六月 2021 11:11:28 +0800
Subject: [PATCH] Revert "Merge remote-tracking branch 'origin/wxr4' into dev-tzy"

---
 HDL_ON/DAL/Server/HttpServerRequest.cs |  116 +++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 102 insertions(+), 14 deletions(-)

diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index 260643f..214c33d 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -51,7 +51,7 @@
             d.Add("type", qType);
             d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("deviceId",  deviceId );
-            d.Add("key",  deviceKey );
+            d.Add("key",  "value" );
 
             var requestJson = HttpUtil.GetSignRequestJson(d);
             return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_EnvironmentalSensorHistoricalData, requestJson);
@@ -74,20 +74,8 @@
             var requestJson = HttpUtil.GetSignRequestJson(d);
             return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_ArmSensorHistoricalData, requestJson);
         }
-        /// <summary>
-        /// 璇诲彇鏈�杩戜竴涓湀鐨勬暟鎹�
-        /// </summary>
-        /// <returns></returns>
-        public ResponsePackNew GetLastMonthHistory(string deviceId,string key)
-        {
-            Dictionary<string, object> d = new Dictionary<string, object>();
-            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
-            d.Add("deviceId", deviceId);
-            d.Add("key", key);
 
-            var requestJson = HttpUtil.GetSignRequestJson(d);
-            return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_ArmSensorHistoricalData, requestJson);
-        }
+
 
 
         #endregion
@@ -464,6 +452,18 @@
             return HttpUtil.RequestHttpsPost(NewAPI.API_POST_Member_UnbindWithAccount, requestJson).Code;
         }
 
+        /// <summary>
+        /// 鏍规嵁璐﹀彿,鑾峰彇璐﹀彿淇℃伅
+        /// </summary>
+        /// <param name="i_account">鎸囧畾璐﹀彿</param>
+        /// <returns></returns>
+        public ResponsePackNew GetMemberInfoByAccount(string i_account)
+        {
+            var pra = new { account = i_account };
+            var requestJson = HttpUtil.GetSignRequestJson(pra);
+            return HttpUtil.RequestHttpsPost(NewAPI.API_POST_Member_GetMemberInfoByAccount, requestJson);
+        }
+
         #endregion
 
         #region 浣忓畢閮ㄥ垎
@@ -706,6 +706,24 @@
                 isAllowCreateScene = isAllow,
             });
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Update, requestJson);
+        }
+
+        /// <summary>
+        /// 杩囨埛
+        /// </summary>
+        /// <param name="i_account">瀵规柟璐﹀彿</param>
+        /// <returns></returns>
+        public bool TransferResidence(string i_account)
+        {
+            var pra2 = new
+            {
+                homeId = Entity.DB_ResidenceData.Instance.CurrentRegion.id,
+                account = i_account
+            };
+            var requestJson = HttpUtil.GetSignRequestJson(pra2);
+            var result = HttpUtil.RequestHttpsPost(NewAPI.API_Post_TransferResidence, requestJson);
+
+            return result != null && result.Code == StateCode.SUCCESS;
         }
 
         #region 鏂版暟鎹垎浜�
@@ -2430,6 +2448,76 @@
         }
         #endregion
 
+        #region 鈻� 闂ㄩ攣鐩稿叧____________________________
+
+        /// <summary>
+        /// 鑾峰彇闂ㄩ攣鍘嗗彶璁板綍(鎸夋棩鏈熼檷搴�)
+        /// </summary>
+        /// <param name="i_device">璁惧瀵硅薄</param>
+        /// <returns></returns>
+        public List<Stan.DoorHistoryLog> GetDoorHistoryLogs(Function i_device)
+        {
+            //var dicPra = new Dictionary<string, object>();
+            //dicPra.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            //dicPra.Add("deviceId", i_device.deviceId);
+            //dicPra.Add("logType", "OPEN_DOOR");
+            //dicPra.Add("pageSize", "200");
+            //var requestJson = HttpUtil.GetSignRequestJson(dicPra);
+            //var packData = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_DoorHistory, requestJson);
+            //if (packData.Code != StateCode.SUCCESS)
+            //{
+            //    return null;
+            //}
+
+
+            //娴嬭瘯
+            var listLog = new List<Stan.DoorHistoryLog>();
+            for (int i = 1; i <= 3; i++)
+            {
+                var logInfo = new Stan.DoorHistoryLog { StrMsg = "鐢甸噺浣庯紝璇锋洿鎹㈢數姹�" };
+                logInfo.Time = new DateTime(2000, 5, 6, 10, 45, 23).AddDays(i);
+                listLog.Add(logInfo);
+            }
+            for (int i = 1; i <= 3; i++)
+            {
+                var logInfo = new Stan.DoorHistoryLog { StrMsg = "鐢甸噺浣庯紝璇锋洿鎹㈢數姹�" };
+                logInfo.Time = new DateTime(2001, 5, 6, 10, 45, 23).AddDays(i);
+                listLog.Add(logInfo);
+            }
+            for (int i = 1; i <= 3; i++)
+            {
+                var logInfo = new Stan.DoorHistoryLog { StrMsg = "鐢甸噺浣庯紝璇锋洿鎹㈢數姹�" };
+                logInfo.Time = new DateTime(2002, 5, 6, 10, 45, 23).AddDays(i);
+                listLog.Add(logInfo);
+            }
+
+            //鎸夋椂闂撮檷搴�
+            var listSortLog = new List<Stan.DoorHistoryLog>();
+            foreach (var logInfo in listLog)
+            {
+                bool canAdd = true;
+                for (int i = 0; i < listSortLog.Count; i++)
+                {
+                    if (logInfo.Time > listSortLog[i].Time)
+                    {
+                        //鏃堕棿姣斿綋鍓嶇殑绱㈠紩澶�,鍒欐彃鍏ュ埌瀹冪殑鍓嶉潰
+                        listSortLog.Insert(i, logInfo);
+                        canAdd = false;
+                        break;
+                    }
+                }
+                if (canAdd == true)
+                {
+                    //鏃ユ湡鏈�灏�,鍒欐坊鍔犲埌鏈熬
+                    listSortLog.Add(logInfo);
+                }
+            }
+            //鎻愮ず
+            //IMessageCommon.Current.ShowErrorInfoAlter(responePack.Code);
+            return listSortLog;
+        }
+
+        #endregion
         #region 鈻� 闊崇璇█鎺у埗鐩稿叧_________________________
         /// <summary>
         /// 鑾峰彇宸叉巿鏉冪殑闊崇鍒楄〃

--
Gitblit v1.8.0