服务端的TigerApi 框架,基于.NET6 2024 版本
Rodney Chen
2024-10-28 17077d5f5dc14c5ff5e6d757efa49c53e2b9afad
Tiger.Business.MES/WorkAction/PrintLabel.cs
@@ -53,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;
        }
@@ -66,15 +66,22 @@
        {
            var action = new ApiAction<SubmitOutput>(new SubmitOutput());
            //设置打印变量值
            Label = CurPosition.SetLabelVariables(LabelPV, Label, this);
            action.Data.Data = Label;
            if (Label.IsNullOrEmpty())
            {
                action = End(input);
            }
            else
            {
                //设置打印变量值
                Label = CurPosition.SetLabelVariables(LabelPV, Label, this);
                action.Data.Data = Label;
            //如果返回成功则认为当前行为可以开始执行,否则返回失败
            CurStep.Message = Biz.L("打印开始");
            CurStep.Status = StepStatus.Normal;
            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;
        }
@@ -98,7 +105,7 @@
                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")
                {
@@ -152,11 +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",
                    ELAPSED_TIME = CurStep.GetElapsedTime().TotalMilliseconds.ToInt64(),
                    TRACE_INFO = $"标签{Label.LABEL_NAME}[{Label.LABEL_CODE}]打印成功",
                    TRACE_INFO = $"标签{Label?.LABEL_NAME}[{Label?.LABEL_CODE}]打印成功",
                };
                wipActs.Add(wipAct);
            }
@@ -175,7 +182,7 @@
            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;
        }