From a8ccc992964272f6a74631e8c164e8c91e5cb6d4 Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期六, 12 十月 2024 16:47:29 +0800
Subject: [PATCH] 处理冲突

---
 WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs |   94 ++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 77 insertions(+), 17 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 d1eefab..0f9ca13 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
@@ -41,7 +41,7 @@
 
             feedBackProgress?.Invoke(100, 5);
 
-            #endregion
+            #endregion 绗竴姝� 涓存椂鏂囦欢澶勭悊锛堣繘搴�5%锛�
 
             #region 绗簩姝� 鍒涘缓椤圭洰锛堣繘搴� 10%锛�
 
@@ -77,7 +77,7 @@
 
             feedBackProgress?.Invoke(100, 10);
 
-            #endregion
+            #endregion 绗簩姝� 鍒涘缓椤圭洰锛堣繘搴� 10%锛�
 
             #region 绗笁姝� 璁剧疆鍦板浘浣嶇疆锛堣繘搴� 20%锛�
 
@@ -112,7 +112,7 @@
 
             feedBackProgress?.Invoke(100, 20);
 
-            #endregion
+            #endregion 绗笁姝� 璁剧疆鍦板浘浣嶇疆锛堣繘搴� 20%锛�
 
             #region 绗洓姝� 鍘嬬缉鏂囦欢瑙f瀽 锛堣繘搴�25%锛�
 
@@ -139,12 +139,11 @@
                 return true;
             }
 
-
             feedBackMsg?.Invoke("妯″瀷鏂囦欢瑙f瀽鎴愬姛銆傘�傘��", Color.Green);
 
             feedBackProgress?.Invoke(100, 25);
 
-            #endregion
+            #endregion 绗洓姝� 鍘嬬缉鏂囦欢瑙f瀽 锛堣繘搴�25%锛�
 
             #region 绗簲姝� 瑙f瀽姘村姏缁撴瀯鏂囦欢 锛堣繘搴�30%锛�
 
@@ -157,11 +156,56 @@
                 feedBackProgress?.Invoke(100, 100);
                 return true;
             }
+            var structOthersFileInfo = allFileInfoList.Find(x => x.Name == HStation.Revit.ConstParas.StructOthersFileName);
 
-            var structRevitModel = HStation.Service.RevitParseHelper.FromJsonFile(structFileInfo.FullName, out msg);
+            var structRevitModel = HStation.Service.RevitParseHelper.FromJsonFile(structFileInfo.FullName, structOthersFileInfo?.FullName, out msg);
             if (structRevitModel == null)
             {
                 feedBackMsg?.Invoke($"{msg}锛侊紒锛�", Color.Red);
+                feedBackMsg?.Invoke("椤圭洰瀵煎叆缁撴潫銆傘�傘��", Color.Blue);
+                feedBackProgress?.Invoke(100, 100);
+                return true;
+            }
+
+            //Revit 灞炴�ч敊璇鐞�
+            var hasRevitError = false;
+            var allRevitParterList = structRevitModel.GetAllParters();
+            foreach (var revitParter in allRevitParterList)
+            {
+                if (revitParter.PropStatusList != null && revitParter.PropStatusList.Count > 0)
+                {
+                    foreach (var revitParterPropStatus in revitParter.PropStatusList)
+                    {
+                        if (revitParterPropStatus.PropStatus == HStation.Revit.ePropStatus.Error)
+                        {
+                            hasRevitError = true;
+                        }
+                        switch (revitParterPropStatus.PropStatus)
+                        {
+                            case Revit.ePropStatus.Error:
+                                {
+                                    feedBackMsg?.Invoke($"鏋勪欢缂栫爜锛歿revitParter.Code}锛屾瀯浠跺睘鎬э細{revitParterPropStatus.PropName}锛岄敊璇細{revitParterPropStatus.StatusInfo} ", Color.Red);
+                                }
+                                break;
+
+                            case Revit.ePropStatus.Lack:
+                                {
+                                    feedBackMsg?.Invoke($"鏋勪欢缂栫爜锛歿revitParter.Code}锛屾瀯浠跺睘鎬э細{revitParterPropStatus.PropName}锛岀己鐪侊細{revitParterPropStatus.StatusInfo} ", Color.Gray);
+                                }
+                                break;
+
+                            case Revit.ePropStatus.Abnormal:
+                                {
+                                    feedBackMsg?.Invoke($"鏋勪欢缂栫爜锛歿revitParter.Code}锛屾瀯浠跺睘鎬э細{revitParterPropStatus.PropName}锛屽紓甯革細{revitParterPropStatus.StatusInfo} ", Color.Orange);
+                                }
+                                break;
+                        }
+                    }
+                }
+            }
+            if (hasRevitError)
+            {
+                feedBackMsg?.Invoke($"姘村姏缁撴瀯鏂囦欢灞炴�ч敊璇紒锛侊紒", Color.Red);
                 feedBackMsg?.Invoke("椤圭洰瀵煎叆缁撴潫銆傘�傘��", Color.Blue);
                 feedBackProgress?.Invoke(100, 100);
                 return true;
@@ -185,11 +229,31 @@
                 return true;
             }
 
