From eb64567d5da7d6a5c80b7579b486234b89b0e6ee Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期一, 25 十一月 2024 15:19:01 +0800
Subject: [PATCH] 包装完成标志

---
 Tiger.Business.MES/WorkAction/PrintInStoreLabel.cs |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/Tiger.Business.MES/WorkAction/PrintInStoreLabel.cs b/Tiger.Business.MES/WorkAction/PrintInStoreLabel.cs
index d370304..2eb4b6d 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 WipPkg CurPkg { get; set; }
         public bool NoNeedInStorePrint { get; set; }
         #endregion Propertys & Variables
 
@@ -67,6 +68,7 @@
         public ApiAction<SubmitOutput> TryBegin(SubmitInput input)
         {
             var action = new ApiAction<SubmitOutput>(new SubmitOutput());
+            CurPkg = CurPosition.Context.ContainsKey("CurPackage") ? CurPosition.Context["CurPackage"] as WipPkg : null;
 
             if (Label.IsNullOrEmpty())
             {
@@ -76,13 +78,14 @@
             {
 	            //璁剧疆鎵撳嵃鍙橀噺鍊�
 	            Label = CurPosition.SetLabelVariables(LabelPV, Label, this);
-	            if (CurPosition.Context.ContainsKey("CurPackage"))
+	            if (!CurPkg.IsNullOrEmpty())
 	            {
-	                (CurPosition.Context["CurPackage"] as WipPkg).InStoreLabel = Label;
+                    CurPkg.InStoreActID = NodeAct.ID;
+                    CurPkg.InStoreLabel = Label;
 	            }
 	
 	            //鍒ゆ柇鏄惁闇�瑕佹墦鍗板叆搴撴爣绛�
-	            NoNeedInStorePrint = (!CurPosition.Context.ContainsKey("CurPackage") || !(CurPosition.Context["CurPackage"] as WipPkg).IsFinished) 
+	            NoNeedInStorePrint = (CurPkg.IsNullOrEmpty() || !CurPkg.IsFinished) 
 	                                    || (CurPosition is YadaPacking && (CurPosition as YadaPacking).IsPrintCustomerLabel);
 	            if (NoNeedInStorePrint)
 	            {
@@ -176,8 +179,10 @@
                     PRD_CODE = wipSn.PRD_CODE,
                     ACT_TYPE = NodeAct.ACT_TYPE,
                     ACT_SN = wipSn.SN,
-                    ACT_VALUE_1 = Label?.LABEL_CODE,
-                    ACT_VALUE_2 = Label?.ToJson(),
+                    ACT_VALUE_1 = CurPkg?.IsFinished == true ? "Y" : "N",
+                    ACT_VALUE_2 = CurPkg?.ToJson(),
+                    ACT_VALUE_3 = Label?.ToJson(),
+                    ACT_VALUE_4 = "InStore",
                     ACT_RESULT = "Y",
                     ELAPSED_TIME = CurStep.GetElapsedTime().TotalMilliseconds.ToInt64(),
                     TRACE_INFO = NoNeedInStorePrint ? $"鏃犻渶鎵撳嵃鍏ュ簱鏍囩" : $"鏍囩{Label?.LABEL_NAME}[{Label?.LABEL_CODE}]鎵撳嵃鎴愬姛",

--
Gitblit v1.9.3