From ee5f2543624a0e3ae9d046062b822727a31685e1 Mon Sep 17 00:00:00 2001
From: tzy <hxb@hdlchina.com.cn>
Date: 星期五, 14 五月 2021 17:15:48 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/wxr4' into dev-tzy

---
 HDL_ON/DAL/Server/HttpServerRequest.cs |   61 +++++++++++++++++++++++++++++-
 1 files changed, 59 insertions(+), 2 deletions(-)

diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index 408f9cf..8218c94 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -2418,6 +2418,63 @@
         }
         #endregion
 
+        #region 鈻� 闂ㄩ攣鍘嗗彶璁板綍________________________
+
+        /// <summary>
+        /// 鑾峰彇闂ㄩ攣鍘嗗彶璁板綍(鎸夋棩鏈熼檷搴�)
+        /// </summary>
+        /// <param name="i_device">璁惧瀵硅薄</param>
+        /// <returns></returns>
+        public List<Stan.DoorHistoryLog> GetDoorHistoryLogs(Function i_device)
+        {
+            //娴嬭瘯
+            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>
         /// 鑾峰彇宸叉巿鏉冪殑闊崇鍒楄〃
@@ -2427,7 +2484,7 @@
         {
             var requestJson = HttpUtil.GetSignRequestJson(new GetSpeakerObj
             {
-                homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID,
+                homeId = DB_ResidenceData.Instance.CurrentRegion.id,
             });
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Speaker_List_Get, requestJson);
         }
@@ -2463,7 +2520,7 @@
         public ResponsePackNew GetSpeakerDeviceList(int getType, string tokenId)
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
-            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("tokenId", tokenId);
             if (getType > 0)
             {

--
Gitblit v1.8.0