From 9eb94e9eec2e2e164698e34d0481d66093c8655b Mon Sep 17 00:00:00 2001 From: Shuxia Ning <NingShuxia0927@outlook.com> Date: 星期三, 15 一月 2025 17:40:55 +0800 Subject: [PATCH] Merge branch 'master' of http://47.103.154.90:83/r/HStation/XHS.V1.0 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs | 296 ++++++++++++++++++++++++++++++----------------------------- 1 files changed, 150 insertions(+), 146 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs index 5ad22a8..68d7fc9 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs @@ -1,10 +1,4 @@ 锘縰sing Castle.Core.Internal; -using DevExpress.XtraEditors; -using HStation.Model; -using HStation.Vmo; -using Microsoft.Extensions.DependencyInjection; -using static DevExpress.XtraEditors.XtraInputBox; -using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window; namespace HStation.WinFrmUI { @@ -43,87 +37,85 @@ feedBackProgress?.Invoke(100, 5); - #endregion + #endregion 绗竴姝� 涓存椂鏂囦欢澶勭悊锛堣繘搴�5%锛� #region 绗簩姝� 鍒涘缓椤圭洰锛堣繘搴� 10%锛� - //灏氭湭鍒涘缓椤圭洰 + //鍒ゆ柇椤圭洰鏁版嵁鍚堟硶鎬� if (vm.Project == null) { + feedBackMsg?.Invoke("椤圭洰鏁版嵁鍒濆鍖栭敊璇紒锛侊紒", Color.Red); + return false; + } + + if (vm.Project.ID < 1) + { feedBackMsg?.Invoke("姝e湪鍒涘缓椤圭洰...", Color.Black); - - var project = new Vmo.XhsProjectExtensionsVmo(); - project.NO = vm.NO; - project.Name = vm.Name; - project.Address = vm.Address; - project.Customer = vm.Customer; - project.Flags = vm.Flags; - project.TagName = vm.TagName; - project.Description = vm.Description; - project.SiteList = new List<XhsProjectSiteVmo>() - { - new XhsProjectSiteVmo() - { - Name=vm.Name, - Description=vm.Description - } - }; - - var projectId = await BLLFactory<HStation.BLL.XhsProjectExtensions>.Instance.Insert(project); - if (projectId < 1) + vm.Project.ID = await BLLFactory<HStation.BLL.XhsProjectExtensions>.Instance.Insert(vm.Project); + if (vm.Project.ID < 1) { feedBackMsg?.Invoke("椤圭洰鍒涘缓澶辫触锛侊紒锛�", Color.Red); return false; } - vm.ProjectID = projectId; - vm.Project = await BLLFactory<HStation.BLL.XhsProjectExtensions>.Instance.GetByID(projectId); - vm.ProjectSiteID = vm.Project.SiteList.FirstOrDefault().ID; - + vm.Project = await BLLFactory<HStation.BLL.XhsProjectExtensions>.Instance.GetByID(vm.Project.ID); feedBackMsg?.Invoke("椤圭洰鍒涘缓鎴愬姛銆傘�傘��", Color.Green); + } + else + { + feedBackMsg?.Invoke("姝e湪鏇存柊椤圭洰...", Color.Black); + if (!await BLLFactory<HStation.BLL.XhsProjectExtensions>.Instance.Update(vm.Project)) + { + feedBackMsg?.Invoke("椤圭洰鏇存柊澶辫触锛侊紒锛�", Color.Red); + return false; + } + vm.Project = await BLLFactory<HStation.BLL.XhsProjectExtensions>.Instance.GetByID(vm.Project.ID); + feedBackMsg?.Invoke("椤圭洰鏇存柊鎴愬姛銆傘�傘��", Color.Green); } feedBackProgress?.Invoke(100, 10); - #endregion + #endregion 绗簩姝� 鍒涘缓椤圭洰锛堣繘搴� 10%锛� #region 绗笁姝� 璁剧疆鍦板浘浣嶇疆锛堣繘搴� 20%锛� - if (vm.MapInfo == null) + //宸叉湁鍦板浘淇℃伅鎵嶉渶瑕佽繘琛岃缃� + if (vm.MapInfo != null) { - feedBackMsg?.Invoke("姝e湪璁剧疆鍦板浘浣嶇疆...", Color.Black); - - if (vm.Location != null) + feedBackMsg?.Invoke("姝e湪璁剧疆浣嶇疆淇℃伅...", Color.Black); + vm.MapInfo.ObjectID = vm.Project.ID; + vm.MapInfo.ObjectName = vm.Project.Name; + if (vm.MapInfo.ID < 1) { - var mapInfo = new Yw.Vmo.MapInfoVmo(); - mapInfo.ObjectType = HStation.Xhs.DataType.XhsProject; - mapInfo.ObjectID = vm.ProjectID.Value; - mapInfo.ObjectName = vm.Project.Name; - mapInfo.Purpose = Yw.Map.Purpose.Location; - mapInfo.Kind = Yw.Map.Kind.Gaodei; - mapInfo.Shape = Yw.Map.Shape.Marker; - mapInfo.Position = vm.Location.ToJson(); - - var mapInfoId = await BLLFactory<Yw.BLL.MapInfo>.Instance.Insert(mapInfo); - if (mapInfoId < 1) + vm.MapInfo.ID = await BLLFactory<Yw.BLL.MapInfo>.Instance.Insert(vm.MapInfo); + if (vm.MapInfo.ID < 1) { - feedBackMsg?.Invoke("璁剧疆鍦板浘浣嶇疆澶辫触锛侊紒锛�", Color.Red); + feedBackMsg?.Invoke("浣嶇疆淇℃伅璁剧疆澶辫触锛侊紒锛�", Color.Red); } else { - vm.MapInfoID = mapInfoId; - vm.MapInfo = await BLLFactory<Yw.BLL.MapInfo>.Instance.GetByID(mapInfoId); - feedBackMsg?.Invoke("璁剧疆鍦板浘浣嶇疆鎴愬姛銆傘�傘��", Color.Green); + feedBackMsg?.Invoke("浣嶇疆淇℃伅璁剧疆鎴愬姛銆傘�傘��", Color.Green); } } else { - feedBackMsg?.Invoke("鏈缃湴鍥句綅缃俊鎭紒锛侊紒", Color.Red); + if (!await BLLFactory<Yw.BLL.MapInfo>.Instance.Update(vm.MapInfo)) + { + feedBackMsg?.Invoke("浣嶇疆淇℃伅璁剧疆澶辫触锛侊紒锛�", Color.Red); + } + else + { + feedBackMsg?.Invoke("浣嶇疆淇℃伅璁剧疆鎴愬姛銆傘�傘��", Color.Green); + } } + } + else + { + feedBackMsg?.Invoke("鏈缃綅缃俊鎭紒锛侊紒", Color.Red); } feedBackProgress?.Invoke(100, 20); - #endregion + #endregion 绗笁姝� 璁剧疆鍦板浘浣嶇疆锛堣繘搴� 20%锛� #region 绗洓姝� 鍘嬬缉鏂囦欢瑙f瀽 锛堣繘搴�30%锛� @@ -138,8 +130,7 @@ feedBackMsg?.Invoke("妯″瀷鏂囦欢涓嬭浇瀹屾垚锛侊紒锛�", Color.Green); } } - msg = "姝e湪瑙f瀽妯″瀷鏂囦欢..."; - feedBackMsg?.Invoke(msg, Color.Black); + feedBackMsg?.Invoke("姝e湪瑙f瀽妯″瀷鏂囦欢...", Color.Black); var bol = Yw.FileFolderZipHelper.UnZip(localZipFile, tempFolder, zipFilePwd); if (!bol) { @@ -163,7 +154,7 @@ feedBackProgress?.Invoke(100, 30); - #endregion + #endregion 绗洓姝� 鍘嬬缉鏂囦欢瑙f瀽 锛堣繘搴�30%锛� #region 绗簲姝� 瑙f瀽姘村姏缁撴瀯鏂囦欢 锛堣繘搴�40%锛� @@ -177,9 +168,8 @@ return true; } var structOthersFileInfo = allFileInfoList.Find(x => x.Name == HStation.Revit.ConstParas.StructOthersFileName); - var structRevitModel = HStation.Service.RevitParseHelper.FromJsonFile - (structFileInfo.FullName, structOthersFileInfo?.FullName, out bool structFileResult, out List<string> structFileMsgList); - vm.RevitModel = structRevitModel; + vm.RevitModel = HStation.Service.RevitParseHelper.FromJsonFile + (structFileInfo.FullName, structOthersFileInfo?.FullName, out bool structFileResult, out List<string> structFileMsgList); //瑙f瀽缁撴灉鍒ゆ柇 if (!structFileResult) { @@ -187,9 +177,9 @@ } //Revit灞炴�ч敊璇鐞� var hasRevitPropError = false; - if (structRevitModel != null) + if (vm.RevitModel != null) { - var allRevitParterList = structRevitModel.GetAllParters(); + var allRevitParterList = vm.RevitModel.GetAllParters(); foreach (var revitParter in allRevitParterList) { if (revitParter.PropStatusList != null && revitParter.PropStatusList.Count > 0) @@ -207,6 +197,7 @@ feedBackMsg?.Invoke($"鏋勪欢绫诲瀷锛歿revitParter.Catalog}锛屾瀯浠剁紪鐮侊細{revitParter.Id}锛屾瀯浠跺睘鎬э細{revitParterPropStatus.PropName}锛岄敊璇細{revitParterPropStatus.StatusInfo} ", Color.Red); } break; + default: break; } } @@ -221,8 +212,15 @@ return true; } - var hydroInfo = HStation.Hydro.TransferHelper.FromRevit(structRevitModel, out msg); - if (hydroInfo == null) + vm.HydroInfo = HStation.Hydro.TransferHelper.FromRevit + ( + vm.RevitModel, + out List<Yw.Model.HydroParterPropStatusInfo> allPropStatusDbList, + out List<Yw.Model.HydroParterScenePropValueInfo> allScenePropValueList, + out List<Yw.Model.HydroDecoratorInfo> allDecoratorList, + out msg + ); + if (vm.HydroInfo == null) { feedBackMsg?.Invoke($"姘村姏缁撴瀯鏂囦欢瑙f瀽澶辫触锛寋msg}锛侊紒锛�", Color.Red); feedBackMsg?.Invoke("椤圭洰瀵煎叆缁撴潫銆傘�傘��", Color.Blue); @@ -230,11 +228,13 @@ return true; } + var propStatusHelper = new HydroPropStatusHelper(vm.HydroInfo, allPropStatusDbList); + feedBackMsg?.Invoke("姝e湪杩涜浜у搧鍖归厤...", Color.Black); - var matchingParas = Yw.WinFrmUI.HydroMatchingHelper.Create(hydroInfo); + var matchingParas = Yw.WinFrmUI.HydroMatchingHelper.Create(vm.HydroInfo); if (AssetsMatchingHelper.Matching(matchingParas, out string error)) { - if (Yw.WinFrmUI.HydroMatchingHelper.Apply(hydroInfo, matchingParas)) + if (Yw.WinFrmUI.HydroMatchingHelper.Apply(vm.HydroInfo, matchingParas)) { feedBackMsg?.Invoke("浜у搧鍖归厤瀹屾垚銆傘�傘��", Color.Green); } @@ -248,18 +248,8 @@ feedBackMsg?.Invoke("浜у搧鍖归厤澶辫触锛侊紒锛�", Color.Red); } - feedBackMsg?.Invoke("姝e湪杩涜绠$綉淇...", Color.Black); - if (hydroInfo.RepairLinksDirection(out msg)) - { - feedBackMsg?.Invoke(msg, Color.Green); - } - else - { - feedBackMsg?.Invoke(msg, Color.Red); - } - feedBackMsg?.Invoke("姝e湪杩涜绠$綉鍙傛暟淇...", Color.Black); - hydroInfo.RepairParas(out msg); + vm.HydroInfo.RepairParas(propStatusHelper, out msg); if (string.IsNullOrEmpty(msg)) { feedBackMsg?.Invoke("绠$綉鍙傛暟淇瀹屾垚銆傘�傘��", Color.Green); @@ -270,8 +260,8 @@ } feedBackMsg?.Invoke("姝e湪淇濆瓨姘村姏缁撴瀯淇℃伅...", Color.Black); - var hydroId = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance.Save(hydroInfo); - if (hydroId < 1) + vm.HydroInfo.ID = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance.Save(vm.HydroInfo); + if (vm.HydroInfo.ID < 1) { feedBackMsg?.Invoke("姘村姏缁撴瀯淇℃伅淇濆瓨澶辫触锛侊紒锛�", Color.Red); feedBackMsg?.Invoke("椤圭洰瀵煎叆缁撴潫銆傘�傘��", Color.Blue); @@ -282,36 +272,54 @@ feedBackMsg?.Invoke("姘村姏缁撴瀯鏂囦欢瑙f瀽鎴愬姛銆傘�傘��", Color.Green); feedBackProgress?.Invoke(100, 40); - vm.HydroID = hydroId; + vm.HydroInfo = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance.GetByID(vm.HydroInfo.ID); - #endregion + //灞炴�х姸鎬� + if (allPropStatusDbList != null && allPropStatusDbList.Count > 0) + { + await BLLFactory<Yw.BLL.HydroParterPropStatusInfo>.Instance.Save(vm.HydroInfo.ID, allPropStatusDbList); + } + + //鍦烘櫙灞炴�� + if (allScenePropValueList != null && allScenePropValueList.Count > 0) + { + await BLLFactory<Yw.BLL.HydroParterScenePropValueInfo>.Instance.Save(vm.HydroInfo.ID, HStation.Revit.ConstParas.Scene, allScenePropValueList); + } + + //瑁呴グ浠� + if (allDecoratorList != null && allDecoratorList.Count > 0) + { + await BLLFactory<Yw.BLL.HydroDecoratorInfo>.Instance.Save(vm.HydroInfo.ID, HStation.Revit.ConstParas.Scene, allDecoratorList); + } + + #endregion 绗簲姝� 瑙f瀽姘村姏缁撴瀯鏂囦欢 锛堣繘搴�40%锛� #region 绗叚姝� 鍏宠仈姘村姏缁撴瀯妯″瀷锛堣繘搴� 50%锛� feedBackMsg?.Invoke("姝e湪鍏宠仈姘村姏缁撴瀯妯″瀷...", Color.Black); - var hydroRelation = new Yw.Vmo.HydroModelRelationVmo(); - hydroRelation.ObjectType = HStation.Xhs.DataType.XhsProjectSite; - hydroRelation.ObjectID = vm.ProjectSiteID.Value; - hydroRelation.ModelID = vm.HydroID.Value; - hydroRelation.Purpose = HStation.Xhs.Purpose.Simulation; - hydroRelation.Content = null; - hydroRelation.Description = null; + vm.HydroRelation = new Yw.Vmo.HydroModelRelationVmo(); + vm.HydroRelation.ObjectType = HStation.Xhs.DataType.XhsProjectSite; + vm.HydroRelation.ObjectID = vm.Project.SiteList.First().ID; + vm.HydroRelation.ModelID = vm.HydroInfo.ID; + vm.HydroRelation.Purpose = Yw.Hydro.Purpose.Simulation; + vm.HydroRelation.Content = null; + vm.HydroRelation.Description = "瀵煎叆鑷姩鐢熸垚"; - var hydroRelationId = await BLLFactory<Yw.BLL.HydroModelRelation>.Instance.Insert(hydroRelation); - if (hydroRelationId < 1) + vm.HydroRelation.ID = await BLLFactory<Yw.BLL.HydroModelRelation>.Instance.Insert(vm.HydroRelation); + if (vm.HydroRelation.ID < 1) { feedBackMsg?.Invoke("鍏宠仈姘村姏缁撴瀯妯″瀷澶辫触锛侊紒锛�", Color.Red); feedBackMsg?.Invoke("椤圭洰瀵煎叆缁撴潫銆傘�傘��", Color.Blue); feedBackProgress?.Invoke(100, 100); return true; } + vm.HydroRelation = await BLLFactory<Yw.BLL.HydroModelRelation>.Instance.GetByID(vm.HydroRelation.ID); - vm.HydroRelationID = hydroRelationId; feedBackMsg?.Invoke("鍏宠仈姘村姏缁撴瀯妯″瀷鎴愬姛銆傘�傘��", Color.Green); feedBackProgress?.Invoke(100, 50); - #endregion + #endregion 绗叚姝� 鍏宠仈姘村姏缁撴瀯妯″瀷锛堣繘搴� 50%锛� #region 绗竷姝� 涓婁紶Revit妯″瀷鏂囦欢锛堣繘搴� 60%锛� @@ -325,17 +333,8 @@ return true; } - //var bimfaceId = await Yw.WinFrmUI.BimfaceHelper.UploadFile(rvtFileInfo.FullName);//涓婁紶 - long bimfaceId = 0; - if (hydroInfo.Pumps.Count > 6) - { - bimfaceId = 10000894297457; - } - else - { - bimfaceId = 10000884893369; - } - //var bimfaceId = 10000894297457; //娴嬭瘯鐢ㄤ緥 10000884893369 10000894297457 + //var bimfaceId = await Yw.WinFrmUI.BimfaceHelper.UploadFile(rvtFileInfo.FullName);//姝e紡浠g爜 + var bimfaceId = 10000899666805;//娴嬭瘯鐢ㄤ緥 10000884893369 10000894297457 10000895957527 10000896316958 10000896755736 if (bimfaceId < 1) { feedBackMsg?.Invoke("Revit妯″瀷鏂囦欢涓婁紶澶辫触锛侊紒锛�", Color.Red); @@ -344,83 +343,90 @@ return true; } - vm.BimfaceId = bimfaceId; feedBackMsg?.Invoke("瑙f瀽Revit妯″瀷鏂囦欢鎴愬姛銆傘�傘��", Color.Green); feedBackProgress?.Invoke(100, 60); - #endregion + #endregion 绗竷姝� 涓婁紶Revit妯″瀷鏂囦欢锛堣繘搴� 60%锛� #region 绗叓姝� 淇濆瓨Bimface鏂囦欢 锛堣繘搴� 65%锛� feedBackMsg?.Invoke("姝e湪淇濆瓨Bimface鏂囦欢...", Color.Black); - var bimfaceFile = new Yw.Vmo.BimfaceFileVmo(); - bimfaceFile.BimfaceId = bimfaceId.ToString(); - bimfaceFile.Name = vm.Name; - bimfaceFile.ModelType = (int)Yw.Bimface.eModelType.File; - bimfaceFile.FileStatus = (int)Yw.Bimface.eFileStatus.UploadSucceed; - bimfaceFile.FormatType = (int)Yw.Bimface.eFormatType._3D; - bimfaceFile.FileSuffix = rvtFileInfo.Extension; - bimfaceFile.FileSize = string.Format("{0}MB", System.Math.Ceiling(rvtFileInfo.Length / 1024.0 / 1024.0)); + vm.BimfaceFile = new Yw.Vmo.BimfaceFileVmo(); + vm.BimfaceFile.BimfaceId = bimfaceId.ToString(); + vm.BimfaceFile.Name = vm.Project.Name; + vm.BimfaceFile.ModelType = (int)Yw.Bimface.eModelType.File; + vm.BimfaceFile.FileStatus = (int)Yw.Bimface.eFileStatus.UploadSucceed; + vm.BimfaceFile.FormatType = (int)Yw.Bimface.eFormatType._3D; + vm.BimfaceFile.FileSuffix = rvtFileInfo.Extension; + vm.BimfaceFile.FileSize = string.Format("{0}MB", System.Math.Ceiling(rvtFileInfo.Length / 1024.0 / 1024.0)); - var bimfaceFileId = await BLLFactory<Yw.BLL.BimfaceFile>.Instance.Insert(bimfaceFile); - if (bimfaceFileId < 1) + vm.BimfaceFile.ID = await BLLFactory<Yw.BLL.BimfaceFile>.Instance.Insert(vm.BimfaceFile); + if (vm.BimfaceFile.ID < 1) { feedBackMsg?.Invoke("Bimface鏂囦欢淇濆瓨澶辫触锛侊紒锛�", Color.Red); feedBackMsg?.Invoke("椤圭洰瀵煎叆缁撴潫銆傘�傘��", Color.Blue); feedBackProgress?.Invoke(100, 100); return true; } - - vm.BimfaceFileID = bimfaceFileId; + vm.BimfaceFile = await BLLFactory<Yw.BLL.BimfaceFile>.Instance.GetByID(vm.BimfaceFile.ID); feedBackMsg?.Invoke("Bimface鏂囦欢淇濆瓨鎴愬姛銆傘�傘��", Color.Green); feedBackProgress?.Invoke(100, 65); - #endregion + #endregion 绗叓姝� 淇濆瓨Bimface鏂囦欢 锛堣繘搴� 65%锛� #region 绗節姝� 鍏宠仈Bimface鏂囦欢锛堣繘搴� 70%锛� feedBackMsg?.Invoke("姝e湪鍏宠仈Bimface鏂囦欢...", Color.Black); - var bimfaceRelation = new Yw.Vmo.BimfaceFileRelationVmo(); - bimfaceRelation.ObjectType = HStation.Xhs.DataType.XhsProjectSite; - bimfaceRelation.ObjectID = vm.ProjectSiteID.Value; - bimfaceRelation.BimfaceFileID = bimfaceFileId; - bimfaceRelation.Purpose = HStation.Xhs.Purpose.Simulation; - bimfaceRelation.Description = vm.Description; + vm.BimfaceRelation = new Yw.Vmo.BimfaceFileRelationVmo(); + vm.BimfaceRelation.ObjectType = HStation.Xhs.DataType.XhsProjectSite; + vm.BimfaceRelation.ObjectID = vm.Project.SiteList.First().ID; + vm.BimfaceRelation.BimfaceFileID = vm.BimfaceFile.ID; + vm.BimfaceRelation.Purpose = Yw.Bimface.Purpose.Simulation; + vm.BimfaceRelation.Description = "瀵煎叆鑷姩鐢熸垚"; - var bimfaceRelationId = await BLLFactory<Yw.BLL.BimfaceFileRelation>.Instance.Insert(bimfaceRelation); - if (bimfaceRelationId < 1) + vm.BimfaceRelation.ID = await BLLFactory<Yw.BLL.BimfaceFileRelation>.Instance.Insert(vm.BimfaceRelation); + if (vm.BimfaceRelation.ID < 1) { feedBackMsg?.Invoke("Bimface鏂囦欢鍏宠仈澶辫触锛侊紒锛�", Color.Red); feedBackMsg?.Invoke("椤圭洰瀵煎叆缁撴潫銆傘�傘��", Color.Blue); feedBackProgress?.Invoke(100, 100); return true; } - vm.BimfaceFileRelationID = bimfaceRelationId; + vm.BimfaceRelation = await BLLFactory<Yw.BLL.BimfaceFileRelation>.Instance.GetByID(vm.BimfaceRelation.ID); feedBackMsg?.Invoke("Bimface鏂囦欢鍏宠仈鎴愬姛銆傘�傘��", Color.Green); feedBackProgress?.Invoke(100, 70); - #endregion + #endregion 绗節姝� 鍏宠仈Bimface鏂囦欢锛堣繘搴� 70%锛� - #region 绗崄姝� 鍙戣捣bimface杞崲锛堣繘搴� 90%锛� + #region 绗崄姝� 鍙戣捣妯″瀷杞崲锛堣繘搴� 90%锛� - feedBackMsg?.Invoke("姝e湪杩涜Bimface妯″瀷杞婚噺鍖�...", Color.Black); + feedBackProgress?.Invoke(100, 60); + feedBackMsg?.Invoke("姝e湪杩涜妯″瀷杞婚噺鍖�...", Color.Black); //var bimfaceTranslateStatus = await Yw.WinFrmUI.BimfaceHelper.TranslateRvtFile(bimfaceId);//鍙戣捣杞崲 var bimfaceTranslateStatus = Yw.BIMFace.eTranslateStatus.Processing;//娴嬭瘯浠g爜 - feedBackProgress?.Invoke(100, 60); + if (bimfaceTranslateStatus != Yw.BIMFace.eTranslateStatus.Success) { var dlgResult = XtraMessageBox.Show("Bimface妯″瀷杞婚噺鍖栭渶瑕佷竴瀹氱殑鏃堕棿锛屾槸鍚︾户缁瓑寰咃紵", "璇㈤棶", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dlgResult == DialogResult.Yes) { await Yw.WinFrmUI.BimfaceHelper.WaitFileTranslateStatusUntilSuccess(bimfaceId, 3000); - vm.BimfaceConverted = true; - feedBackMsg?.Invoke("Bimface妯″瀷杞婚噺鍖栧畬鎴愩�傘�傘��", Color.Green); + feedBackMsg?.Invoke("妯″瀷杞婚噺鍖栧畬鎴愩�傘�傘��", Color.Green); } else { - feedBackMsg?.Invoke("璺宠繃Bimface妯″瀷杞婚噺鍖栫瓑寰呫�傘�傘��", Color.Black); + bol = await BLLFactory<Yw.BLL.BimfaceFile>.Instance.UpdateFileStatus(vm.BimfaceFile.ID, (int)Yw.Bimface.eFileStatus.Converting); + if (bol) + { + vm.BimfaceFile.FileStatus = (int)Yw.Bimface.eFileStatus.Converting; + } + else + { + feedBackMsg?.Invoke("妯″瀷鏂囦欢鐘舵�佹洿鏂板け璐ワ紒锛侊紒", Color.Red); + } + feedBackMsg?.Invoke("璺宠繃妯″瀷杞婚噺鍖栫瓑寰呫�傘�傘��", Color.Black); feedBackMsg?.Invoke("椤圭洰瀵煎叆缁撴潫銆傘�傘��", Color.Blue); feedBackProgress?.Invoke(100, 100); return true; @@ -428,26 +434,26 @@ } else { - vm.BimfaceConverted = true; - feedBackMsg?.Invoke("Bimface妯″瀷杞婚噺鍖栧畬鎴愩�傘�傘��", Color.Green); + feedBackMsg?.Invoke("妯″瀷杞婚噺鍖栧畬鎴愩�傘�傘��", Color.Green); } feedBackProgress?.Invoke(100, 90); - #endregion + #endregion 绗崄姝� 鍙戣捣妯″瀷杞崲锛堣繘搴� 90%锛� - #region 绗崄涓�姝� 鏇存柊Bimface鏂囦欢鐘舵�侊紙杩涘害 100%锛� + #region 绗崄涓�姝� 鏇存柊妯″瀷鏂囦欢鐘舵�侊紙杩涘害 100%锛� - feedBackMsg?.Invoke("姝e湪鏇存柊Bimface鏂囦欢鐘舵��...", Color.Black); - bol = await BLLFactory<Yw.BLL.BimfaceFile>.Instance.UpdateFileStatus(bimfaceFileId, (int)Yw.Bimface.eFileStatus.ConvertSucceed); + feedBackMsg?.Invoke("姝e湪鏇存柊妯″瀷鏂囦欢鐘舵��...", Color.Black); + bol = await BLLFactory<Yw.BLL.BimfaceFile>.Instance.UpdateFileStatus(vm.BimfaceFile.ID, (int)Yw.Bimface.eFileStatus.ConvertSucceed); if (bol) { - feedBackMsg?.Invoke("Bimface鏂囦欢鐘舵�佹洿鏂版垚鍔熴�傘�傘��", Color.Green); + vm.BimfaceFile.FileStatus = (int)Yw.Bimface.eFileStatus.ConvertSucceed; + feedBackMsg?.Invoke("妯″瀷鏂囦欢鐘舵�佹洿鏂版垚鍔熴�傘�傘��", Color.Green); } else { - feedBackMsg?.Invoke("Bimface鏂囦欢鐘舵�佹洿鏂板け璐ワ紒锛侊紒", Color.Red); - feedBackMsg?.Invoke("椤圭洰瀵煎叆缁撴潫銆傘�傘��", Color.Black); + feedBackMsg?.Invoke("妯″瀷鏂囦欢鐘舵�佹洿鏂板け璐ワ紒锛侊紒", Color.Red); + feedBackMsg?.Invoke("椤圭洰瀵煎叆缁撴潫銆傘�傘��", Color.Blue); return true; } @@ -455,9 +461,7 @@ feedBackMsg?.Invoke("椤圭洰瀵煎叆瀹屾垚銆傘�傘��", Color.Green); return true; - #endregion + #endregion 绗崄涓�姝� 鏇存柊妯″瀷鏂囦欢鐘舵�侊紙杩涘害 100%锛� } - - } } \ No newline at end of file -- Gitblit v1.9.3