From 6a7cec8384ebe5e971ba418906846472f5fe6b84 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期一, 23 九月 2024 19:50:00 +0800 Subject: [PATCH] 一些更改 --- Tiger.Business.MES/Transaction/TestNode.cs | 53 +++++++++++++++++++++++++++-------------------------- 1 files changed, 27 insertions(+), 26 deletions(-) diff --git a/Tiger.Business.MES/Transaction/TestNode.cs b/Tiger.Business.MES/Transaction/TestNode.cs index 11b5364..133a83b 100644 --- a/Tiger.Business.MES/Transaction/TestNode.cs +++ b/Tiger.Business.MES/Transaction/TestNode.cs @@ -55,12 +55,12 @@ if (!action.IsSuccessed) { var info = WoContext.GetSnOperInfo(input.SN).Data; - info.InputQty = OperInfoDic[CurBatch.Batch.BATCH_NO].InputQty; + info.InputQty = CurOperInfo(input.Locale).InputQty; action.Data.OperInfo = info; } else if (!IsFinishAllSteps) { - action.Data.OperInfo = SetOperNodeInfo(OperInfoDic[CurBatch.Batch.BATCH_NO], input.Locale); + action.Data.OperInfo = SetOperNodeInfo(CurOperInfo(input.Locale)); } } //褰撳墠宀椾綅鍦ㄥ綋鍓嶅伐鍗曚笉鏄绔欙紝鍒欐煡鎵炬潯鐮佸凡缁戝畾鐨勫伐鍗曞綋浣滃綋鍓嶅伐鍗� @@ -102,12 +102,12 @@ if (!action.IsSuccessed && !CurWipSNs.Any()) { var info = WoContext.GetSnOperInfo(input.SN).Data; - info.InputQty = OperInfoDic[CurBatch.Batch.BATCH_NO].InputQty; + info.InputQty = CurOperInfo(input.Locale).InputQty; action.Data.OperInfo = info; } else if (!IsFinishAllSteps) { - action.Data.OperInfo = SetOperNodeInfo(OperInfoDic[CurBatch.Batch.BATCH_NO], input.Locale); + action.Data.OperInfo = SetOperNodeInfo(CurOperInfo(input.Locale)); } } } @@ -142,18 +142,18 @@ CurBatch?.Update(); var submitStep = Steps.Where(q => q.ID == input.CurStepID && !q.IsFinished).FirstOrDefault(); + //濡傛灉瀹㈡埛绔繑鍥炵殑褰撳墠宸ユID鎵句笉鍒版湭瀹屾垚鐨勮涓哄伐姝ワ紝鍒欑洿鎺ュ紑濮嬩笅涓�涓涓哄伐姝� if (submitStep.IsNullOrEmpty()) { action = BeginNextActionStep(input); - action.Data.OperInfo = OperInfoDic[CurBatch.Batch.BATCH_NO]; } else { - var result = submitStep.Submit(input); + action = submitStep.Submit(input); //濡傛灉褰撳墠宸ユ宸插畬鎴愶紝寮�濮嬫墽琛屼笅涓�宸ユ - if (result.IsSuccessed && submitStep.IsFinished) + if (action.IsSuccessed && submitStep.IsFinished) { - result = BeginNextActionStep(input); + action = BeginNextActionStep(input); } //濡傛灉褰撳墠宸ユ鏈畬鎴� else @@ -161,30 +161,29 @@ //琛屼负鎵ц鍑洪敊锛屽伐姝ヨ閲嶇疆 if (Steps.IsNullOrEmpty()) { - result.LocaleMsg = new(Biz.T(result.LocaleMsg, input.Locale) + Biz.T(Biz.L("MES.Transaction.Position.RescanSN"), input.Locale)); + action.LocaleMsg = new(Biz.T(action.LocaleMsg, input.Locale) + Biz.T(Biz.L("MES.Transaction.Position.RescanSN"), input.Locale)); } else { - result.Data.SetValue(CurBatch, CurStep, CurStep?.ID, IsFinishAllSteps); + action.Data.SetValue(CurBatch, CurStep, CurStep?.ID, IsFinishAllSteps); } } - //濡傛灉鎵�鏈夊伐姝ラ兘瀹屾垚 - if (IsFinishAllSteps) - { - result = DoIfFinishAllSteps(result, input.Locale); - } - else - { - result.Data.OperInfo = OperInfoDic[CurBatch.Batch.BATCH_NO]; - } - return result; + } + //濡傛灉鎵�鏈夊伐姝ラ兘瀹屾垚 + if (IsFinishAllSteps) + { + action = DoIfFinishAllSteps(action, input.Locale); + } + else + { + action.Data.OperInfo = CurOperInfo(input.Locale); } } //娌℃湁鍙墽琛岀殑宸ユ else { action.Data.ShortMsg = new("閲嶇疆鎵弿", ShortMessage.Types.Error); - action.Data.OperInfo = OperInfoDic.ContainsKey(CurBatch?.Batch?.BATCH_NO ?? "") ? OperInfoDic[CurBatch.Batch.BATCH_NO] : new(); + action.Data.OperInfo = CurOperInfo(input.Locale); ResetNode(); action.IsSuccessed = false; //action.LocaleMsg = new($"宀椾綅[{CurPosition.POST_CODE}]宸ユ鎵ц寮傚父锛岃閲嶆柊鎵弿浜у搧鏉$爜", CurPosition.POST_CODE); @@ -194,7 +193,7 @@ catch (Exception ex) { action.Data.ShortMsg = new("宸ュ簭寮傚父", ShortMessage.Types.Error); - action.Data.OperInfo = OperInfoDic.ContainsKey(CurBatch?.Batch?.BATCH_NO ?? "") ? OperInfoDic[CurBatch.Batch.BATCH_NO] : new(); + action.Data.OperInfo = CurOperInfo(input.Locale); //action.CatchExceptionWithLog(ex, $"娴嬭瘯宸ュ簭锛氭彁浜ゆ搷浣滄暟鎹紓甯�"); action.CatchExceptionWithLog(ex, Biz.L("MES.Transaction.TestNode.SubmitException")); } @@ -253,7 +252,7 @@ action.Data.ShortMsg = new("宸ュ崟閿欒", ShortMessage.Types.Error); action.IsSuccessed = false; //action.LocaleMsg = new($"浜у搧[{CurSN}]涓嶅睘浜庡綋鍓嶅伐鍗曪紝璇峰垏鎹㈠埌宸ュ崟[{wipSNs.First().WORK_ORDER}]鍚庡啀鎵弿"); - action.LocaleMsg = new("MES.Transaction.TestNode.NodeSubmit.WoError", CurSN, wipSNs.First().WORK_ORDER); + action.LocaleMsg = new("MES.Transaction.TestNode.NodeSubmit.WoError", input.SN, wipSNs.First().WORK_ORDER); return action; } else @@ -261,7 +260,7 @@ action.Data.ShortMsg = new("浜х嚎閿欒", ShortMessage.Types.Error); action.IsSuccessed = false; //action.LocaleMsg = new($"浜у搧[{CurSN}]宸插湪浜х嚎[{wipSNs.First().LINE_CODE}]鎶曚骇锛岃鍒颁骇绾縖{wipSNs.First().LINE_CODE}]鎵弿"); - action.LocaleMsg = new("MES.Transaction.TestNode.NodeSubmit.LineError", CurSN, wipSNs.First().LINE_CODE); + action.LocaleMsg = new("MES.Transaction.TestNode.NodeSubmit.LineError", input.SN, wipSNs.First().LINE_CODE); return action; } } @@ -462,6 +461,7 @@ } //瀹屾垚绗竴涓伐搴忚妭鐐瑰伐姝� + curStep.IsFinished = true; curStep.Status = StepStatus.Finished; CurStep = curStep; } @@ -470,6 +470,7 @@ var curStep = Steps.Where(q => q.NodeType == IWorkStep.NodeTypes.Node && !q.IsFinished).OrderBy(q => q.Sequence).First(); //瀹屾垚褰撳墠宸ュ簭鑺傜偣宸ユ + curStep.IsFinished = true; curStep.Status = StepStatus.Finished; CurStep = curStep; } @@ -532,8 +533,8 @@ SaveStepsCommitActionToDB(); //淇濆瓨鎴愬姛锛岃繑鍥炶繃绔欐秷鎭� - OperInfoDic[CurBatch.Batch.BATCH_NO].InputQty += CurWipSNs.Count; - action.Data.OperInfo = SetOperNodeInfo(OperInfoDic[CurBatch.Batch.BATCH_NO], locale); + CurOperInfo(locale).InputQty += CurWipSNs.Count; + action.Data.OperInfo = SetOperNodeInfo(CurOperInfo(locale)); action.Data.ShortMsg = new("杩囩珯鎴愬姛", ShortMessage.Types.Success); //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>()); -- Gitblit v1.9.3