From 10b78a1626106f18a6b2f68bd2b8cafd2a99683c Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期三, 12 八月 2020 11:31:59 +0800 Subject: [PATCH] 2020-08-12 4.喜爱页面,增加房间场景添加支持。 5.Alexa,添加设备页面增加修改备注功能,点击OK后,增加设备备注名字不匹配然后自动更新操作。 --- Crabtree/SmartHome/UI/SimpleControl/Phone/Register/Databackup.cs | 78 ++++++++++++++++++++++++++++++++++---- 1 files changed, 69 insertions(+), 9 deletions(-) diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/Databackup.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/Databackup.cs index 57b973d..1d87585 100644 --- a/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/Databackup.cs +++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/Databackup.cs @@ -73,7 +73,7 @@ var btnPoint = new Button () { Width = Application.GetRealWidth (10), - Height = Application.GetRealHeight (10), + Height = Application.GetRealWidth (10), X = Application.GetRealWidth (50), Gravity = Gravity.CenterVertical, UnSelectedImagePath = "Item/Point.png", @@ -390,13 +390,18 @@ alert.Show (); }; - if (MainPage.LoginUser.AccountType != 1) { + //if (MainPage.LoginUser.AccountType != 1) { + // rowView.AddRightView (btnDelFile); + //} + + //2020-07-01 褰撳墠浣忓畢灞炰簬鑷繁鐨� 鍏佽鍒犻櫎澶囦唤 + if (!MainPage.IsAdministrator) { rowView.AddRightView (btnDelFile); } var btnPoint = new Button () { Width = Application.GetRealWidth (10), - Height = Application.GetRealHeight (10), + Height = Application.GetRealWidth (10), X = Application.GetRealWidth (25), Gravity = Gravity.CenterVertical, UnSelectedImagePath = "Item/Point.png", @@ -434,8 +439,8 @@ rowView.AddChidren (backupIcon); var Backup_restores = new Button () { - Width = Application.GetRealWidth (56), - Height = Application.GetRealHeight (57), + Width = Application.GetMinRealAverage (56), + Height = Application.GetMinRealAverage (57), X = backupIcon.Right + Application.GetRealWidth (20), UnSelectedImagePath = "Register/Backup_ restores.png", SelectedImagePath = "Register/Backup_ restores_on.png", @@ -949,7 +954,7 @@ new System.Threading.Thread (() => { for (var j = startIndex1; j <= endIndex1; j++) { - var result = DownloadSomeDataBackup (mDownLoad, mUrlHead, dataList [j]); + var result = DownloadSomeDataBackup (mDownLoad, mUrlHead, mFileList [j]); if (result) { index++; Application.RunOnMainThread (() => { @@ -1044,7 +1049,7 @@ /// 澶氭涓婁紶澶氫釜鏂囦欢 /// </summary> /// <param name="mBackupClassId"></param> - void UpLoadBackupFileToDBNew (string mBackupClassId, int maxThreads = 30) + void UpLoadBackupFileToDBNew (string mBackupClassId, int maxThreads = 20) { var backuplist = IO.FileUtils.ReadFiles (); var mFileList = backuplist.FindAll ((obj) => obj != "null" && obj != UserConfig.configFile && obj != UserInfo.GlobalRegisterFile && obj != "AccountListDB"); @@ -1080,8 +1085,8 @@ var id = i; var startIndex1 = startIndex; var endIndex1 = endIndex; - - var result = UploadDataBackup (upData, urlHead, mFileList, startIndex1, endIndex1); + //2020-06-10 淇敼澶у浘鐗囧ぇ鏂囦欢澶勭悊 + var result = UploadDataBackupNew (upData, urlHead, mFileList, startIndex1, endIndex1); if (result) { index++; Application.RunOnMainThread (() => { @@ -1114,5 +1119,60 @@ } + + /// <summary> + /// 2020-06-05 闇�瑕佺瓑寰呬簯绔鍔犳帴鍙� + /// 澶勭悊澶ф枃浠跺拰鍥剧墖涓婁紶 + /// + /// </summary> + /// <param name="upData"></param> + /// <param name="mUrlHead"></param> + /// <param name="fileList"></param> + /// <param name="startIndex1"></param> + /// <param name="endIndex1"></param> + /// <returns></returns> + bool UploadDataBackupNew (UploadHomeAppGatewaySubFilesObj upData, string mUrlHead, List<string> fileList, int startIndex1, int endIndex1) + { + try { + + var list = new List<FileInfoData> (); + for (var j = startIndex1; j <= endIndex1; j++) { + var datainfo = new FileInfoData (); + datainfo.BackupFileName = fileList [j]; + datainfo.BackupFileContent = Shared.IO.FileUtils.ReadFile (fileList [j]); + + if (datainfo.BackupFileContent.Length > 1024 * 10) { + var upDataBig = new UploadHomeAppGatewaySubFilesBigObj (); + upDataBig.RequestVersion = upData.RequestVersion; + upDataBig.HomeId = upData.HomeId; + upDataBig.BackupClassId = upData.BackupClassId; + upDataBig.FileName = fileList [j]; + upDataBig.IsOtherAccountCtrl = upData.IsOtherAccountCtrl; + + var revertObj5 = MainPage.RequestHttpsNewBig (API.UploadHomeAppGatewaySingleSubFile, datainfo.BackupFileContent, upDataBig, mUrlHead); + + } else { + list.Add (datainfo); + } + } + + //鏁寸悊鏁版嵁 + UploadHomeAppGatewaySubFilesObj mUpData = upData; + mUpData.UploadSubFileLists = list; + + var requestJson2 = Newtonsoft.Json.JsonConvert.SerializeObject (mUpData); + var revertObj2 = MainPage.RequestHttps (API.UploadHomeAppGatewaySubFiles, requestJson2, mUrlHead); + if (revertObj2.StateCode.ToUpper () == "SUCCESS") { + return true; + } else { + //鎻愮ず閿欒 + return false; + } + } catch { + return false; + } + } + + } } \ No newline at end of file -- Gitblit v1.8.0