From 76e99e160320c9d612feb0861fc9e2b0075172e9 Mon Sep 17 00:00:00 2001
From: Rodney Chen <rodney.chen@hotmail.com>
Date: 星期五, 25 十月 2024 19:32:29 +0800
Subject: [PATCH] 删除PackingNode多余逻辑

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

diff --git a/Tiger.Business.MES/WorkAction/PackingAction.cs b/Tiger.Business.MES/WorkAction/PackingAction.cs
index b16ca05..d0cf4fb 100644
--- a/Tiger.Business.MES/WorkAction/PackingAction.cs
+++ b/Tiger.Business.MES/WorkAction/PackingAction.cs
@@ -6,6 +6,7 @@
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using Tiger.Business.MES.Transaction;
 using Tiger.IBusiness;
 using Tiger.IBusiness.MES.WorkAction;
 using Tiger.Model;
@@ -228,6 +229,7 @@
                 data.ExecCode = "Print";
                 data.PkgLevel = min.PKG_LEVEL;
                 data.PrintLable = LabelDic[min.PKG_LEVEL];
+                data.RealPrint = data.PkgLevel != CurPkg.Item.PKG_LEVEL || CurPosition is not YadaPacking || (CurPosition as YadaPacking).IsPrintCustomerLabel;
                 CurCmd = data;
                 PrintTimes++;
                 CurStep?.SetStatusMessage(StepStatus.Normal, Biz.L("鎵撳嵃鏍囩"));
@@ -396,6 +398,7 @@
                                     data.ExecCode = "Print";
                                     data.PkgLevel = dtl.PKG_LEVEL;
                                     data.PrintLable = LabelDic[dtl.PKG_LEVEL];
+                                    data.RealPrint = data.PkgLevel != CurPkg.Item.PKG_LEVEL || CurPosition is not YadaPacking || (CurPosition as YadaPacking).IsPrintCustomerLabel;
                                     CurCmd = data;
                                     PrintTimes++;
                                     CurStep?.SetStatusMessage(StepStatus.Normal, Biz.L("鎵撳嵃鏍囩"));
@@ -493,6 +496,7 @@
                             data.ExecCode = "Print";
                             data.PkgLevel = dtl.PKG_LEVEL;
                             data.PrintLable = LabelDic[dtl.PKG_LEVEL];
+                            data.RealPrint = data.PkgLevel != CurPkg.Item.PKG_LEVEL || CurPosition is not YadaPacking || (CurPosition as YadaPacking).IsPrintCustomerLabel;
                             CurCmd = data;
                             PrintTimes++;
                             CurStep?.SetStatusMessage(StepStatus.Normal, Biz.L("鎵撳嵃鏍囩"));
@@ -712,6 +716,7 @@
                                     data.ExecCode = "Print";
                                     data.PkgLevel = dtl.PKG_LEVEL;
                                     data.PrintLable = LabelDic[dtl.PKG_LEVEL];
+                                    data.RealPrint = data.PkgLevel != CurPkg.Item.PKG_LEVEL || CurPosition is not YadaPacking || (CurPosition as YadaPacking).IsPrintCustomerLabel;
                                     CurCmd = data;
                                     PrintTimes++;
                                     CurStep?.SetStatusMessage(StepStatus.Normal, Biz.L("鎵撳嵃鏍囩"));
@@ -856,6 +861,9 @@
                         ACT_TYPE = NodeAct.ACT_TYPE,
                         ACT_SN = wipSn.SN,
                         ACT_RESULT = "Y",
+                        ACT_VALUE_1 = CurPkg.IsFinished ? "Y" : "N",
+                        ACT_VALUE_2 = CurPkg.ToJson(),
+                        ACT_VALUE_3 = CurPkg.IsFinished ? LabelDic[CurPkg.Item.PKG_LEVEL].ToJson() : "",
                         ELAPSED_TIME = CurStep.GetElapsedTime().TotalMilliseconds.ToInt64(),
                         TRACE_INFO = $"浜у搧鏉$爜[{string.Join("锛�", CurPosition.CurSN)}]鍖呰瀹屾垚",
                     };
@@ -914,7 +922,7 @@
             {
                 if (CurPkg.IsFinished)
                 {
-                    var _pkgList = CurPosition.GetPackageList(CurPkg.Item);
+                    var _pkgList = CurPosition.GetPackageList(CurPkg.Item).Clone();
 
                     //鏈�澶栧眰鍖呰宸茬粡瀹屾垚鍖呰锛屽垯鎶婂伐搴忎腑鏆傚瓨鏍囪璁句负false锛岀粺涓�鎻愪氦鍖呰鍐呬骇鍝佺殑杩囩珯璁板綍
                     CurPosition.NeedTemporaryStoreDBCommitAction = false;
@@ -926,9 +934,9 @@
                         {
                             db.Storageable(_pkgList, CurPosition.UserCode).ExecuteCommand();
                             var wipIDs = _pkgList.Where(q => !q.WIP_ID.IsNullOrEmpty()).Select(q => q.WIP_ID).ToList();
-                            var nodeID = _pkgList.First().NODE_ID;
-                            var actID = _pkgList.First().ACT_ID;
-                            var wo = _pkgList.First().WORK_ORDER;
+                            var nodeID = _pkgList.First(q => !q.WIP_ID.IsNullOrEmpty()).NODE_ID;
+                            var actID = _pkgList.First(q => !q.WIP_ID.IsNullOrEmpty()).ACT_ID;
+                            var wo = _pkgList.First(q => !q.WIP_ID.IsNullOrEmpty()).WORK_ORDER;
                             //鍖呰淇℃伅淇濆瓨鍒板湪鍒跺搧淇℃伅琛�
                             db.Updateable<MES_WIP_DATA>()
                                 .SetColumns(q => q.TRAY_SN == CurPkg.Item.Package.SN)

--
Gitblit v1.9.3