From 31c6d37a388e80719a3575717917fcf9689a1a93 Mon Sep 17 00:00:00 2001
From: Rodney Chen <rodney.chen@hotmail.com>
Date: 星期三, 09 十月 2024 16:06:10 +0800
Subject: [PATCH] 修复工序设置没有错误字段的bug

---
 Tiger.Business.MES/Transaction/CollectNode.cs |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/Tiger.Business.MES/Transaction/CollectNode.cs b/Tiger.Business.MES/Transaction/CollectNode.cs
index 4849f9a..803d01b 100644
--- a/Tiger.Business.MES/Transaction/CollectNode.cs
+++ b/Tiger.Business.MES/Transaction/CollectNode.cs
@@ -210,6 +210,7 @@
         public ApiAction<SubmitOutput> NodeSubmit(ApiAction<SubmitOutput> action, SubmitInput input)
         {
             var curNode = CurBatch.GetNode(PostCode);
+            var curNodeSetting = CurBatch.GetNodeSetting(curNode);
             try
             {
                 //宸ュ簭鑺傜偣閫昏緫澧炲姞濡傛灉鏍瑰熀褰撳墠宀椾綅鎵句笉鍒板搴斿伐搴忕殑鏃跺�欒鎶ラ敊
@@ -226,7 +227,7 @@
                 {
                     BeginAt = DateTime.Now;
                     //鍒ゆ柇宸ュ崟瀹炴椂鐘舵�佸垽鏂槸鍚﹀彲浠ョ敓浜�
-                    var woStatus = CurBatch.CheckCanProduce(curNode);
+                    var woStatus = CurBatch.CheckCanProduce(curNode, curNodeSetting);
                     if (!woStatus.IsSuccessed)
                     {
                         woStatus.Data.ShortMsg = new("宸ュ崟寮傚父", ShortMessage.Types.Error);
@@ -337,7 +338,7 @@
                             wipSN.PRD_CODE = curShiftPeriod.Period.PRD_CODE;
                         }
                         //濡傛灉鏄姇鍏ョ珯
-                        if (curNode.IS_INPUT == "Y")
+                        if (curNodeSetting.IS_INPUT == "Y")
                         {
                             var woSN = woSNs.First(q => q.SN == wipSN.SN);
                             woSN.STATUS = BIZ_MES_WO_SN.STATUSs.Inputed.GetValue();
@@ -345,7 +346,7 @@
                             wipSN.INLINE_DATE = DateTime.Now;
                         }
                         //濡傛灉鏄骇鍑虹珯
-                        if (curNode.IS_OUTPUT == "Y")
+                        if (curNodeSetting.IS_OUTPUT == "Y")
                         {
                             var woSN = woSNs.First(q => q.SN == wipSN.SN);
                             woSN.STATUS = BIZ_MES_WO_SN.STATUSs.Finished.GetValue();
@@ -417,7 +418,7 @@
                     var _wipSns = wipSNs.Clone();
                     var _wipHiss = CurWipSNHiss.Clone();
                     var _defect = CurDefects.Clone();
-                    var _curNode = curNode.Clone();
+                    var _curNodeSetting = curNodeSetting.Clone();
                     var _Batch = CurBatch.Batch.Clone();
 
                     //鍒濆鍖栧伐姝ュ垪琛�
@@ -442,13 +443,13 @@
                                 db.Storageable(_defect, UserCode).ExecuteCommand();
                             }
                             //濡傛灉鏄姇鍏ョ珯
-                            if (_curNode.IS_INPUT == "Y")
+                            if (_curNodeSetting.IS_INPUT == "Y")
                             {
                                 db.Updateable<BIZ_MES_WO>().SetColumns(q => q.INPUT_QTY == q.INPUT_QTY + _woSns.Count).Where(q => q.ORDER_NO == _Batch.ORDER_NO).ExecuteCommand();
                                 db.Updateable<BIZ_MES_WO_BATCH>().SetColumns(q => q.INPUT_QTY == q.INPUT_QTY + _woSns.Count).Where(q => q.BATCH_NO == _Batch.BATCH_NO).ExecuteCommand();
                             }
                             //濡傛灉鏄骇鍑虹珯
-                            if (_curNode.IS_OUTPUT == "Y")
+                            if (_curNodeSetting.IS_OUTPUT == "Y")
                             {
                                 db.Updateable<BIZ_MES_WO>().SetColumns(q => q.OUTPUT_QTY == q.OUTPUT_QTY + _woSns.Count).Where(q => q.ORDER_NO == _Batch.ORDER_NO).ExecuteCommand();
                                 db.Updateable<BIZ_MES_WO_BATCH>().SetColumns(q => q.OUTPUT_QTY == q.OUTPUT_QTY + _woSns.Count).Where(q => q.BATCH_NO == _Batch.BATCH_NO).ExecuteCommand();

--
Gitblit v1.9.3