From 1f72396c6294b9f78723d786a9b0965414d0601a Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期五, 13 九月 2024 15:38:38 +0800 Subject: [PATCH] 一些更改 --- Tiger.Business/MES/WoContext.cs | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Tiger.Business/MES/WoContext.cs b/Tiger.Business/MES/WoContext.cs index 78b28b5..6829945 100644 --- a/Tiger.Business/MES/WoContext.cs +++ b/Tiger.Business/MES/WoContext.cs @@ -33,7 +33,11 @@ /// <returns></returns> public static WorkBatch GetBatch(string workorder, string lineCode) { - return WoBatchDic.FirstOrDefault(q => q.Value.Batch.ORDER_NO == workorder && q.Value.Batch.ACT_LINE == lineCode).Value; + if (ExistsBatch(workorder, lineCode)) + { + return WoBatchDic.FirstOrDefault(q => q.Value.Batch.ORDER_NO == workorder && q.Value.Batch.ACT_LINE == lineCode).Value; + } + return null; } /// <summary> @@ -200,7 +204,7 @@ if (!WoBatchDic.Any(q => q.Value.WO.ORDER_NO == wipSNs.First().WORK_ORDER)) { var wb = new WorkBatch(wipSNs.First().WORK_ORDER).Init(""); - WoBatchDic.Add(wb.Batch.BATCH_NO, wb); + WoBatchDic.Add(wipSNs.First().BATCH_NO, wb); } var wo = WoBatchDic.FirstOrDefault(q => q.Value.WO.ORDER_NO == wipSNs.First().WORK_ORDER).Value; action.Data = new() -- Gitblit v1.9.3