From 0c724878e66cac2639811ac2e88f553fc17cc72b Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期二, 05 十一月 2024 01:17:02 +0800
Subject: [PATCH] 重投更新

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

diff --git a/Tiger.Business.MES/Common/WoContext.cs b/Tiger.Business.MES/Common/WoContext.cs
index 0cb1963..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;
         }

--
Gitblit v1.9.3