From 19d2f753564945c8d8f6503535b9207820ac584b Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期四, 15 八月 2024 08:58:56 +0800 Subject: [PATCH] 工单增加来源单号 --- Tiger.Business.MES/Transaction/PackingNode.cs | 48 +++++++++++++++++++++++++++++++++--------------- 1 files changed, 33 insertions(+), 15 deletions(-) diff --git a/Tiger.Business.MES/Transaction/PackingNode.cs b/Tiger.Business.MES/Transaction/PackingNode.cs index e29b65b..e66574b 100644 --- a/Tiger.Business.MES/Transaction/PackingNode.cs +++ b/Tiger.Business.MES/Transaction/PackingNode.cs @@ -212,7 +212,8 @@ var wipSN = new MES_WIP_DATA() { SN = input.SN, - STATUS = MES_WIP_DATA.STATUSs.Init.GetValue(), + FLOW_SN = input.SN, + STATUS = MES_WIP_DATA.STATUSs.Init.GetValue(), ITEM_CODE = CurBatch.WO.ITEM_CODE, WORK_ORDER = CurBatch.Batch.ORDER_NO, BATCH_NO = CurBatch.Batch.BATCH_NO, @@ -242,6 +243,7 @@ CurBatch.WoSNs.Add(new() { WORK_ORDER = CurBatch.Batch.ORDER_NO, + WIP_ID = wipSN.ID, SN = wipSN.SN, TRAY_SN = wipSN.TRAY_SN, STATUS = BIZ_MES_WO_SN.STATUSs.NotInput.GetValue(), @@ -326,8 +328,10 @@ DFT_CODE = dft.DFT_CODE, DFT_NAME = dft.DFT_NAME, DFT_LEVEL = dft.DFT_LEVEL, + FLOW_SN = wipSN.FLOW_SN, TRAY_SN = wipSN.TRAY_SN, - CONTAINER_SN = wipSN.CONTAINER_SN, + INNER_SN = wipSN.INNER_SN, + CARTON_SN = wipSN.CARTON_SN, PALLET_SN = wipSN.PALLET_SN, INV_FLAG = wipSN.INV_FLAG, OPERATION_TIME = DateTime.Now, @@ -352,6 +356,14 @@ CurWipSNHiss.Add(new MES_WIP_HIS(wipSN, $"宸ュ崟[{wipSN.WORK_ORDER}]鏉$爜[{wipSN.SN}]鍦ㄥ矖浣峓{wipSN.POST_CODE}]杩囩珯宸ュ簭[{wipSN.NODE_NAME}]鎴愬姛")); } + //鍒涘缓鍙橀噺鍏嬮殕瀵硅薄鐢ㄤ簬浼犲叆DBSubmitAction涓繚瀛樺綋鍓嶉渶瑕佹殏瀛樼殑鏁版嵁鍊� + var _woSns = woSNs.Clone(); + var _wipSns = wipSNs.Clone(); + var _wipHiss = CurWipSNHiss.Clone(); + var _defect = CurDefects.Clone(); + var _curNode = curNode.Clone(); + var _Batch = CurBatch.Batch.Clone(); + //鍒濆鍖栧伐姝ュ垪琛� Steps.Clear(); var curStep = new Biz.WorkStep(IWorkStep.Types.Node, this) @@ -360,26 +372,28 @@ Node = curNode, DBSubmitAction = () => { - var db = GetCommitDB(); - db.Storageable(woSNs, UserCode).ExecuteCommand(); - db.Storageable(wipSNs, UserCode).ExecuteCommand(); - db.Storageable(CurWipSNHiss, UserCode).ExecuteCommand(); + //浣跨敤缁熶竴鐨勪簨鍔B瀵硅薄 + var db = GetCommitDB(); + //鏁版嵁淇濆瓨閫昏緫 + db.Storageable(_woSns, UserCode).ExecuteCommand(); + db.Storageable(_wipSns, UserCode).ExecuteCommand(); + db.Storageable(_wipHiss, UserCode).ExecuteCommand(); //濡傛灉鏈変笉鑹垯淇濆瓨 - if (CurDefects.Any()) + if (_defect.Any()) { - db.Storageable(CurDefects, UserCode).ExecuteCommand(); + db.Storageable(_defect, UserCode).ExecuteCommand(); } //濡傛灉鏄姇鍏ョ珯 - if (curNode.IS_INPUT == "Y") + if (_curNode.IS_INPUT == "Y") { - db.Updateable<BIZ_MES_WO>().SetColumns(q => q.INPUT_QTY == q.INPUT_QTY + wipSNs.Count).Where(q => q.ORDER_NO == CurBatch.WO.ORDER_NO).ExecuteCommand(); - db.Updateable<BIZ_MES_WO_BATCH>().SetColumns(q => q.INPUT_QTY == q.INPUT_QTY + wipSNs.Count).Where(q => q.BATCH_NO == CurBatch.Batch.BATCH_NO).ExecuteCommand(); + db.Updateable<BIZ_MES_WO>().SetColumns(q => q.INPUT_QTY == q.INPUT_QTY + _woSns.Count).Where(q => q.ORDER_NO == _Batch.ORDER_NO).ExecuteCommand(); + db.Updateable<BIZ_MES_WO_BATCH>().SetColumns(q => q.INPUT_QTY == q.INPUT_QTY + _woSns.Count).Where(q => q.BATCH_NO == _Batch.BATCH_NO).ExecuteCommand(); } //濡傛灉鏄骇鍑虹珯 - if (curNode.IS_OUTPUT == "Y") + if (_curNode.IS_OUTPUT == "Y") { - db.Updateable<BIZ_MES_WO>().SetColumns(q => q.OUTPUT_QTY == q.OUTPUT_QTY + wipSNs.Count).Where(q => q.ORDER_NO == CurBatch.WO.ORDER_NO).ExecuteCommand(); - db.Updateable<BIZ_MES_WO_BATCH>().SetColumns(q => q.OUTPUT_QTY == q.OUTPUT_QTY + wipSNs.Count).Where(q => q.BATCH_NO == CurBatch.Batch.BATCH_NO).ExecuteCommand(); + db.Updateable<BIZ_MES_WO>().SetColumns(q => q.OUTPUT_QTY == q.OUTPUT_QTY + _woSns.Count).Where(q => q.ORDER_NO == _Batch.ORDER_NO).ExecuteCommand(); + db.Updateable<BIZ_MES_WO_BATCH>().SetColumns(q => q.OUTPUT_QTY == q.OUTPUT_QTY + _woSns.Count).Where(q => q.BATCH_NO == _Batch.BATCH_NO).ExecuteCommand(); } } }; @@ -472,7 +486,11 @@ //action.LocaleMsg = new($"宸ュ崟[{CurWipSN.WORK_ORDER}]鐨勬潯鐮乕{CurWipSN.SN}]鍦ㄥ矖浣峓{CurWipSN.POST_CODE}]宸ュ簭[{CurWipSN.NODE_NAME}]杩囩珯鎴愬姛锛岀姸鎬乕{CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()}]"); action.LocaleMsg = new("MES.Transaction.CollectNode.ScanSn.PassSuccess", CurWipSNs.First().WORK_ORDER, CurSN, CurWipSNs.First().POST_CODE, CurWipSNs.First().NODE_NAME,CurWipSNs.First().STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()); //閲嶇疆宸ュ簭 - ResetNode(); + //if (!isClone) + { + ResetNode(); + } + return action; } -- Gitblit v1.9.3