From 0295f0d93a3dd54bb6104f5e9a488f94596e756b Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期六, 26 十月 2024 00:37:00 +0800
Subject: [PATCH] Merge branch 'master' of http://47.115.28.255:8110/r/TigerClouds-Tech/Server/TigerApi6_2024

---
 Tiger.Business.MES/WorkAction/PrintInStoreLabel.cs |   32 +++++++++++++++++++++-----------
 1 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/Tiger.Business.MES/WorkAction/PrintInStoreLabel.cs b/Tiger.Business.MES/WorkAction/PrintInStoreLabel.cs
index 545a495..84c318f 100644
--- a/Tiger.Business.MES/WorkAction/PrintInStoreLabel.cs
+++ b/Tiger.Business.MES/WorkAction/PrintInStoreLabel.cs
@@ -25,6 +25,7 @@
         #endregion
         public BAS_LABEL_TEMP Label { get; set; }
         public List<BAS_LABEL_PV> LabelPV { get; set; }
+        public bool NoNeedInStorePrint { get; set; }
         #endregion Propertys & Variables
 
         #region Functions
@@ -67,7 +68,9 @@
         {
             var action = new ApiAction<SubmitOutput>(new SubmitOutput());
 
-            if (CurPosition is YadaPacking && !(CurPosition as YadaPacking).IsPrintCustomerLabel)
+            NoNeedInStorePrint = (!CurPosition.Context.ContainsKey("CurPackage") || !(CurPosition.Context["CurPackage"] as WipPkg).IsFinished) 
+                                    || (CurPosition is YadaPacking && (CurPosition as YadaPacking).IsPrintCustomerLabel);
+            if (NoNeedInStorePrint)
             {
                 action = End(input);
             } 
@@ -164,12 +167,8 @@
                     ACT_VALUE_2 = Label.Variables.ToJson(),
                     ACT_RESULT = "Y",
                     ELAPSED_TIME = CurStep.GetElapsedTime().TotalMilliseconds.ToInt64(),
-                    TRACE_INFO = $"鏍囩{Label.LABEL_NAME}[{Label.LABEL_CODE}]鎵撳嵃鎴愬姛",
+                    TRACE_INFO = NoNeedInStorePrint ? $"鏃犻渶鎵撳嵃鍏ュ簱鏍囩" : $"鏍囩{Label.LABEL_NAME}[{Label.LABEL_CODE}]鎵撳嵃鎴愬姛",
                 };
-                if (CurPosition is YadaPacking && !(CurPosition as YadaPacking).IsPrintCustomerLabel)
-                {
-                    wipAct.TRACE_INFO = $"鏃犻渶鎵撳嵃鍏ュ簱鏍囩";
-                }
                 wipActs.Add(wipAct);
             }
 
@@ -183,11 +182,22 @@
             };
 
             IsFinished = true;
-            CurStep.Message = Biz.L("鎵撳嵃瀹屾垚");
-            CurStep.Status = StepStatus.Finished;
-            action.Data.ShortMsg = new("鎵撳嵃瀹屾垚", ShortMessage.Types.Success);
-            //action.LocaleMsg = new($"鍏ュ簱鏍囩{Label.LABEL_NAME}[{Label.LABEL_CODE}]鎵撳嵃鎴愬姛", Label.LABEL_NAME);
-            action.LocaleMsg = new("MES.WorkAction.PrintInStoreLabel.PrintSuccess", Label.LABEL_NAME, Label.LABEL_CODE);
+            if (NoNeedInStorePrint)
+            {
+                CurStep.Message = Biz.L("鏃犻渶鎵撳嵃");
+                CurStep.Status = StepStatus.Finished;
+                action.Data.ShortMsg = new("鏃犻渶鎵撳嵃", ShortMessage.Types.Success);
+                //action.LocaleMsg = new($"鏃犻渶鎵撳嵃鍏ュ簱鏍囩{0}[{1}]");
+                action.LocaleMsg = new("MES.WorkAction.PrintInStoreLabel.NoNeedPrint", Label.LABEL_NAME, Label.LABEL_CODE);
+            } 
+            else
+            {
+	            CurStep.Message = Biz.L("鎵撳嵃瀹屾垚");
+	            CurStep.Status = StepStatus.Finished;
+	            action.Data.ShortMsg = new("鎵撳嵃瀹屾垚", ShortMessage.Types.Success);
+                //action.LocaleMsg = new($"鍏ュ簱鏍囩{0}[{1}鎵撳嵃鎴愬姛");
+                action.LocaleMsg = new("MES.WorkAction.PrintInStoreLabel.PrintSuccess", Label.LABEL_NAME, Label.LABEL_CODE);
+            }
             return action;
         }
 

--
Gitblit v1.9.3