| | |
| | | }); |
| | | } |
| | | } |
| | | |
| | | CurStep.Message = Biz.L("扫描要绑定的标签"); |
| | | CurStep.Status = StepStatus.Normal; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | action.LocaleMsg = GetBeginMsg(); |
| | | |
| | | //如果返回成功则认为当前行为可以开始执行,否则返回失败 |
| | | CurStep.Message = Biz.L("绑定开始"); |
| | | CurStep.Status = StepStatus.Normal; |
| | | action.IsSuccessed = true; |
| | | action.Data.ShortMsg = new("绑定开始", ShortMessage.Types.Success); |
| | | return action; |
| | |
| | | //验证扫描的条码是否SN的扩展信息的标签 |
| | | if (input.SN.IsNullOrEmpty()) |
| | | { |
| | | CurStep.Message = Biz.L("绑定失败"); |
| | | CurStep.Status = StepStatus.Error; |
| | | action.Data.ShortMsg = new("绑定失败", ShortMessage.Types.Failed); |
| | | action.IsSuccessed = isOK = false; |
| | | //action.LocaleMsg = new Locale($"错误:[{ExtInfo.FIELD_NAME}]标签条码不能为空,请重新扫描"); |
| | |
| | | } |
| | | if (CurPosition.CurWipSNs.Any(w => w.SN == input.SN)) |
| | | { |
| | | CurStep.Message = Biz.L("绑定失败"); |
| | | CurStep.Status = StepStatus.Error; |
| | | action.Data.ShortMsg = new("绑定失败", ShortMessage.Types.Failed); |
| | | action.IsSuccessed = isOK = false; |
| | | //action.LocaleMsg = new Locale($"错误:扫描到产品条码[{input.SN}],请重新扫描[{ExtInfo.FIELD_NAME}]标签条码"); |
| | |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | CurStep.Message = Biz.L("绑定异常"); |
| | | CurStep.Status = StepStatus.Error; |
| | | action.Data.ShortMsg = new("绑定异常", ShortMessage.Types.Exception); |
| | | action.CatchExceptionWithLog(ex, $"扩展信息绑定行为:产品[{CurPosition.CurSN}]绑定[{ExtInfo.FIELD_NAME}]标签条码[{input.SN}]保存异常"); |
| | | action.IsSuccessed = false; |
| | |
| | | ACT_SN = wipSn.SN, |
| | | ACT_VALUE_1 = CurWipExt.ToJson(), |
| | | ACT_RESULT = "Y", |
| | | ELAPSED_TIME = CurStep.GetElapsedTime().TotalMilliseconds.ToInt64(), |
| | | TRACE_INFO = $"产品[{CurPosition.CurSN}]绑定[{ExtInfo.FIELD_NAME}]标签条码[{CurWipExt.GetType().GetProperty($"FIELD_{ExtInfo.SEQ.ToString("00")}")?.GetValue(CurWipExt)?.ToString()}]保存成功", |
| | | }; |
| | | wipActs.Add(wipAct); |
| | |
| | | }; |
| | | |
| | | IsFinished = true; |
| | | CurStep.Message = Biz.L("绑定完成"); |
| | | CurStep.Status = StepStatus.Finished; |
| | | action.Data.ShortMsg = new("绑定完成", ShortMessage.Types.Success); |
| | | //action.LocaleMsg = new($"产品[{CurPosition.CurWipSN.SN}]绑定[{ExtInfo.FIELD_NAME}]标签条码[{CurWipExt.GetType().GetProperty($"FIELD_{ExtInfo.SEQ.ToString("00")}")?.GetValue(CurWipExt)?.ToString()}]保存成功"); |