From 96e9ff2e5a54f54cdbb6b8b2f049fdf6a837de3c Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期三, 23 八月 2023 14:28:22 +0800 Subject: [PATCH] 备份1 --- OnPro/HDL_ON/Common/ApiUtlis.cs | 234 ---------------------------------------------------------- 1 files changed, 0 insertions(+), 234 deletions(-) diff --git a/OnPro/HDL_ON/Common/ApiUtlis.cs b/OnPro/HDL_ON/Common/ApiUtlis.cs index 5272390..0120b0f 100644 --- a/OnPro/HDL_ON/Common/ApiUtlis.cs +++ b/OnPro/HDL_ON/Common/ApiUtlis.cs @@ -4,7 +4,6 @@ using HDL_ON.DAL; 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; @@ -277,120 +276,6 @@ //MainPage.Log($"============璁惧============{iiii++}"); } - - - //===================璇诲彇鍙瀵硅鏁版嵁========================== - //鍒ゆ柇鏄惁鏈夊彲瑙嗗璁叉暟鎹紝鏈夊垯鏄剧ず鍙瀵硅icon - //var flVideoInfo = HttpRequest.CheckFlVideo(); - //if(flVideoInfo.Code == StateCode.SUCCESS) - //{ - // FunctionList.List.videoIntercom1111 = Newtonsoft.Json.JsonConvert.DeserializeObject<UI.UI2.FuntionControlView.Video.VideoClouds>(flVideoInfo.Data.ToString()); - //} - - //======================鑾峰彇鍙瀵硅璁惧鍒楄〃==================== - bool isInterphoneType_HDL = false;//鏄惁涓篐DLLinphone鍙瀵硅 - bool isInterphoneType_FREEVIEW = false;//鏄惁涓哄叏瑙嗛�氬彲瑙嗗璁� - var videoInfo = VideoSend.GetVideoInfoList(); - if (videoInfo.Code == StateCode.SUCCESS) - { - string videoList = videoInfo.Data.ToString(); - FunctionList.List.videoIntercom = JsonConvert.DeserializeObject<List<UI.UI2.FuntionControlView.Video.Video>>(videoList); - - for(int i =0;i< FunctionList.List.videoIntercom.Count;i++) - { - var video = FunctionList.List.videoIntercom[i]; - - if (video.interphoneType == InterphoneType.IMOUVISIAL.ToString()) - { - UI.UI2.PersonalCenter.PirDevice.PirSend.LcSubAccessToken = video.subAccountToken; - } - else if (video.interphoneType == InterphoneType.HDL.ToString()) - { - isInterphoneType_HDL = true; - DB_ResidenceData.Instance.SupportFacePass = true; - DB_ResidenceData.Instance.SaveResidenceData(); - DB_ResidenceData.Instance.SupportFVDevice = true; - } - else if (video.interphoneType == InterphoneType.FREEVIEW.ToString()) - { -#if __IOS__ - try - { - FunctionList.List.videoIntercom.Remove(video); - --i; - }catch(Exception ex) - { - MainPage.Log($"ios 鍏ㄨ閫氬紓甯� : {ex.Message}"); - } - -#else - //涓哄叏瑙嗛�氬彲瑙嗗璁� - DB_ResidenceData.Instance.SupportFacePass = true; - Entity.DB_ResidenceData.Instance.SupportVisitorManage = true; - Entity.DB_ResidenceData.Instance.SupportFVDevice = true; - isInterphoneType_FREEVIEW = true; -#endif - } - } - } - - - //======================鑾峰彇Sip璐﹀彿骞朵笖鍒濆鍖朣DK鍙瀵硅璁惧鍒楄〃==================== - //濡傛灉妫�娴嬬嚎绋嬫病鍚姩锛屾墠缁х画涓嬮潰鎿嶄綔 鍥犱负App鏈夊彲鑳藉垰鍚姩椹笂鏀跺埌鎺ㄩ�佷簡锛岀劧鍚庢墠鎵ц鍒拌繖閲� - if (HDLLinphone.Current.CheckIncomingCallThreadIsNull()) - { - - //褰撳墠浣忓畢鏄疕DL鍙瀵硅绫诲瀷鐨勮澶� - if (isInterphoneType_HDL) - { - //HDLLinphone鍙瀵硅,鑾峰彇Sip璐﹀彿骞跺垵濮嬪寲SDK - HDLCallVideoInfo callVideoInfo = new HDLCallVideoInfo(); - callVideoInfo.HomeId = DB_ResidenceData.Instance.CurrentRegion.id; - callVideoInfo.InterphoneType = InterphoneType.HDL.ToString(); - HDLLinphone.Current.GetHDLSipInfoAndInitSDK(callVideoInfo); - } - else if (isInterphoneType_FREEVIEW) - { - //HDLLinphone鍙瀵硅,鑾峰彇Sip璐﹀彿骞跺垵濮嬪寲SDK - HDLCallVideoInfo callVideoInfo = new HDLCallVideoInfo(); - callVideoInfo.HomeId = DB_ResidenceData.Instance.CurrentRegion.id; - callVideoInfo.InterphoneType = InterphoneType.FREEVIEW.ToString(); - HDLLinphone.Current.GetHDLSipInfoAndInitSDK(callVideoInfo); - } - else - { - Utlis.WriteLine("褰撳墠浣忓畢涓嶆敮鎸丠DL鍙瀵硅,閫�鍑虹櫥褰曟墍鏈夎处鍙�"); - //褰撳墠浣忓畢涓嶆敮鎸丠DL鍙瀵硅 - HDLLinphone.Current.LogoutAllAccount(); - } - } - - - - //======================鐧诲綍鍏ㄨ閫�==================== - if (isInterphoneType_FREEVIEW) - { - -#if __IOS__ - //string systemVersion = UIKit.UIDevice.CurrentDevice.SystemVersion; - //string errorVersion = "16.2.0"; - //if (systemVersion.CompareTo(errorVersion) < 0)///鍏ㄨ閫氫笉鍏煎ios16浠ヤ笂鐨勭郴缁燂紝涓嶈鍔犺浇杩欎釜鍏� - //{ - // 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 - } - } else { @@ -406,71 +291,6 @@ MainPage.Log($"============璁惧============瀹屾垚" + FunctionList.List.Functions.Count); } - - //======================缇ゆ帶==================== - 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(); - } - //FunctionList.List.Functions.AddRange(FunctionList.List.groupControls); - } - 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); - } - } - } //======================鍦烘櫙==================== try { @@ -533,8 +353,6 @@ complateScene = true; } - //======================瀹夐槻==================== - GetSecurityList(); }) { IsBackground = true }.Start(); @@ -561,14 +379,6 @@ }); //涓嶈�冭檻缃戝叧鎯呭喌锛岀洿鎺ヨ闃� DAL.Mqtt.MqttClient.InitState(); - - try - { - FunctionList.List.Read3tyFunctionStatus(); - }catch(Exception ex) - { - MainPage.Log("璇诲彇绗笁鏂硅澶囩姸鎬佸け璐�:"+ex.Message); - } } }); downloadDataThread.IsBackground = true; @@ -631,50 +441,6 @@ { function.SaveFunctionFile(); FunctionList.List.IniFunctionList(function.savePath,true); - } - } - } - - /// <summary> - /// 鑾峰彇瀹夐槻鍒楄〃 - /// </summary> - public void GetSecurityList() - { - lock (FunctionList.List.securities) - { - var pack = Ins.HttpRequest.GetSecurityList(); - if (pack.Code == StateCode.SUCCESS) - { - var packList = JsonConvert.DeserializeObject<List<SecurityAlarm>>(pack.Data.ToString()); - Console.WriteLine("瀹夐槻鎬绘暟锛�" + packList.Count); - var sidList = new List<string>(); - foreach (var function in packList) - { - 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) - { - 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); - } - } - } - else - { - MainPage.Log($"璇诲彇瀹夐槻鍒楄〃澶辫触:Code:{pack.Code}; Msg:{pack.message}"); } } } -- Gitblit v1.8.0