From 7502a974e86933df025fa939159f0046ede69396 Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期五, 13 九月 2024 15:09:06 +0800
Subject: [PATCH] 一些更改

---
 Tiger.Business.MES/Transaction/PackingNode.cs |   26 +++++++++++++++++++-------
 1 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/Tiger.Business.MES/Transaction/PackingNode.cs b/Tiger.Business.MES/Transaction/PackingNode.cs
index 96f3392..a178562 100644
--- a/Tiger.Business.MES/Transaction/PackingNode.cs
+++ b/Tiger.Business.MES/Transaction/PackingNode.cs
@@ -63,14 +63,15 @@
                 else
                 {
                     NodeCmd = "NodeSubmit";
-                    //鏇存柊CurBatch
-                    CurBatch = WoContext.GetBatch(CurBatch?.OrderNo, CurLine.LINE_CODE);
                     //宸ユ鍒楄〃涓虹┖鎴栬�呭伐搴忚妭鐐瑰伐姝ユ湁鏈畬鎴愭椂锛屼紭鍏堝畬鎴愬伐搴忚妭鐐瑰伐姝�
                     if (Steps.IsNullOrEmpty() || !IsFinishNodeSteps)
                     {
                         //鍏堝垽鏂綋鍓嶅伐鍗曚笉涓虹┖涓斿綋鍓嶅矖浣嶅湪褰撳墠宸ュ崟鏄笉鏄绔欙紝濡傛灉鏄垯涓嶅厑璁稿彉鏇村綋鍓嶅伐鍗曪紝灏濊瘯鎶婃潯鐮佺粦瀹氬埌褰撳墠宸ュ崟
                         if (!CurBatch.IsNullOrEmpty() && CurBatch.IsFirstNode(PostCode))
                         {
+                            //鏇存柊CurBatch
+                            CurBatch?.Update();
+                            //鎻愪氦鏁版嵁
                             action = NodeSubmit(action, input);
                             //鏇存柊宸ュ簭淇℃伅
                             if (!action.IsSuccessed)
@@ -134,8 +135,10 @@
 	                                        return action;
 	                                    }
 	                                }
-	                                //鏉$爜杩囩珯
-	                                action = NodeSubmit(action, input);
+                                    //鏇存柊CurBatch
+                                    CurBatch?.Update();
+                                    //鏉$爜杩囩珯
+                                    action = NodeSubmit(action, input);
                                     if (!action.IsSuccessed && !CurWipSNs.Any())
                                     {
                                         var info = WoContext.GetSnOperInfo(input.SN).Data;
@@ -175,6 +178,9 @@
                     //瀹屾垚宸ュ簭鑺傜偣宸ユ鍚庯紝鍚庡紑濮嬫墽琛屽綋鍓嶅伐搴忕殑琛屼负宸ユ
                     else if (IsFinishNodeSteps && !IsFinishAllSteps)
                     {
+                        //鏇存柊CurBatch
+                        CurBatch?.Update();
+
                         var submitStep = Steps.Where(q => q.ID == input.CurStepID && !q.IsFinished).FirstOrDefault();
                         if (submitStep.IsNullOrEmpty())
                         {
@@ -254,8 +260,8 @@
                     woStatus.Data.ShortMsg = new("宸ュ崟寮傚父", ShortMessage.Types.Error);
                     return woStatus;
                 }
-                
-                var wipSNs = Biz.Db.Queryable<MES_WIP_DATA>().IncludesAllFirstLayer().Where(q => (q.SN == input.SN || q.TRAY_SN == input.SN) && q.WORK_ORDER == CurBatch.WO.ORDER_NO).ToList();
+
+                var wipSNs = Biz.Db.Queryable<MES_WIP_DATA>().IncludesAllFirstLayer().Where(q => q.SN == input.SN || q.FLOW_SN == input.SN || q.TRAY_SN == input.SN).ToList();
                 if (wipSNs.IsNullOrEmpty())
                 {
 	                var wipSN = new MES_WIP_DATA()
@@ -583,7 +589,7 @@
         /// 鍖呰宸ュ簭锛氭墜鍔ㄧ粨鏉熷寘瑁�
         /// </summary>
         /// <returns></returns>
-        public async Task<ApiAction<SubmitOutput>> CompletePkg()
+        public async Task<ApiAction<SubmitOutput>> CompletePkg(ApiAction input)
         {
             var action = new ApiAction<SubmitOutput>(new SubmitOutput());
             try
@@ -593,6 +599,12 @@
                 {
                     if (Context.ContainsKey("CurPackage"))
                     {
+                        int shipQty = input.Data.ToInt32();
+                        //鏈夊~鍑鸿揣鏁伴噺鍒欓獙璇佸綋鍓嶅寘瑁呮暟閲忓繀椤荤瓑浜庯紙鍑鸿揣鏁伴噺/鍖呰瑙勫垯鏁伴噺锛夌殑浣欐暟
+                        if (shipQty > 0)
+                        {
+
+                        }
                         NodeCmd = "PkgSubmit";
 
                         TempPkgAction = new PackingAction();

--
Gitblit v1.9.3