Shuxia Ning
2025-01-15 9eb94e9eec2e2e164698e34d0481d66093c8655b
WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs
@@ -1,10 +1,4 @@
using 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,7 +37,7 @@
            feedBackProgress?.Invoke(100, 5);
            #endregion
            #endregion 第一步 临时文件处理(进度5%)
            #region 第二步 创建项目(进度 10%)
@@ -80,7 +74,7 @@
            feedBackProgress?.Invoke(100, 10);
            #endregion
            #endregion 第二步 创建项目(进度 10%)
            #region 第三步 设置地图位置(进度 20%)
@@ -121,7 +115,7 @@
            feedBackProgress?.Invoke(100, 20);
            #endregion
            #endregion 第三步 设置地图位置(进度 20%)
            #region 第四步 压缩文件解析 (进度30%)
@@ -160,7 +154,7 @@
            feedBackProgress?.Invoke(100, 30);
            #endregion
            #endregion 第四步 压缩文件解析 (进度30%)
            #region 第五步 解析水力结构文件 (进度40%)
@@ -203,6 +197,7 @@
                                        feedBackMsg?.Invoke($"构件类型:{revitParter.Catalog},构件编码:{revitParter.Id},构件属性:{revitParterPropStatus.PropName},错误:{revitParterPropStatus.StatusInfo} ", Color.Red);
                                    }
                                    break;
                                default: break;
                            }
                        }
@@ -218,7 +213,13 @@
            }
            vm.HydroInfo = HStation.Hydro.TransferHelper.FromRevit
                (vm.RevitModel, out List<Yw.Model.HydroParterScenePropValueInfo> allScenePropValueInfo, out List<Yw.Model.HydroDecoratorInfo> allDecoratorList, out msg);
                (
                    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($"水力结构文件解析失败,{msg}!!!", Color.Red);
@@ -226,6 +227,8 @@
                feedBackProgress?.Invoke(100, 100);
                return true;
            }
            var propStatusHelper = new HydroPropStatusHelper(vm.HydroInfo, allPropStatusDbList);
            feedBackMsg?.Invoke("正在进行产品匹配...", Color.Black);
            var matchingParas = Yw.WinFrmUI.HydroMatchingHelper.Create(vm.HydroInfo);
@@ -246,7 +249,7 @@
            }
            feedBackMsg?.Invoke("正在进行管网参数修复...", Color.Black);
            vm.HydroInfo.RepairParas(out msg);
            vm.HydroInfo.RepairParas(propStatusHelper, out msg);
            if (string.IsNullOrEmpty(msg))
            {
                feedBackMsg?.Invoke("管网参数修复完成。。。", Color.Green);
@@ -271,11 +274,25 @@
            feedBackProgress?.Invoke(100, 40);
            vm.HydroInfo = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance.GetByID(vm.HydroInfo.ID);
            //属性状态
            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
            #endregion 第五步 解析水力结构文件 (进度40%)
            #region 第六步 关联水力结构模型(进度 50%)
@@ -302,7 +319,7 @@
            feedBackMsg?.Invoke("关联水力结构模型成功。。。", Color.Green);
            feedBackProgress?.Invoke(100, 50);
            #endregion
            #endregion 第六步 关联水力结构模型(进度 50%)
            #region 第七步 上传Revit模型文件(进度 60%)
@@ -317,7 +334,7 @@
            }
            //var bimfaceId = await Yw.WinFrmUI.BimfaceHelper.UploadFile(rvtFileInfo.FullName);//正式代码
            var bimfaceId = 10000896316958;//测试用例  10000884893369  10000894297457  10000895957527  10000896316958
            var bimfaceId = 10000899666805;//测试用例  10000884893369  10000894297457  10000895957527  10000896316958 10000896755736
            if (bimfaceId < 1)
            {
                feedBackMsg?.Invoke("Revit模型文件上传失败!!!", Color.Red);
@@ -329,7 +346,7 @@
            feedBackMsg?.Invoke("解析Revit模型文件成功。。。", Color.Green);
            feedBackProgress?.Invoke(100, 60);
            #endregion
            #endregion 第七步 上传Revit模型文件(进度 60%)
            #region 第八步 保存Bimface文件 (进度 65%)
@@ -356,7 +373,7 @@
            feedBackMsg?.Invoke("Bimface文件保存成功。。。", Color.Green);
            feedBackProgress?.Invoke(100, 65);
            #endregion
            #endregion 第八步 保存Bimface文件 (进度 65%)
            #region 第九步 关联Bimface文件(进度 70%)
@@ -381,7 +398,7 @@
            feedBackMsg?.Invoke("Bimface文件关联成功。。。", Color.Green);
            feedBackProgress?.Invoke(100, 70);
            #endregion
            #endregion 第九步 关联Bimface文件(进度 70%)
            #region 第十步 发起模型转换(进度 90%)
@@ -422,7 +439,7 @@
            feedBackProgress?.Invoke(100, 90);
            #endregion
            #endregion 第十步 发起模型转换(进度 90%)
            #region 第十一步 更新模型文件状态(进度 100%)
@@ -444,9 +461,7 @@
            feedBackMsg?.Invoke("项目导入完成。。。", Color.Green);
            return true;
            #endregion
            #endregion 第十一步 更新模型文件状态(进度 100%)
        }
    }
}