From f54adb8f368def21b9aa01e466b09bed6cd8347c Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期一, 02 十二月 2024 15:43:06 +0800
Subject: [PATCH] 修改并联模拟窗体

---
 Service/HStation.Service.Revit.Core/02-parter/00-core/RevitParter.cs |   69 ++++++++++++++++++++++++++++++----
 1 files changed, 60 insertions(+), 9 deletions(-)

diff --git a/Service/HStation.Service.Revit.Core/02-parter/00-core/RevitParter.cs b/Service/HStation.Service.Revit.Core/02-parter/00-core/RevitParter.cs
index f3ccd61..a0cbee2 100644
--- a/Service/HStation.Service.Revit.Core/02-parter/00-core/RevitParter.cs
+++ b/Service/HStation.Service.Revit.Core/02-parter/00-core/RevitParter.cs
@@ -3,7 +3,7 @@
     /// <summary>
     /// 缁勪欢
     /// </summary>
-    public class RevitParter
+    public abstract class RevitParter
     {
         /// <summary>
         /// 
@@ -16,42 +16,93 @@
         public RevitParter(Model.RevitParter rhs)
         {
             this.Id = rhs.Id;
+            this.Catalog = rhs.Catalog;
             this.Name = rhs.Name;
-            this.Code = rhs.Code;
+            this.ModelType = rhs.ModelType;
             this.Flags = rhs.Flags;
             this.Description = rhs.Description;
+
+            this.PropValueList = rhs.PropValueList?.Select(x => new RevitPropValue(x)).ToList();
+            this.PropStatusList = rhs.PropStatusList?.Select(x => new RevitPropStatus(x)).ToList();
         }
 
         /// <summary>
         /// Id
         /// </summary>
-        [JsonProperty("Id", NullValueHandling = NullValueHandling.Ignore)]
         public string Id { get; set; }
+
+        /// <summary>
+        /// 鍒嗙被
+        /// </summary>
+        public string Catalog { get; set; }
 
         /// <summary>
         /// 鍚嶇О
         /// </summary>	
-        [JsonProperty("鍚嶇О", NullValueHandling = NullValueHandling.Ignore)]
         public string Name { get; set; }
 
         /// <summary>
-        /// 缂栫爜
+        /// 鍨嬪彿
         /// </summary>
-        [JsonProperty("缂栫爜", NullValueHandling = NullValueHandling.Ignore)]
-        public string Code { get; set; }
+        public string ModelType { get; set; }
 
         /// <summary>
         /// 鏍囩
         /// </summary>
-        [JsonProperty("鏍囩", NullValueHandling = NullValueHandling.Ignore)]
         public List<string> Flags { get; set; }
 
         /// <summary>
         /// 璇存槑
         /// </summary>	
-        [JsonProperty("璇存槑淇℃伅", NullValueHandling = NullValueHandling.Ignore)]
         public string Description { get; set; }
 
+        /// <summary>
+        /// 灞炴�у�煎垪琛�
+        /// </summary>
+        public List<RevitPropValue> PropValueList { get; set; }
+
+        /// <summary>
+        /// 灞炴�х姸鎬佸垪琛�
+        /// </summary>
+        public List<RevitPropStatus> PropStatusList { get; set; }
+
+        /// <summary>
+        /// 鑾峰彇灞炴�у悕绉�
+        /// </summary>
+        public RevitPropStatus GetPropStatus(string propName)
+        {
+            if (string.IsNullOrEmpty(propName))
+            {
+                return default;
+            }
+            var propStatus = this.PropStatusList?.Find(x => x.PropName == propName);
+            return propStatus;
+        }
+
+        /// <summary>
+        /// 鏇存柊灞炴�х姸鎬�
+        /// </summary>
+        public bool UpdatePropStatus(string propName, ePropStatus propStatus, string statusInfo)
+        {
+            if (string.IsNullOrEmpty(propName))
+            {
+                return false;
+            }
+            if (this.PropStatusList == null)
+            {
+                this.PropStatusList = new List<Model.RevitPropStatus>();
+            }
+            var propStatusModel = this.GetPropStatus(propName);
+            if (propStatusModel == null)
+            {
+                propStatusModel = new Model.RevitPropStatus() { PropName = propName };
+                this.PropStatusList.Add(propStatusModel);
+            }
+            propStatusModel.PropStatus = propStatus;
+            propStatusModel.StatusInfo = statusInfo;
+            return true;
+        }
+
 
     }
 }

--
Gitblit v1.9.3