From ea882c1741812b0783b2924548cb9e8c638a1be9 Mon Sep 17 00:00:00 2001
From: duheng <2784771470@qq.com>
Date: 星期二, 24 十二月 2024 13:50:36 +0800
Subject: [PATCH] 修改资产--弯头

---
 Service/HStation.Service.Revit.Core/04-service/02-correct/RevitCorrectHelper.cs |   37 +++++++++++++++++++++++++++++++------
 1 files changed, 31 insertions(+), 6 deletions(-)

diff --git a/Service/HStation.Service.Revit.Core/04-service/02-correct/RevitCorrectHelper.cs b/Service/HStation.Service.Revit.Core/04-service/02-correct/RevitCorrectHelper.cs
index c7e71b6..d52d8cc 100644
--- a/Service/HStation.Service.Revit.Core/04-service/02-correct/RevitCorrectHelper.cs
+++ b/Service/HStation.Service.Revit.Core/04-service/02-correct/RevitCorrectHelper.cs
@@ -281,6 +281,19 @@
                     }
                 }
             }
+            if (rhs.Coolings != null && rhs.Coolings.Count > 0)
+            {//鍐峰嵈濉�
+                var coolingNameList = rhs.Coolings.Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name).Distinct().ToList();
+                foreach (var cooling in rhs.Coolings)
+                {
+                    if (string.IsNullOrEmpty(cooling.Name))
+                    {
+                        var coolingName = Yw.Untity.UniqueHelper.CreateFromFirst("鍐峰嵈濉�", coolingNameList);
+                        cooling.Name = coolingName;
+                        coolingNameList.Add(coolingName);
+                    }
+                }
+            }
             if (rhs.Meters != null && rhs.Meters.Count > 0)
             {//姘磋〃
                 var meterNameList = rhs.Meters.Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name).Distinct().ToList();
@@ -465,6 +478,7 @@
                             result = false;
                             continue;
                         }
+
                         var startJunction = new Model.RevitJunction();
                         startJunction.Id = Yw.Untity.UniqueHelper.CreateFromFirst("junction", allParterList.Select(x => x.Id).ToList());
                         startJunction.Name = UniqueHelper.CreateFromFirst("杩炴帴鑺傜偣", allParterList.Select(x => x.Name).Distinct().ToList());
@@ -475,8 +489,7 @@
                         startJunction.Elev = exchanger.Elev;
                         startJunction.Demand = null;
                         startJunction.DemandPattern = null;
-                        rhs.Junctions.Add(startJunction);
-                        exchanger.StartCode = startJunction.Id;
+
                         foreach (var startConnect in startConnectList)
                         {
                             var startConnectParter = allParterList.Find(x => x.Id == startConnect.Id);
@@ -490,9 +503,15 @@
                                 {
                                     revitLink.EndCode = startJunction.Id;
                                 }
+                                if (!rhs.Junctions.Exists(t => t.Id == startJunction.Id))
+                                {
+                                    rhs.Junctions.Add(startJunction);
+                                    exchanger.StartCode = startJunction.Id;
+                                    allParterList.Add(startJunction);
+                                }
                             }
                         }
-                        allParterList.Add(startJunction);
+
 
                         #endregion
 
@@ -513,6 +532,7 @@
                             result = false;
                             continue;
                         }
+
                         var endJunction = new Model.RevitJunction();
                         endJunction.Id = Yw.Untity.UniqueHelper.CreateFromFirst("junction", allParterList.Select(x => x.Id).ToList());
                         endJunction.Name = UniqueHelper.CreateFromFirst("杩炴帴鑺傜偣", allParterList.Select(x => x.Name).Distinct().ToList());
@@ -523,8 +543,7 @@
                         endJunction.Elev = exchanger.Elev;
                         endJunction.Demand = null;
                         endJunction.DemandPattern = null;
-                        rhs.Junctions.Add(endJunction);
-                        exchanger.EndCode = endJunction.Id;
+
                         foreach (var endConnect in endConnectList)
                         {
                             var endConnectParter = allParterList.Find(x => x.Id == endConnect.Id);
@@ -538,9 +557,15 @@
                                 {
                                     revitLink.EndCode = endJunction.Id;
                                 }
+                                if (!rhs.Junctions.Exists(t => t.Id == endJunction.Id))
+                                {
+                                    rhs.Junctions.Add(endJunction);
+                                    exchanger.EndCode = endJunction.Id;
+                                    allParterList.Add(endJunction);
+                                }
                             }
                         }
-                        allParterList.Add(endJunction);
+
 
                         #endregion
                     }

--
Gitblit v1.9.3