From 459d4a2b2bd5390a5d02947e75a934207fb9ad0c Mon Sep 17 00:00:00 2001 From: Rodney Chen <rodney.chen@hotmail.com> Date: 星期一, 24 三月 2025 17:08:39 +0800 Subject: [PATCH] 更新U9实体,新增业务实体 --- Tiger.Business.MES/Transaction/PackingNode.cs | 29 ++++++++++++++++++++++++++--- 1 files changed, 26 insertions(+), 3 deletions(-) diff --git a/Tiger.Business.MES/Transaction/PackingNode.cs b/Tiger.Business.MES/Transaction/PackingNode.cs index f0943da..d155090 100644 --- a/Tiger.Business.MES/Transaction/PackingNode.cs +++ b/Tiger.Business.MES/Transaction/PackingNode.cs @@ -264,6 +264,8 @@ { action.Data.ShortMsg = new("宸ュ簭寮傚父", ShortMessage.Types.Error); action.Data.OperInfo = CurOperInfo(input.Locale); + RemoveCurSnFromCurPackage(Context.ContainsKey("CurPackage") ? (Context["CurPackage"] as WipPkg).Item : null); + ResetNode(); //action.CatchExceptionWithLog(ex, $"鍖呰宸ュ簭锛氭彁浜ゆ搷浣滄暟鎹紓甯�"); action.CatchExceptionWithLog(ex, Biz.L("MES.Transaction.PackingNode.SubmitException")); } @@ -313,7 +315,6 @@ FLOW_SN = input.SN, STATUS = MES_WIP_DATA.STATUSs.Init.GetValue(), ITEM_CODE = CurBatch.WO.ITEM_CODE, - QTY = 1, WORK_ORDER = CurBatch.Batch.ORDER_NO, BATCH_NO = CurBatch.Batch.BATCH_NO, FTY_CODE = CurFactory.FTY_CODE, @@ -376,7 +377,6 @@ FLOW_SN = wipSN.SN, TRAY_SN = wipSN.TRAY_SN, STATUS = BIZ_MES_WO_SN.STATUSs.NotInput.GetValue(), - QTY = 1, }); } } @@ -407,6 +407,7 @@ wipSN.SEGMENT = curNode.SEGMENT; wipSN.UNBIND_FLAG = "N"; wipSN.OPERATION_TIME = DateTime.Now; + wipSN.OPERATION_END = DateTime.Now; var curShiftPeriod = GetShiftPeriodForNow(); if (!curShiftPeriod.IsNullOrEmpty()) { @@ -625,6 +626,7 @@ catch (Exception ex) { action.Data.ShortMsg = new("宸ユ寮傚父", ShortMessage.Types.Error); + RemoveCurSnFromCurPackage(Context.ContainsKey("CurPackage") ? (Context["CurPackage"] as WipPkg).Item : null); ResetNode(); //action.CatchExceptionWithLog(ex, $"{curNode.NODE_NAME}锛氬伐搴忚妭鐐瑰伐姝ユ彁浜ゆ暟鎹紓甯革紝璇锋鏌ュ伐搴忚妭鐐硅缃�"); action.CatchExceptionWithLog(ex, Biz.L("MES.Transaction.PackingNode.NodeSubmitException", curNode.NODE_NAME)); @@ -667,6 +669,7 @@ wipSN.OPER_CODE = curNode.OPER_CODE; wipSN.SEGMENT = curNode.SEGMENT; wipSN.OPERATION_TIME = DateTime.Now; + wipSN.OPERATION_END = DateTime.Now; } var wipHiss = new List<MES_WIP_HIS>(); @@ -689,7 +692,7 @@ var db = GetCommitDB(); //鏁版嵁淇濆瓨閫昏緫 db.Updateable(_woSns, UserCode).UpdateColumns(q => new { q.UPDATE_TIME, q.UPDATE_USER, q.STATUS }).ExecuteCommand(); - db.Updateable(_wipSns, UserCode).UpdateColumns(q => new { q.UPDATE_TIME, q.UPDATE_USER, q.STATUS, q.NODE_ID, q.NODE_NAME, q.OPER_CODE, q.SEGMENT, q.OPERATION_TIME }).ExecuteCommand(); + db.Updateable(_wipSns, UserCode).UpdateColumns(q => new { q.UPDATE_TIME, q.UPDATE_USER, q.STATUS, q.NODE_ID, q.NODE_NAME, q.OPER_CODE, q.SEGMENT, q.OPERATION_TIME, q.OPERATION_END }).ExecuteCommand(); db.Storageable(_wipHiss, UserCode).ExecuteCommand(); if (_pkgList.Any()) { @@ -860,6 +863,26 @@ NodeCmd = null; } + public void RemoveCurSnFromCurPackage(WipPkgItem pkgItem) + { + if (!pkgItem.IsNullOrEmpty()) + { + var delItem = pkgItem.Items.Where(q => CurWipSNs.Any(sn => q.WipSNs.ContainsKey(sn.ID))).ToList(); + if (delItem.Any()) + { + pkgItem.Items.RemoveAll(q => CurWipSNs.Any(sn => q.WipSNs.ContainsKey(sn.ID))); + pkgItem.IsFinished = false; + } + else + { + foreach (var item in pkgItem.Items) + { + RemoveCurSnFromCurPackage(item); + } + } + } + } + public override bool Close(bool needSaveHistoryLog = false) { //needSaveHistoryLog = true; -- Gitblit v1.9.3