From 050fdd3ef7d0e17143093ee355941bd6437b5486 Mon Sep 17 00:00:00 2001 From: Rodney Chen <rodney.chen@hotmail.com> Date: 星期三, 13 十一月 2024 12:00:43 +0800 Subject: [PATCH] 优化生产记录状态,使用完工标记作为产品完工的判断,不使用状态 从工单中解绑正在生产的条码时,同步更新工单池中同一工单的工单条码状态 --- Tiger.Business.MES/Common/WoContext.cs | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Tiger.Business.MES/Common/WoContext.cs b/Tiger.Business.MES/Common/WoContext.cs index 9804f8d..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; } @@ -50,7 +51,7 @@ /// <returns></returns> public static bool ExistsBatch(string workorder, string lineCode, string batchNo = "", bool canDoWork = false) { - 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()) + 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)); } @@ -128,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, @@ -188,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