Shuxia Ning
2024-10-29 0d9526152334f26c9110dab0652796f59a185820
WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs
@@ -42,7 +42,7 @@
            feedBackProgress?.Invoke(100, 5);
            #endregion 第一步 临时文件处理(进度5%)
            #endregion
            #region 第二步 创建项目(进度 10%)
@@ -78,7 +78,7 @@
            feedBackProgress?.Invoke(100, 10);
            #endregion 第二步 创建项目(进度 10%)
            #endregion
            #region 第三步 设置地图位置(进度 20%)
@@ -113,15 +113,24 @@
            feedBackProgress?.Invoke(100, 20);
            #endregion 第三步 设置地图位置(进度 20%)
            #endregion
            #region 第四步 压缩文件解析 (进度25%)
            msg = "正在解析模型文件...";
            feedBackMsg?.Invoke(msg, Color.Black);
            #region 第四步 压缩文件解析 (进度30%)
            var zipFilePwd = HStation.Settings.XhsParasHelper.Xhs.File.Password;
            var bol = Yw.FileFolderZipHelper.UnZip(vm.ZipFile, tempFolder, zipFilePwd);
            var localZipFile = vm.LocalZipFile;
            if (!vm.IsLocal)
            {
                if (vm.TransferRevitFile != null)
                {
                    feedBackMsg?.Invoke("正在下载模型文件...", Color.Black);
                    localZipFile = await BLLFactory<HStation.BLL.TransferRevitFile>.Instance.Download(vm.TransferRevitFile.StorageHouse, vm.TransferRevitFile.StorageCode);
                    feedBackMsg?.Invoke("模型文件下载完成!!!", Color.Green);
                }
            }
            msg = "正在解析模型文件...";
            feedBackMsg?.Invoke(msg, Color.Black);
            var bol = Yw.FileFolderZipHelper.UnZip(localZipFile, tempFolder, zipFilePwd);
            if (!bol)
            {
                feedBackMsg?.Invoke("模型文件解析失败!!!", Color.Red);
@@ -142,11 +151,11 @@
            feedBackMsg?.Invoke("模型文件解析成功。。。", Color.Green);
            feedBackProgress?.Invoke(100, 25);
            feedBackProgress?.Invoke(100, 30);
            #endregion 第四步 压缩文件解析 (进度25%)
            #endregion
            #region 第五步 解析水力结构文件 (进度30%)
            #region 第五步 解析水力结构文件 (进度40%)
            feedBackMsg?.Invoke("正在解析水力结构文件...", Color.Black);
            var structFileInfo = allFileInfoList.Find(x => x.Name == HStation.Revit.ConstParas.StructFileName);
@@ -255,12 +264,12 @@
            hydroId = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance.Save(hydroInfo);
            feedBackMsg?.Invoke("水力结构文件解析成功。。。", Color.Green);
            feedBackProgress?.Invoke(100, 30);
            feedBackProgress?.Invoke(100, 40);
            vm.HydroID = hydroId;
            #endregion 第五步 解析水力结构文件 (进度30%)
            #endregion
            #region 第六步 关联水力结构模型(进度 40%)
            #region 第六步 关联水力结构模型(进度 50%)
            var projectSite = await BLLFactory<HStation.BLL.XhsProjectSite>.Instance.GetDefaultByProjectID(projectId);
            if (projectSite == null)
@@ -295,11 +304,11 @@
            vm.HydroRelationID = hydroRelationId;
            feedBackMsg?.Invoke("关联水力结构模型成功。。。", Color.Green);
            feedBackProgress?.Invoke(100, 40);
            feedBackProgress?.Invoke(100, 50);
            #endregion 第六步 关联水力结构模型(进度 40%)
            #endregion
            #region 第七步 上传Revit模型文件(进度 45%)
            #region 第七步 上传Revit模型文件(进度 60%)
            feedBackMsg?.Invoke("正在解析Revit模型文件...", Color.Black);
            var rvtFileInfo = allFileInfoList.Find(x => x.Name == HStation.Revit.ConstParas.RvtFileName);
@@ -323,11 +332,11 @@
            vm.BimfaceId = bimfaceId;
            feedBackMsg?.Invoke("解析Revit模型文件成功。。。", Color.Green);
            feedBackProgress?.Invoke(100, 45);
            feedBackProgress?.Invoke(100, 60);
            #endregion 第七步 上传Revit模型文件(进度 45%)
            #endregion
            #region 第八步 保存Bimface文件 (进度 50%)
            #region 第八步 保存Bimface文件 (进度 65%)
            feedBackMsg?.Invoke("正在保存Bimface文件...", Color.Black);
@@ -351,11 +360,11 @@
            vm.BimfaceFileID = bimfaceFileId;
            feedBackMsg?.Invoke("Bimface文件保存成功。。。", Color.Green);
            feedBackProgress?.Invoke(100, 50);
            feedBackProgress?.Invoke(100, 65);
            #endregion 第八步 保存Bimface文件 (进度 50%)
            #endregion
            #region 第九步 关联Bimface文件(进度 55%)
            #region 第九步 关联Bimface文件(进度 70%)
            feedBackMsg?.Invoke("正在关联Bimface文件...", Color.Black);
@@ -376,11 +385,11 @@
            }
            vm.BimfaceFileRelationID = bimfaceRelationId;
            feedBackMsg?.Invoke("Bimface文件关联成功。。。", Color.Green);
            feedBackProgress?.Invoke(100, 55);
            feedBackProgress?.Invoke(100, 70);
            #endregion 第九步 关联Bimface文件(进度 55%)
            #endregion
            #region 第十步 发起bimface转换(进度 80%)
            #region 第十步 发起bimface转换(进度 90%)
            feedBackMsg?.Invoke("正在进行Bimface模型轻量化...", Color.Black);
            //var bimfaceTranslateStatus = await Yw.WinFrmUI.BimfaceHelper.TranslateRvtFile(bimfaceId);//发起转换
@@ -409,9 +418,9 @@
                feedBackMsg?.Invoke("Bimface模型轻量化完成。。。", Color.Green);
            }
            feedBackProgress?.Invoke(100, 80);
            feedBackProgress?.Invoke(100, 90);
            #endregion 第十步 发起bimface转换(进度 80%)
            #endregion
            #region 第十一步 更新Bimface文件状态(进度 100%)
@@ -432,7 +441,7 @@
            feedBackMsg?.Invoke("项目导入完成。。。", Color.Green);
            return true;
            #endregion 第十一步 更新Bimface文件状态(进度 100%)
            #endregion
        }
    }
}