From 8caee486894a66a35ea0732ad575d7342589635f Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期五, 15 十一月 2024 10:26:40 +0800
Subject: [PATCH] 生成入库获取条码工单信息及包装信息

---
 Tiger.Business.MES/Common/WoContext.cs |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/Tiger.Business.MES/Common/WoContext.cs b/Tiger.Business.MES/Common/WoContext.cs
index fda4192..be617d9 100644
--- a/Tiger.Business.MES/Common/WoContext.cs
+++ b/Tiger.Business.MES/Common/WoContext.cs
@@ -31,11 +31,12 @@
         /// <param name="workorder"></param>
         /// <param name="lineCode"></param>
         /// <returns></returns>
-        public static WorkBatch GetBatch(string workorder, string lineCode, string batchNo = "")
+        public static WorkBatch GetBatch(string workorder, string lineCode, string batchNo = "", bool canDoWork = true)
         {
             if (ExistsBatch(workorder, lineCode, batchNo))
             {
-                return WoBatchDic.FirstOrDefault(q => !q.Value.Batch.IsNullOrEmpty() && q.Value.Batch.ORDER_NO == workorder && q.Value.Batch.ACT_LINE == lineCode && (batchNo.IsNullOrEmpty() || q.Value.Batch.BATCH_NO == batchNo)).Value;
+                return WoBatchDic.WhereIF(canDoWork, q => q.Value.Batch.STATUS == BIZ_MES_WO_BATCH.STATUSs.Release.GetValue() || q.Value.Batch.STATUS == BIZ_MES_WO_BATCH.STATUSs.Working.GetValue())
+                    .FirstOrDefault(q => !q.Value.Batch.IsNullOrEmpty() && q.Value.Batch.ORDER_NO == workorder && q.Value.Batch.ACT_LINE == lineCode && (batchNo.IsNullOrEmpty() || q.Value.Batch.BATCH_NO == batchNo)).Value;
             }
             return null;
         }
@@ -128,6 +129,7 @@
                                 BATCH_NO = woSN.BATCH_NO,
                                 HOLD_FLAG = "N",
                                 FINISHED_FLAG = "N",
+                                UNBIND_FLAG = "N",
                                 INV_FLAG = "N",
                                 DFT_FLAG = "N",
                                 DFT_COUNT = 0,
@@ -188,6 +190,7 @@
                                 BATCH_NO = woSN.BATCH_NO,
                                 HOLD_FLAG = "N",
                                 FINISHED_FLAG = "N",
+                                UNBIND_FLAG = "N",
                                 INV_FLAG = "N",
                                 DFT_FLAG = "N",
                                 DFT_COUNT = 0,

--
Gitblit v1.9.3