From 43a0207d207390abdeeb3ab9155eebf03edd7b1a Mon Sep 17 00:00:00 2001
From: chr <chr@mailcom>
Date: 星期一, 21 四月 2025 09:28:01 +0800
Subject: [PATCH] 优化;

---
 PdmSwPlugin.Common/Entity/Pdm/PdmBom.cs |  118 +++++++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 90 insertions(+), 28 deletions(-)

diff --git a/PdmSwPlugin.Common/Entity/Pdm/PdmBom.cs b/PdmSwPlugin.Common/Entity/Pdm/PdmBom.cs
index 7cddf17..fa86893 100644
--- a/PdmSwPlugin.Common/Entity/Pdm/PdmBom.cs
+++ b/PdmSwPlugin.Common/Entity/Pdm/PdmBom.cs
@@ -85,6 +85,14 @@
             set => RaiseAndSetIfChanged(ref _status, value);
         }
 
+        private bool? _inKeeDeeDb;
+
+        public bool? inKeeDeeDb
+        {
+            get => _inKeeDeeDb;
+            set => RaiseAndSetIfChanged(ref _inKeeDeeDb, value);
+        }
+
         private string _auditId;
         public string auditId
         {
@@ -116,6 +124,26 @@
     /// </summary>
     public class DrawInfo : NotifyBase
     {
+        /// <summary>
+        /// true璇存槑娌℃湁宸ョ▼鍥�
+        /// </summary>
+        public bool _noDrw = false;
+
+        public bool noDrw
+        {
+            get => _noDrw;
+            set => RaiseAndSetIfChanged(ref _noDrw, value);
+        }
+
+        public bool _inKeeDeeDb = false;
+
+        private bool _isSpecial;
+        public bool isSpecial
+        {
+            get => _isSpecial;
+            set => RaiseAndSetIfChanged(ref _isSpecial, value);
+        }
+
         /// <summary>
         /// 3Dmd5
         /// </summary>
@@ -169,6 +197,10 @@
         public List<string> errMessages { get; set; }
 
         public Dictionary<string, string> allProperties { get; set; }
+
+        /// <summary>
+        /// 涓篢rue璇存槑娌℃湁宸ョ▼鍥�
+        /// </summary>
     }
 
     [Serializable]
@@ -197,6 +229,11 @@
             set => RaiseAndSetIfChanged(ref _treeId, value);
         }
 
+        /// <summary>
+        /// true璇存槑娌℃湁宸ョ▼鍥�
+        /// </summary>
+        public bool noDrw => (_drawInfo?.noDrw == true);
+
         public string id => BomInfo?.id;
         public string name => BomInfo?.name;
         public string partNo => BomInfo?.partNo;
@@ -222,10 +259,6 @@
         public string checkUserId => BomInfo?.checkUserId;
         public string checkUserName => BomInfo?.checkUserName;
 
-        #region 瑙勫垯妫�鏌ョ浉鍏冲瓧娈�
-
-        #endregion
-
         #region 鍥剧焊瀹℃牳鐩稿叧瀛楁
         public string drawStatus => BomInfo?.status;
         public string requestUserId => BomInfo?.requestUserId;
@@ -244,8 +277,15 @@
         /// <summary>
         /// 鍥剧焊鏄惁鍙戠敓鍙樻洿 闈炲巻鍙插浘绾哥湅2D鍥綧D5 鍘嗗彶鍥剧焊鐪嬩竴鑷存�ф鏌ユ病閫氳繃
         /// </summary>
-        public bool localDocChanged => (!IsHistoryData && localD2Md5 != _drawInfo?.d2Md5)
-            || (IsHistoryData && _drawInfo?.checkRuleResult == 2); //localD3Md5 != _drawInfo?.d3Md5;
+        public bool localDocChanged
+        {
+            get
+            {
+                //if (!IsHistoryData) return localD2Md5 != _drawInfo?.d2Md5; //(!IsHistoryData && localD2Md5 != _drawInfo?.d2Md5)
+                //return (IsHistoryData && _drawInfo?.checkRuleResult == 2);
+                return false;
+            }
+        }
         /// <summary>
         /// 瑙勫垯妫�鏌ョ粨鏋�
         /// </summary>
