From 02498f7744e6fdc413e518f96b25f3635540dc6b Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 15 十一月 2022 11:27:38 +0800
Subject: [PATCH] 金茂科技系统更新

---
 HDL_ON/Common/ApiUtlis.cs |   26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/HDL_ON/Common/ApiUtlis.cs b/HDL_ON/Common/ApiUtlis.cs
index 38f4711..ee2d4f8 100644
--- a/HDL_ON/Common/ApiUtlis.cs
+++ b/HDL_ON/Common/ApiUtlis.cs
@@ -5,6 +5,7 @@
 using HDL_ON.DAL.Server;
 using HDL_ON.Entity;
 using HDL_ON.UI.UI2.FuntionControlView.Video;
+using HDL_ON.UI.UI2.Intelligence.Automation;
 using Newtonsoft.Json;
 using Shared;
 
@@ -88,6 +89,8 @@
             waitPage.Start(Language.StringByID(StringId.PleaseWait));
 
             string code = StateCode.SUCCESS;
+
+            Inverter.Ins.H5Page = null;//閲嶇疆鍏変紡椤甸潰
 
             var downloadDataThread = new System.Threading.Thread(() =>
             {
@@ -173,9 +176,9 @@
                             {
                                 endTime = DateTime.Now.AddSeconds(5);
 
-                                MainPage.Log($"璇诲彇璁惧淇℃伅鎴愬姛");
-                                MainPage.Log($"sid鍒楄〃鑾峰彇====" + deviceResult.Data.ToString());
-                                var deviceList = Newtonsoft.Json.JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString());
+                                //MainPage.Log($"璇诲彇璁惧淇℃伅鎴愬姛");
+                                //MainPage.Log($"sid鍒楄〃鑾峰彇====" + deviceResult.Data.ToString());
+                                var deviceList = JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString());
                                 if (deviceList == null)
                                 {
                                     deviceList = new DevcieApiPack();
@@ -187,7 +190,7 @@
                                         var deviceResult2 = Ins.HttpRequest.GetDeviceList("30", Convert.ToInt32(deviceList.pageNo) + 1 + "");
                                         if (deviceResult2.Code == StateCode.SUCCESS)
                                         {
-                                            var deviceList2 = Newtonsoft.Json.JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString());
+                                            var deviceList2 = JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString());
                                             deviceList.pageNo = deviceList2.pageNo;
                                             deviceList.list.AddRange(deviceList2.list);
                                         }
@@ -226,11 +229,13 @@
                                     }
                                 }
                                 //澶勭悊鍓╀笅鐨勬柊澧炲姛鑳�
+                                int iiii = 0;
                                 foreach (var newFunction in deviceList.list)
                                 {
                                     newFunction.AssembleStatus();
                                     newFunction.SaveFunctionFile();
                                     FunctionList.List.IniFunctionList(newFunction.savePath);
+                                    MainPage.Log($"============璁惧============{iiii++}");
                                 }
                                 endTime = DateTime.Now.AddSeconds(5);
                             }
@@ -245,6 +250,7 @@
                         finally
                         {
                             complateDevice = true;
+                            MainPage.Log($"============璁惧============瀹屾垚");
                         }
                     })
                     { IsBackground = true }.Start();
@@ -318,7 +324,8 @@
                     { IsBackground = true }.Start();
 
                     //===================璇诲彇閫昏緫鍒楄〃==========================
-                    UI.UI2.Intelligence.Automation.MainView.GetLogicList();
+                    Logic.LogicList.Clear();//涓婚〉涓嬫媺寮哄埗鍒锋柊鑷姩鍖栧垪琛�
+                    //UI.UI2.Intelligence.Automation.MainView.GetLogicList();
 
                     //===================璇诲彇鍙瀵硅鏁版嵁==========================
                     //鍒ゆ柇鏄惁鏈夊彲瑙嗗璁叉暟鎹紝鏈夊垯鏄剧ず鍙瀵硅icon
@@ -348,10 +355,10 @@
                                 DB_ResidenceData.Instance.SaveResidenceData();
 
                                 Entity.DB_ResidenceData.Instance.SupportFVDevice = true;
-
                             }
                             else if (video.interphoneType == InterphoneType.FREEVIEW.ToString())
-                            {//涓哄叏瑙嗛�氬彲瑙嗗璁�
+                            {
+                                //涓哄叏瑙嗛�氬彲瑙嗗璁�
                                 DB_ResidenceData.Instance.SupportFacePass = true;
                                 Entity.DB_ResidenceData.Instance.SupportVisitorManage = true;
                                 Entity.DB_ResidenceData.Instance.SupportFVDevice = true;
@@ -403,6 +410,9 @@
 
                     //======================瀹夐槻====================
                     GetSecurityList();
+                    //======================娉ㄥ唽鎺ㄩ��====================
+                    httpRequest.RegisteredPush();
+
 
                 }
                 catch (Exception ex)
@@ -439,7 +449,7 @@
                 {
                     while (endTime > DateTime.Now)
                     {
-                        if (DownloadDataComplete)
+                        if (DownloadDataComplete && complateDevice && complateScene)
                         {
                             break;
                         }

--
Gitblit v1.8.0