From 94f78e8c3fa502bc52eba2b88d45d5813609036c Mon Sep 17 00:00:00 2001
From: Rodney Chen <rodney.chen@hotmail.com>
Date: 星期五, 13 九月 2024 10:26:48 +0800
Subject: [PATCH] 优化工单缓存对象更新逻辑

---
 Tiger.Business.MES/WorkAction/PackingAction.cs |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/Tiger.Business.MES/WorkAction/PackingAction.cs b/Tiger.Business.MES/WorkAction/PackingAction.cs
index 516ce14..f5bbfbd 100644
--- a/Tiger.Business.MES/WorkAction/PackingAction.cs
+++ b/Tiger.Business.MES/WorkAction/PackingAction.cs
@@ -31,6 +31,7 @@
         public Dictionary<int, BAS_LABEL_TEMP> LabelDic { get; set; }    = new();
         public List<BAS_LABEL_PV> LabelPV { get; set; } = new();
         public int FinishLevel = 0;
+        private bool IsManually => CurStep.IsNullOrEmpty();
         #endregion Propertys & Variables
 
         #region Functions
@@ -330,7 +331,7 @@
                         if (!pInput.WeightInfo.IsNullOrEmpty() && pInput.WeightInfo.Weight > 0)
                         {
                             //楠岃瘉閲嶉噺鏁版嵁鏄惁绗﹀悎璁剧疆濂界殑閲嶉噺鑼冨洿
-                            if (!PkgProd.IsNullOrEmpty() && (pInput.WeightInfo.Weight < PkgProd.MIN_WEIGHT || PkgProd.MAX_WEIGHT < pInput.WeightInfo.Weight))
+                            if (!PkgProd.IsNullOrEmpty() && ((pInput.WeightInfo.Weight < PkgProd.MIN_WEIGHT && !IsManually) || PkgProd.MAX_WEIGHT < pInput.WeightInfo.Weight))
                             {
                                 action.IsSuccessed = false;
                                 CurStep?.SetStatusMessage(StepStatus.Error, Biz.L("閲嶉噺瓒呴檺"));
@@ -617,7 +618,7 @@
                         CurPkgItem = curItem;
 
                         //娣诲姞鏄庣粏鍚庡垽鏂綋鍓嶅寘瑁呭眰绾х殑鏄庣粏鏁伴噺鏄惁绛変簬鍖呰鏁伴噺锛岃嫢鐩哥瓑鍒欐爣璁板綋鍓嶅寘瑁呭眰绾т负瀹屾垚骞跺皾璇曟墦鍗版爣绛�
-                        if (CurPkgItem.Items.Count(q => q.IsFinished) == CurPkgItem.PKG_QTY || CurStep.IsNullOrEmpty())
+                        if (CurPkgItem.Items.Count(q => q.IsFinished) == CurPkgItem.PKG_QTY || IsManually)
                         {
                             //鎵撳嵃鍓嶇О閲嶏細濡傛灉褰撳墠鐨勫寘瑁呮槑缁嗙殑涓婁竴灞傚寘瑁呭璞℃槸鏈�澶栧眰鍖呰涓旈渶瑕佺О閲嶆椂锛屽厛绉伴噸锛屽悎鏍煎悗鍦ㄥ彂鍗版垨鑰呮壂鎻忔渶澶栧眰鍖呰鏍囩
                             if (CurPkgItem.PKG_LEVEL == CurPkg.Item.PKG_LEVEL && CurPkg.NeedWeighing)
@@ -729,7 +730,7 @@
             action.LocaleMsg = new("MES.WorkAction.PackingAction.PackageComplete", CurPkg.Item.PKG_LEVEL, CurPkg.Item.PKG_NAME);
 
             //鎵嬪姩缁撴潫鍖呰鍒欐爣璁拌涓哄畬鎴�
-            //if (CurStep.IsNullOrEmpty())
+            //if (IsManually)
             //{
             //    IsFinished = true;
             //}
@@ -753,7 +754,7 @@
             }
             
             //涓嶆槸鎵嬪姩缁撴潫鍖呰鍒欎繚瀛樿涓烘搷浣滆褰�
-            if (!CurStep.IsNullOrEmpty())
+            if (!IsManually)
             {
                 //璁板綍琛屼负鎿嶄綔璁板綍
                 var wipActs = new List<MES_WIP_ACT>();

--
Gitblit v1.9.3