From 0859eca81c7d64fbc91c49928f78b50d6271760d Mon Sep 17 00:00:00 2001
From: Rodney Chen <rodney.chen@hotmail.com>
Date: 星期五, 11 十月 2024 00:48:31 +0800
Subject: [PATCH] 优化了一些已知问题

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

diff --git a/Tiger.Business.MES/Common/WoContext.cs b/Tiger.Business.MES/Common/WoContext.cs
index c8868dc..107746d 100644
--- a/Tiger.Business.MES/Common/WoContext.cs
+++ b/Tiger.Business.MES/Common/WoContext.cs
@@ -31,11 +31,11 @@
         /// <param name="workorder"></param>
         /// <param name="lineCode"></param>
         /// <returns></returns>
-        public static WorkBatch GetBatch(string workorder, string lineCode)
+        public static WorkBatch GetBatch(string workorder, string lineCode, string batchNo = "")
         {
-            if (ExistsBatch(workorder, lineCode))
+            if (ExistsBatch(workorder, lineCode, batchNo))
             {
-                return WoBatchDic.FirstOrDefault(q => q.Value.Batch.ORDER_NO == workorder && q.Value.Batch.ACT_LINE == lineCode).Value;
+                return WoBatchDic.FirstOrDefault(q => q.Value.Batch.ORDER_NO == workorder && q.Value.Batch.ACT_LINE == lineCode && (batchNo.IsNullOrEmpty() || q.Value.Batch.BATCH_NO == batchNo)).Value;
             }
             return null;
         }
@@ -46,9 +46,9 @@
         /// <param name="workorder"></param>
         /// <param name="lineCode"></param>
         /// <returns></returns>
-        public static bool ExistsBatch(string workorder, string lineCode)
+        public static bool ExistsBatch(string workorder, string lineCode, string batchNo = "")
         {
-            return WoBatchDic.Any(q => q.Value.Batch.ORDER_NO == workorder && q.Value.Batch.ACT_LINE == lineCode);
+            return WoBatchDic.Any(q => q.Value.Batch.ORDER_NO == workorder && q.Value.Batch.ACT_LINE == lineCode && (batchNo.IsNullOrEmpty() || q.Value.Batch.BATCH_NO == batchNo));
         }
 
         /// 浠庡伐鍗曟壒娆″瓧鍏镐腑鍒犻櫎涓�涓伐鍗曟壒娆″璞�

--
Gitblit v1.9.3