From 75c7716ee5349ea1eeb7bcdd1724ef2423454c0e Mon Sep 17 00:00:00 2001 From: Rodney Chen <rodney.chen@hotmail.com> Date: 星期二, 15 十月 2024 17:17:43 +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 107746d..6fcdb16 100644 --- a/Tiger.Business.MES/Common/WoContext.cs +++ b/Tiger.Business.MES/Common/WoContext.cs @@ -45,10 +45,13 @@ /// </summary> /// <param name="workorder"></param> /// <param name="lineCode"></param> + /// <param name="batchNo"></param> + /// <param name="canDoWork"></param> /// <returns></returns> - public static bool ExistsBatch(string workorder, string lineCode, string batchNo = "") + public static bool ExistsBatch(string workorder, string lineCode, string batchNo = "", bool canDoWork = false) { - return WoBatchDic.Any(q => q.Value.Batch.ORDER_NO == workorder && q.Value.Batch.ACT_LINE == lineCode && (batchNo.IsNullOrEmpty() || q.Value.Batch.BATCH_NO == batchNo)); + 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()) + .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