| | |
| | | if (deviceResult.Code == StateCode.SUCCESS) |
| | | { |
| | | FunctionList.List.ClearDatas(); |
| | | MainPage.Log($"============设备============开始" + FunctionList.List.Functions.Count); |
| | | //MainPage.Log($"============设备============开始" + FunctionList.List.Functions.Count); |
| | | //MainPage.Log($"读取设备信息成功"); |
| | | //MainPage.Log($"sid列表获取====" + deviceResult.Data.ToString()); |
| | | var deviceList = JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString()); |
| | |
| | | } |
| | | } |
| | | //处理剩下的新增功能 |
| | | int iiii = 0; |
| | | //int iiii = 0; |
| | | foreach (var newFunction in deviceList.list) |
| | | { |
| | | newFunction.AssembleStatus(); |
| | | newFunction.SaveFunctionFile(); |
| | | FunctionList.List.IniFunctionList(newFunction.savePath,true); |
| | | MainPage.Log($"============设备============{iiii++}"); |
| | | //MainPage.Log($"============设备============{iiii++}"); |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | |
| | | #if __IOS__ |
| | | 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) |
| | | string systemVersion = UIKit.UIDevice.CurrentDevice.SystemVersion; |
| | | string errorVersion = "16.2.0"; |
| | | if (systemVersion.CompareTo(errorVersion) < 0)///全视通不兼容ios16以上的系统,不要加载这个先 |
| | | { |
| | | 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"); |
| | | 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 = 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 |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | #if DEBUG |
| | | DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl = true; |
| | | #endif |
| | | if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl) |
| | | { |
| | | var pack = Ins.HttpRequest.GetGroupControlList(); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | //}) |
| | | //{ IsBackground = true }.Start(); |
| | | |
| | | //======================场景==================== |
| | | try |
| | | { |
| | | complateScene = false; |
| | |
| | | { |
| | | complateScene = true; |
| | | } |
| | | |
| | | //======================安防==================== |
| | | GetSecurityList(); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | //===================读取逻辑列表========================== |
| | | Logic.LogicList.Clear();//主页下拉强制刷新自动化列表 |
| | | //UI.UI2.Intelligence.Automation.MainView.GetLogicList(); |
| | | |
| | | |
| | | |
| | | //======================安防==================== |
| | | GetSecurityList(); |
| | | //======================注册推送==================== |
| | | httpRequest.RegisteredPush(); |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | /// </summary> |
| | | public void GetSecurityList() |
| | | { |
| | | var pack = Ins.HttpRequest.GetSecurityList(); |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | lock (FunctionList.List.securities) |
| | | { |
| | | var packList = JsonConvert.DeserializeObject<List<SecurityAlarm>>(pack.Data.ToString()); |
| | | var sidList = new List<string>(); |
| | | foreach (var function in packList) |
| | | var pack = Ins.HttpRequest.GetSecurityList(); |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | sidList.Add(function.sid); |
| | | } |
| | | var infoListPack = Ins.httpRequest.GetSecurityInfo(sidList, new List<string>()); |
| | | var infoList = JsonConvert.DeserializeObject<List<SecurityAlarm>>(infoListPack.Data.ToString()); |
| | | if (infoList != null) |
| | | { |
| | | var filePathList = FileUtlis.Files.ReadFiles().FindAll((obj) => obj.StartsWith("SecurityData_")); |
| | | if (filePathList != null) |
| | | var packList = JsonConvert.DeserializeObject<List<SecurityAlarm>>(pack.Data.ToString()); |
| | | Console.WriteLine("安防总数:" + packList.Count); |
| | | var sidList = new List<string>(); |
| | | foreach (var function in packList) |
| | | { |
| | | foreach (var file in filePathList) |
| | | sidList.Add(function.sid); |
| | | } |
| | | var infoListPack = Ins.httpRequest.GetSecurityInfo(sidList, new List<string>()); |
| | | var infoList = JsonConvert.DeserializeObject<List<SecurityAlarm>>(infoListPack.Data.ToString()); |
| | | if (infoList != null) |
| | | { |
| | | var filePathList = FileUtlis.Files.ReadFiles().FindAll((obj) => obj.StartsWith("SecurityData_")); |
| | | if (filePathList != null) |
| | | { |
| | | FileUtlis.Files.DeleteFile(file); |
| | | foreach (var file in filePathList) |
| | | { |
| | | FileUtlis.Files.DeleteFile(file); |
| | | } |
| | | } |
| | | FunctionList.List.securities.Clear(); |
| | | foreach (var function in infoList) |
| | | { |
| | | function.SaveFile(); |
| | | FunctionList.List.IniFunctionList(function.savePath, true); |
| | | } |
| | | } |
| | | FunctionList.List.securities.Clear(); |
| | | foreach (var function in infoList) |
| | | { |
| | | function.SaveFile(); |
| | | FunctionList.List.IniFunctionList(function.savePath, true); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | MainPage.Log($"读取安防列表失败:Code:{pack.Code}; Msg:{pack.message}"); |
| | | else |
| | | { |
| | | MainPage.Log($"读取安防列表失败:Code:{pack.Code}; Msg:{pack.message}"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |