From a96e763c96401cbc7695acbcd6b18770d8aedf8d Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期三, 06 十一月 2024 15:35:25 +0800 Subject: [PATCH] 单独解绑更新 --- Tiger.Business.MES/WorkAction/PrintLabel.cs | 45 +++++++++++++++++++++++++++++++-------------- 1 files changed, 31 insertions(+), 14 deletions(-) diff --git a/Tiger.Business.MES/WorkAction/PrintLabel.cs b/Tiger.Business.MES/WorkAction/PrintLabel.cs index a3f2941..ca49e4b 100644 --- a/Tiger.Business.MES/WorkAction/PrintLabel.cs +++ b/Tiger.Business.MES/WorkAction/PrintLabel.cs @@ -42,6 +42,9 @@ Label = Biz.Db.Queryable<BAS_LABEL_TEMP>().Where(q => q.LABEL_CODE == setting.LABEL_CODE).IncludesAllFirstLayer().First(); LabelPV = Biz.Db.Queryable<BAS_LABEL_PV>().ToList(); + + CurStep.Message = Biz.L("绛夊緟鏍囩鎵撳嵃"); + CurStep.Status = StepStatus.Normal; } /// <summary> @@ -50,7 +53,7 @@ /// <returns></returns> public Locale GetBeginMsg() { - var msg = new Locale("MES.WorkAction.PrintLabel.BeginMsg", CurPosition.CurSN, Label.LABEL_CODE, Label.LABEL_NAME); + var msg = new Locale("MES.WorkAction.PrintLabel.BeginMsg", CurPosition.CurSN, Label?.LABEL_CODE, Label?.LABEL_NAME); //var msg = new Locale($"寮�濮嬫墦鍗版潯鐮乕{CurPosition.CurWipSN.SN}]鐨勬爣绛綶{Label.LABEL_CODE}: {Label.LABEL_NAME}]"); return msg; } @@ -63,13 +66,22 @@ { var action = new ApiAction<SubmitOutput>(new SubmitOutput()); - //璁剧疆鎵撳嵃鍙橀噺鍊� - Label = CurPosition.SetLabelVariables(LabelPV, Label); - action.Data.Data = Label; + if (Label.IsNullOrEmpty()) + { + action = End(input); + } + else + { + //璁剧疆鎵撳嵃鍙橀噺鍊� + Label = CurPosition.SetLabelVariables(LabelPV, Label, this); + action.Data.Data = Label; - //濡傛灉杩斿洖鎴愬姛鍒欒涓哄綋鍓嶈涓哄彲浠ュ紑濮嬫墽琛岋紝鍚﹀垯杩斿洖澶辫触 - action.IsSuccessed = true; - action.Data.ShortMsg = new("鎵撳嵃寮�濮�", ShortMessage.Types.Success); + //濡傛灉杩斿洖鎴愬姛鍒欒涓哄綋鍓嶈涓哄彲浠ュ紑濮嬫墽琛岋紝鍚﹀垯杩斿洖澶辫触 + CurStep.Message = Biz.L("鎵撳嵃寮�濮�"); + CurStep.Status = StepStatus.Normal; + action.IsSuccessed = true; + action.Data.ShortMsg = new("鎵撳嵃寮�濮�", ShortMessage.Types.Success); + } return action; } @@ -83,15 +95,17 @@ //鎻愪氦鏁版嵁鎵ц鎴愬姛 if (input.Data.ToBoolean()) { - action = End(); + action = End(input); } //鎻愪氦鏁版嵁鎵ц澶辫触 else { + CurStep.Message = Biz.L("鎵撳嵃澶辫触"); + CurStep.Status = StepStatus.Error; action.Data.ShortMsg = new("鎵撳嵃澶辫触", ShortMessage.Types.Failed); action.IsSuccessed = false; //action.LocaleMsg = new($"鏍囩{Label.LABEL_NAME}[{Label.LABEL_CODE}]鎵撳嵃澶辫触", Label.LABEL_NAME); - action.LocaleMsg = new("MES.WorkAction.PrintLabel.PrintFail", Label.LABEL_NAME, Label.LABEL_CODE); + action.LocaleMsg = new("MES.WorkAction.PrintLabel.PrintFail", Label?.LABEL_NAME, Label?.LABEL_CODE); //濡傛灉琛屼负璁剧疆涓哄嚭閿欓渶瑕侀噸缃伐搴忔搷浣� if (NodeAct.NEED_RESET == "Y") { @@ -104,7 +118,7 @@ /// 缁撴潫鎵ц宸ュ簭琛屼负 /// </summary> /// <returns></returns> - public ApiAction<SubmitOutput> End() + public ApiAction<SubmitOutput> End(SubmitInput input) { var action = new ApiAction<SubmitOutput>(new SubmitOutput()); @@ -145,10 +159,11 @@ PRD_CODE = wipSn.PRD_CODE, ACT_TYPE = NodeAct.ACT_TYPE, ACT_SN = wipSn.SN, - ACT_VALUE_1 = Label.LABEL_CODE, - ACT_VALUE_2 = Label.Variables.ToJson(), + ACT_VALUE_1 = Label?.LABEL_CODE, + ACT_VALUE_2 = Label?.ToJson(), ACT_RESULT = "Y", - TRACE_INFO = $"鏍囩{Label.LABEL_NAME}[{Label.LABEL_CODE}]鎵撳嵃鎴愬姛", + ELAPSED_TIME = CurStep.GetElapsedTime().TotalMilliseconds.ToInt64(), + TRACE_INFO = $"鏍囩{Label?.LABEL_NAME}[{Label?.LABEL_CODE}]鎵撳嵃鎴愬姛", }; wipActs.Add(wipAct); } @@ -163,9 +178,11 @@ }; IsFinished = true; + CurStep.Message = Biz.L("鎵撳嵃瀹屾垚"); + CurStep.Status = StepStatus.Finished; action.Data.ShortMsg = new("鎵撳嵃瀹屾垚", ShortMessage.Types.Success); //action.LocaleMsg = new($"鏍囩{Label.LABEL_NAME}[{Label.LABEL_CODE}]鎵撳嵃鎴愬姛", Label.LABEL_NAME); - action.LocaleMsg = new("MES.WorkAction.PrintLabel.PrintSuccess", Label.LABEL_NAME, Label.LABEL_CODE); + action.LocaleMsg = new("MES.WorkAction.PrintLabel.PrintSuccess", Label?.LABEL_NAME, Label?.LABEL_CODE); return action; } -- Gitblit v1.9.3