+            feedBackMsg?.Invoke("姝e湪杩涜浜у搧鍖归厤...", Color.Black);
+            hydroInfo = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance.GetByID(hydroId);
+            var matchingParas = AssetsMatchingParasHelper.Create(hydroInfo);
+            if (AssetsMatchingHelper.Matching(matchingParas, out string error))
+            {
+                if (AssetsMatchingParasHelper.Apply(hydroInfo, matchingParas))
+                {
+                    feedBackMsg?.Invoke("浜у搧鍖归厤鎴愬姛銆傘�傘��", Color.Green);
+                }
+                else
+                {
+                    feedBackMsg?.Invoke("浜у搧鍖归厤澶辫触锛侊紒锛�", Color.Red);
+                }
+            }
+            else
+            {
+                feedBackMsg?.Invoke("浜у搧鍖归厤澶辫触锛侊紒锛�", Color.Red);
+            }
+            hydroId = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance.Save(hydroInfo);
+
             feedBackMsg?.Invoke("姘村姏缁撴瀯鏂囦欢瑙f瀽鎴愬姛銆傘�傘��", Color.Green);
             feedBackProgress?.Invoke(100, 30);
             vm.HydroID = hydroId;
 
-            #endregion
+            #endregion 绗簲姝� 瑙f瀽姘村姏缁撴瀯鏂囦欢 锛堣繘搴�30%锛�
 
             #region 绗叚姝� 鍏宠仈姘村姏缁撴瀯妯″瀷锛堣繘搴� 40%锛�
 
@@ -224,12 +288,11 @@
                 return true;
             }
 
-
             vm.HydroRelationID = hydroRelationId;
             feedBackMsg?.Invoke("鍏宠仈姘村姏缁撴瀯妯″瀷鎴愬姛銆傘�傘��", Color.Green);
             feedBackProgress?.Invoke(100, 40);
 
-            #endregion 
+            #endregion 绗叚姝� 鍏宠仈姘村姏缁撴瀯妯″瀷锛堣繘搴� 40%锛�
 
             #region 绗竷姝� 涓婁紶Revit妯″瀷鏂囦欢锛堣繘搴� 45%锛�
 
@@ -257,7 +320,7 @@
             feedBackMsg?.Invoke("瑙f瀽Revit妯″瀷鏂囦欢鎴愬姛銆傘�傘��", Color.Green);
             feedBackProgress?.Invoke(100, 45);
 
-            #endregion
+            #endregion 绗竷姝� 涓婁紶Revit妯″瀷鏂囦欢锛堣繘搴� 45%锛�
 
             #region 绗叓姝� 淇濆瓨Bimface鏂囦欢 锛堣繘搴� 50%锛�
 
@@ -285,7 +348,7 @@
             feedBackMsg?.Invoke("Bimface鏂囦欢淇濆瓨鎴愬姛銆傘�傘��", Color.Green);
             feedBackProgress?.Invoke(100, 50);
 
-            #endregion
+            #endregion 绗叓姝� 淇濆瓨Bimface鏂囦欢 锛堣繘搴� 50%锛�
 
             #region 绗節姝� 鍏宠仈Bimface鏂囦欢锛堣繘搴� 55%锛�
 
@@ -310,7 +373,7 @@
             feedBackMsg?.Invoke("Bimface鏂囦欢鍏宠仈鎴愬姛銆傘�傘��", Color.Green);
             feedBackProgress?.Invoke(100, 55);
 
-            #endregion
+            #endregion 绗節姝� 鍏宠仈Bimface鏂囦欢锛堣繘搴� 55%锛�
 
             #region 绗崄姝� 鍙戣捣bimface杞崲锛堣繘搴� 80%锛�
 
@@ -343,7 +406,7 @@
 
             feedBackProgress?.Invoke(100, 80);
 
-            #endregion
+            #endregion 绗崄姝� 鍙戣捣bimface杞崲锛堣繘搴� 80%锛�
 
             #region 绗崄涓�姝� 鏇存柊Bimface鏂囦欢鐘舵�侊紙杩涘害 100%锛�
 
@@ -364,10 +427,7 @@
             feedBackMsg?.Invoke("椤圭洰瀵煎叆瀹屾垚銆傘�傘��", Color.Green);
             return true;
 
-            #endregion
-
+            #endregion 绗崄涓�姝� 鏇存柊Bimface鏂囦欢鐘舵�侊紙杩涘害 100%锛�
         }
-
-
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3