@@ -277,24 +317,31 @@
             {
                 // 鎵句笉鍒版枃妗g殑涓嶅鏍�
                 if (lost) return false;
-                // 涓嶅湪鐗╂枡鏄庣粏琛ㄤ腑涓嶅鏍�
-                if (ExcludeFromBOM) return false;
-                // 妯$粍涓嶅鏍�
-                if (produceWay == "妯$粍") return false;
+                // 璺宠繃妫�鏌ョ殑涓嶅
+                if (skipCheck) return false;
+                // 杩涘叆绯荤粺鐨勪笉瀹℃牳
+                if (BomInfo.inKeeDeeDb == true) return false;
+                // 涓嶅湪BOM鏄庣粏琛ㄤ腑涓嶆彁浜�
+                if (component.ExcludeFromBOM) return false;
+                //if (_drawInfo.isSpecial) return false;
                 // 寰呭鏍哥殑涓嶉噸澶嶆彁浜�
                 if (drawStatus == "submitted" || drawStatus == "resubmitted") return false;
-                if (IsHistoryData)
-                {
-                    // 鍘嗗彶鍥剧焊鍙鏍镐竴鑷存�т笉閫氳繃鐨� 鍜岃椹冲洖鐨�
-                    return _drawInfo.checkRuleResult == 2 || drawStatus == "rejected";
-                }
-                else
-                {
-                    // 闈炲巻鍙插浘绾稿彧瀹℃牳 鍏佽瀹℃牳鐨勫姞宸ヤ欢
-                    return produceWay == "鍔犲伐浠�"
-                            && (drawStatus != "submitted" && drawStatus != "resubmitted")
-                            && (drawStatus != "completed" || localDocChanged);
-                }
+                return produceWay == "鍔犲伐浠�" && (drawStatus != "submitted" && drawStatus != "resubmitted")
+                            && (drawStatus != "completed");
+
+                /// 浠ュ墠杩樿鍒嗗浘绾稿彉鏇达紝鐜板湪涓嶅紕浜�
+                //if (IsHistoryData)
+                //{
+                //    // 鍘嗗彶鍥剧焊鍙鏍镐竴鑷存�т笉閫氳繃鐨� 鍜岃椹冲洖鐨�
+                //    return _drawInfo.checkRuleResult == 2 || drawStatus == "rejected";
+                //}
+                //else
+                //{
+                //    // 闈炲巻鍙插浘绾稿彧瀹℃牳 鍏佽瀹℃牳鐨勫姞宸ヤ欢
+                //    return produceWay == "鍔犲伐浠�"
+                //            && (drawStatus != "submitted" && drawStatus != "resubmitted")
+                //            && (drawStatus != "completed" || localDocChanged);
+                //}
             }
         }
 
@@ -304,18 +351,23 @@
         /// <returns></returns>
         public string NeedStopCheckIn()
         {
-            if (produceWay == "妯$粍") return null;
-            if (ExcludeFromBOM) return null;
+            if (skipCheck) return null;
+            /// 2025-03-12 淇敼閲戣澏鎻掍欢鎷︽埅闂
+            if (produceWay == "鏍囧噯浠�") return null;
+            if (drawInfo.isSpecial) return null;
+            /// 2025-03-12 淇敼閲戣澏鎻掍欢鎷︽埅闂 END
+
+            if (BomInfo.inKeeDeeDb == true) return null;
             if (IsHistoryData)
             {
                 bool err = false;
                 string msg = $"鍘嗗彶鍥剧焊銆恵partModel}銆�";
-                if (localDocChanged)
+                if (localDocChanged && !noDrw)
                 {
                     err = true;
                     msg += "鍙樻洿鍚庢湭閲嶆柊瀹℃牳;";
                 }
-                else if (drawStatus == "rejected" || drawStatus == "submitted" || drawStatus == "resubmitted")
+                if ((drawStatus == "rejected" || drawStatus == "submitted" || drawStatus == "resubmitted") && BomInfo.inKeeDeeDb != true)
                 {
                     err = true;
                     msg += "鏈�氳繃瀹℃牳";
@@ -325,6 +377,11 @@
                 {
                     err = true;
                     msg += "琚殣钘�;";
+                }
+                if (noDrw)
+                {
+                    err = true;
+                    msg += "鏈壘鍒板伐绋嬪浘";
                 }
                 return err ? msg : null;
             }
@@ -342,16 +399,21 @@
                     error = true;
                     msg += "琚殣钘�;";
                 }
-                if (produceWay == "鍔犲伐浠�" && drawStatus != "completed")
+                if (produceWay == "鍔犲伐浠�" && drawStatus != "completed" && BomInfo.inKeeDeeDb != true)
                 {
                     error = true;
                     msg += "鏈�氳繃瀹℃牳;";
                 }
-                if (produceWay == "鍔犲伐浠�" && drawStatus == "completed" && localDocChanged)
+                if (produceWay == "鍔犲伐浠�" && drawStatus == "completed" && localDocChanged && !noDrw)
                 {
                     error = true;
                     msg += "鍥剧焊鍙樻洿鍚庢湭閲嶆柊瀹℃牳";
                 }
+                if (noDrw)
+                {
+                    error = true;
+                    msg += "鏈壘鍒板伐绋嬪浘";
+                }
                 return error ? msg : null;
             }
             return null;

--
Gitblit v1.9.1