From b5234c5ab1e9e6826b8d8fc1e95fa752aaa40b74 Mon Sep 17 00:00:00 2001 From: chr <chr@mailcom> Date: 星期六, 02 十一月 2024 10:56:50 +0800 Subject: [PATCH] 优化程序 --- PdmSwPlugin.Common/Entity/Pdm/PdmBom.cs | 36 ++++++++++++++++++++++++++++++------ 1 files changed, 30 insertions(+), 6 deletions(-) diff --git a/PdmSwPlugin.Common/Entity/Pdm/PdmBom.cs b/PdmSwPlugin.Common/Entity/Pdm/PdmBom.cs index d8f53e0..7cddf17 100644 --- a/PdmSwPlugin.Common/Entity/Pdm/PdmBom.cs +++ b/PdmSwPlugin.Common/Entity/Pdm/PdmBom.cs @@ -43,6 +43,7 @@ public Component2 component { get; set; } public bool lost { get; set; } = false; + public bool isHidden { get; set; } = false; public bool suppressed { get; set; } = false; public bool lightWeight { get; set; } = false; @@ -147,6 +148,8 @@ private int? _checkRuleResult = 0; + public bool isHidden; + public int? checkRuleResult { get => _checkRuleResult; @@ -204,7 +207,10 @@ public Dictionary<string, string> properties => BomInfo?.properties; public string d3FilePath => BomInfo?.d3FilePath; public string filePath => BomInfo?.filePath; - public bool lost => BomInfo?.lost == true; + public bool lost => BomInfo?.lost == true || isHidden; + + public bool isHidden = false; + public bool suppressed => BomInfo?.suppressed == true; public bool lightWeight => BomInfo?.lightWeight == true; @@ -243,7 +249,7 @@ /// <summary> /// 瑙勫垯妫�鏌ョ粨鏋� /// </summary> - public int? checkRuleResult => (IsHistoryData || skipCheck) ? 3 : _drawInfo?.checkRuleResult; + public int? checkRuleResult => (IsHistoryData || skipCheck) ? 3 : (isHidden ? 2 : _drawInfo?.checkRuleResult); /// <summary> /// 妫�鏌ユ槸鍚K /// </summary> @@ -260,6 +266,8 @@ } } + public List<string> ErrorMsgs; + /// <summary> /// 鏄惁闇�瑕佸鏍� /// </summary> @@ -273,7 +281,7 @@ if (ExcludeFromBOM) return false; // 妯$粍涓嶅鏍� if (produceWay == "妯$粍") return false; - // 寰呭鏍哥殑涓嶅啿绐佹彁浜� + // 寰呭鏍哥殑涓嶉噸澶嶆彁浜� if (drawStatus == "submitted" || drawStatus == "resubmitted") return false; if (IsHistoryData) { @@ -300,14 +308,25 @@ if (ExcludeFromBOM) return null; if (IsHistoryData) { + bool err = false; + string msg = $"鍘嗗彶鍥剧焊銆恵partModel}銆�"; if (localDocChanged) { - return $"鍘嗗彶鍥剧焊銆恵partModel}銆戝彉鏇村悗鏈噸鏂板鏍�"; + err = true; + msg += "鍙樻洿鍚庢湭閲嶆柊瀹℃牳;"; } else if (drawStatus == "rejected" || drawStatus == "submitted" || drawStatus == "resubmitted") { - return $"鍘嗗彶鍥剧焊銆恵partModel}銆戞湭閫氳繃瀹℃牳"; + err = true; + msg += "鏈�氳繃瀹℃牳"; } + + if (isHidden) + { + err = true; + msg += "琚殣钘�;"; + } + return err ? msg : null; } if (!IsHistoryData) { @@ -316,7 +335,12 @@ if (!skipCheck && !checkRuleOk) { error = true; - msg += "鏈�氳繃瑙勫垯妫�鏌�"; + msg += "鏈�氳繃瑙勫垯妫�鏌�;"; + } + if (!skipCheck && isHidden) + { + error = true; + msg += "琚殣钘�;"; } if (produceWay == "鍔犲伐浠�" && drawStatus != "completed") { -- Gitblit v1.9.1