From 9fe5cb3330957523a84ab920d9e75eb2572268dc Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期日, 01 十二月 2024 16:37:27 +0800 Subject: [PATCH] 入库单打印更新 --- Tiger.Business.MES/Common/WoContext.cs | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Tiger.Business.MES/Common/WoContext.cs b/Tiger.Business.MES/Common/WoContext.cs index c8868dc..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) + public static WorkBatch GetBatch(string workorder, string lineCode, string batchNo = "", bool canDoWork = true) { - 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.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; } @@ -45,10 +46,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) + 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); + return WoBatchDic.WhereIF(canDoWork, q => !q.Value.Batch.IsNullOrEmpty() && (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)); } /// 浠庡伐鍗曟壒娆″瓧鍏镐腑鍒犻櫎涓�涓伐鍗曟壒娆″璞� @@ -125,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, @@ -185,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