From a3313818a548d51777ae4e6cc006e9d1e2c1036e Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期五, 07 四月 2023 09:15:37 +0800 Subject: [PATCH] 群控备份 --- HDL_ON/Common/ApiUtlis.cs | 86 +++++++++++++++++++++++++++++++++++++++++- 1 files changed, 83 insertions(+), 3 deletions(-) diff --git a/HDL_ON/Common/ApiUtlis.cs b/HDL_ON/Common/ApiUtlis.cs index cb5844c..a177095 100644 --- a/HDL_ON/Common/ApiUtlis.cs +++ b/HDL_ON/Common/ApiUtlis.cs @@ -229,7 +229,7 @@ foreach (var newFunction in deviceList.list) { newFunction.AssembleStatus(); - newFunction.SaveFunctionFile(); + newFunction.SaveFunctionFile(); FunctionList.List.IniFunctionList(newFunction.savePath,true); MainPage.Log($"============璁惧============{iiii++}"); } @@ -314,9 +314,20 @@ //======================鐧诲綍鍏ㄨ閫�==================== if (isInterphoneType_FREEVIEW) { + #if __IOS__ - //鐧诲綍鍏ㄨ閫� - Shared.IOS.HDLFVSDK.Video.Init("", DB_ResidenceData.Instance.CurrentRegion.id); + List<VisitorTempPassword> dataList = new List<VisitorTempPassword>(); + Dictionary<string, object> dictionary = new Dictionary<string, object>(); + dictionary.Add("homeId", Entity.DB_ResidenceData.Instance.CurrentRegion.id); + var requestJson = HttpUtil.GetSignRequestJson(dictionary); + ResponsePackNew pack = HttpUtil.RequestHttpsPost(NewAPI.Api_Post_GetExtMemberInfo, requestJson); + if(pack!= null) + { + var data = Newtonsoft.Json.JsonConvert.DeserializeObject<FreeviewMemberInfo>(pack.Data.ToString()); + //鐧诲綍鍏ㄨ閫� + Shared.IOS.HDLFVSDK.Video.Init("", data.extUserId, DB_ResidenceData.Instance.CurrentRegion.id, "78FF1E4D-FC0A-4E71-9B79-0448E4460BD7", "T0001", "120.77.53.170:9700", "120.77.53.170:21664"); + + } #endif } @@ -334,6 +345,75 @@ complateDevice = true; MainPage.Log($"============璁惧============瀹屾垚" + FunctionList.List.Functions.Count); } + + +#if DEBUG + DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl = true; +#endif + if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl) + { + var pack = Ins.HttpRequest.GetGroupControlList(); + if (pack != null) + { + if (pack.Code == StateCode.SUCCESS) + { + try + { + var groupControlList = JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString()); + var readSidList = new List<string>(); + foreach(var temp in groupControlList) + { + FunctionList.List.groupControls.Clear(); + readSidList.Add(temp.userDeviceGroupControlId); + if (readSidList.Count >= 20) + { + var data = Ins.httpRequest.GetGroupControInfo(readSidList); + if(data != null) + { + if(data.Code == StateCode.SUCCESS) + { + var groupControlInfoList = JsonConvert.DeserializeObject<List<GroupControl>>(data.Data.ToString()); + FunctionList.List.groupControls.AddRange(groupControlInfoList); + } + else + { + IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); + } + } + readSidList.Clear(); + } + } + if (readSidList.Count > 0) + { + var data = Ins.httpRequest.GetGroupControInfo(readSidList); + if (data != null) + { + if (data.Code == StateCode.SUCCESS) + { + var groupControlInfoList = JsonConvert.DeserializeObject<List<GroupControl>>(data.Data.ToString()); + FunctionList.List.groupControls.AddRange(groupControlInfoList); + } + else + { + IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); + } + } + readSidList.Clear(); + } + } + catch (Exception ex) + { + MainPage.Log($"璇诲彇缁勬帶鍒楄〃澶辫触:{ex.Message}"); + } + } + else + { + IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); + } + } + } + + //}) //{ IsBackground = true }.Start(); -- Gitblit v1.8.0