From 545bc1c267a939cf3259afcda1ba60feedd7e7eb Mon Sep 17 00:00:00 2001
From: Rodney Chen <rodney.chen@hotmail.com>
Date: 星期五, 11 十月 2024 20:15:25 +0800
Subject: [PATCH] 更新工序自动更新工单状态

---
 Tiger.Business.MES/WorkAction/ThreeInOne.cs |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/Tiger.Business.MES/WorkAction/ThreeInOne.cs b/Tiger.Business.MES/WorkAction/ThreeInOne.cs
index a20e632..b2ca033 100644
--- a/Tiger.Business.MES/WorkAction/ThreeInOne.cs
+++ b/Tiger.Business.MES/WorkAction/ThreeInOne.cs
@@ -286,7 +286,7 @@
                 action.LocaleMsg = new("MES.WorkAction.ThreeInOne.NotSameCustomer", CustCSN.CUST_SN, CustCSN.CUST_CODE, CurPosition.WorkBatch.WO.CUST_CODE);
             }
             //楠岃瘉浜у搧瀹㈡埛鏍囩鏉$爜瑙勫垯
-            if (!CustInfo.RULE_CODE.IsNullOrEmpty() && !Biz.CodeRule[CustInfo.RULE_CODE].IsNullOrEmpty())
+            if (!CustInfo.IsNullOrEmpty() && !CustInfo.RULE_CODE.IsNullOrEmpty() && !Biz.CodeRule[CustInfo.RULE_CODE].IsNullOrEmpty())
             {
                 var result = Biz.CodeRule[CustInfo.RULE_CODE].Verify(CustCSN.CUST_SN);
                 if (!result.IsSuccessed)
@@ -326,8 +326,8 @@
 
             //鏇存柊鍘傚唴娴佺▼鐮�
             FlowCSN.CUST_CODE = CurPosition.WorkBatch.WO.CUST_CODE;
-            FlowCSN.WORK_ORDER = CurPosition.WorkBatch.WO.ORDER_NO;
-            FlowCSN.ITEM_CODE = CurPosition.WorkBatch.WO.ITEM_CODE;
+            FlowCSN.PKG_ORDER = CurPosition.WorkBatch.WO.ORDER_NO;
+            FlowCSN.PROD_CODE = CurPosition.WorkBatch.WO.ITEM_CODE;
 
             //璁板綍琛屼负鎿嶄綔璁板綍
             var wipActs = new List<MES_WIP_ACT>();
@@ -378,9 +378,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.Variables.ToJson(),
+                    ACT_VALUE_1 = Label?.LABEL_CODE,
+                    ACT_VALUE_2 = Label?.Variables.ToJson(),
                     ACT_RESULT = "Y",
+                    ELAPSED_TIME = CurStep.GetElapsedTime().TotalMilliseconds.ToInt64(),
                     TRACE_INFO = $"鍘傚唴鏉$爜[{FlowCSN.FLOW_SN}]缁戝畾瀹㈡埛鏉$爜[{FlowCSN.CUST_SN}]鎴愬姛",
                 };
                 wipActs.Add(wipAct);

--
Gitblit v1.9.3