| | |
| | | /// <returns></returns> |
| | | public Locale GetBeginMsg() |
| | | { |
| | | var msg = new Locale("MES.WorkAction.PrintInStoreLabel.BeginMsg", CurPosition.CurSN, Label.LABEL_CODE, Label.LABEL_NAME); |
| | | var msg = new Locale("MES.WorkAction.PrintInStoreLabel.BeginMsg", CurPosition.CurSN, Label?.LABEL_CODE, Label?.LABEL_NAME); |
| | | //var msg = new Locale($"开始打印条码[{CurPosition.CurWipSN.SN}]的入库标签[{Label.LABEL_CODE}: {Label.LABEL_NAME}]"); |
| | | return msg; |
| | | } |
| | |
| | | { |
| | | var action = new ApiAction<SubmitOutput>(new SubmitOutput()); |
| | | |
| | | //设置打印变量值 |
| | | Label = CurPosition.SetLabelVariables(LabelPV, Label, this); |
| | | if (CurPosition.Context.ContainsKey("CurPackage")) |
| | | { |
| | | (CurPosition.Context["CurPackage"] as WipPkg).InStoreLabel = Label; |
| | | } |
| | | |
| | | //判断是否需要打印入库标签 |
| | | NoNeedInStorePrint = (!CurPosition.Context.ContainsKey("CurPackage") || !(CurPosition.Context["CurPackage"] as WipPkg).IsFinished) |
| | | || (CurPosition is YadaPacking && (CurPosition as YadaPacking).IsPrintCustomerLabel); |
| | | if (NoNeedInStorePrint) |
| | | if (Label.IsNullOrEmpty()) |
| | | { |
| | | action = End(input); |
| | | } |
| | | else |
| | | { |
| | | action.Data.Data = Label; |
| | | //设置打印变量值 |
| | | Label = CurPosition.SetLabelVariables(LabelPV, Label, this); |
| | | if (CurPosition.Context.ContainsKey("CurPackage")) |
| | | { |
| | | (CurPosition.Context["CurPackage"] as WipPkg).InStoreLabel = Label; |
| | | } |
| | | |
| | | //如果返回成功则认为当前行为可以开始执行,否则返回失败 |
| | | CurStep.Message = Biz.L("打印开始"); |
| | | CurStep.Status = StepStatus.Normal; |
| | | action.IsSuccessed = true; |
| | | action.Data.ShortMsg = new("打印开始", ShortMessage.Types.Success); |
| | | //判断是否需要打印入库标签 |
| | | NoNeedInStorePrint = (!CurPosition.Context.ContainsKey("CurPackage") || !(CurPosition.Context["CurPackage"] as WipPkg).IsFinished) |
| | | || (CurPosition is YadaPacking && (CurPosition as YadaPacking).IsPrintCustomerLabel); |
| | | if (NoNeedInStorePrint) |
| | | { |
| | | action = End(input); |
| | | } |
| | | else |
| | | { |
| | | action.Data.Data = Label; |
| | | |
| | | //如果返回成功则认为当前行为可以开始执行,否则返回失败 |
| | | CurStep.Message = Biz.L("打印开始"); |
| | | CurStep.Status = StepStatus.Normal; |
| | | action.IsSuccessed = true; |
| | | action.Data.ShortMsg = new("打印开始", ShortMessage.Types.Success); |
| | | } |
| | | } |
| | | return action; |
| | | } |
| | |
| | | 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.PrintInStoreLabel.PrintFail", Label.LABEL_NAME, Label.LABEL_CODE); |
| | | action.LocaleMsg = new("MES.WorkAction.PrintInStoreLabel.PrintFail", Label?.LABEL_NAME, Label?.LABEL_CODE); |
| | | //如果行为设置为出错需要重置工序操作 |
| | | if (NodeAct.NEED_RESET == "Y") |
| | | { |
| | |
| | | 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 = NoNeedInStorePrint ? $"无需打印入库标签" : $"标签{Label.LABEL_NAME}[{Label.LABEL_CODE}]打印成功", |
| | | TRACE_INFO = NoNeedInStorePrint ? $"无需打印入库标签" : $"标签{Label?.LABEL_NAME}[{Label?.LABEL_CODE}]打印成功", |
| | | }; |
| | | wipActs.Add(wipAct); |
| | | } |
| | |
| | | CurStep.Status = StepStatus.Finished; |
| | | action.Data.ShortMsg = new("无需打印", ShortMessage.Types.Success); |
| | | //action.LocaleMsg = new($"无需打印入库标签{0}[{1}]"); |
| | | action.LocaleMsg = new("MES.WorkAction.PrintInStoreLabel.NoNeedPrint", Label.LABEL_NAME, Label.LABEL_CODE); |
| | | action.LocaleMsg = new("MES.WorkAction.PrintInStoreLabel.NoNeedPrint", Label?.LABEL_NAME, Label?.LABEL_CODE); |
| | | } |
| | | else |
| | | { |
| | |
| | | CurStep.Status = StepStatus.Finished; |
| | | action.Data.ShortMsg = new("打印完成", ShortMessage.Types.Success); |
| | | //action.LocaleMsg = new($"入库标签{0}[{1}打印成功"); |
| | | action.LocaleMsg = new("MES.WorkAction.PrintInStoreLabel.PrintSuccess", Label.LABEL_NAME, Label.LABEL_CODE); |
| | | action.LocaleMsg = new("MES.WorkAction.PrintInStoreLabel.PrintSuccess", Label?.LABEL_NAME, Label?.LABEL_CODE); |
| | | } |
| | | return action; |
| | | } |