| | |
| | | data.PrintLable = LabelDic[min.PKG_LEVEL]; |
| | | CurCmd = data; |
| | | PrintTimes++; |
| | | CurStep.Message = Biz.L("打印标签"); |
| | | CurStep.Status = StepStatus.Normal; |
| | | action.Data.Data = data; |
| | | action.Data.ShortMsg = new("打印标签", ShortMessage.Types.Normal); |
| | | //action.LocaleMsg = new Locale($"开始第{PrintTimes}次打印第{min.PKG_LEVEL}层包装[{min.PkgType.PKG_NAME}]的标签[{LabelDic[min.PKG_LEVEL]?.LABEL_CODE}: {LabelDic[min.PKG_LEVEL].LABEL_NAME}]"); |
| | |
| | | if (!pInput.IsFinish || pInput.PkgSN.IsNullOrEmpty()) |
| | | { |
| | | var dtl = PkgRule.Details.First(q => q.PKG_LEVEL == pInput.PkgLevel); |
| | | CurStep.Message = Biz.L("扫描错误"); |
| | | CurStep.Status = StepStatus.Error; |
| | | action.Data.ShortMsg = new("扫描错误", ShortMessage.Types.Error); |
| | | action.IsSuccessed = false; |
| | | //action.LocaleMsg = new($"条码扫描失败,请重新扫描第{dtl.PKG_LEVEL}层包装[{dtl.PkgType.PKG_NAME}]的标签条码"); |
| | |
| | | if (GetPackageList(CurPkg.Item).Any(q => q.SN == pInput.PkgSN)) |
| | | { |
| | | var dtl = PkgRule.Details.First(q => q.PKG_LEVEL == pInput.PkgLevel); |
| | | CurStep.Message = Biz.L("扫描错误"); |
| | | CurStep.Status = StepStatus.Error; |
| | | action.Data.ShortMsg = new("扫描错误", ShortMessage.Types.Error); |
| | | action.IsSuccessed = false; |
| | | //action.LocaleMsg = new($"条码[{pInput.PkgSN}]无需重复扫描,请扫描第{dtl.PKG_LEVEL}层包装[{dtl.PkgType.PKG_NAME}]的标签条码"); |
| | |
| | | action = SavePkgData(input, action); |
| | | if (action.IsSuccessed) |
| | | { |
| | | CurStep.Message = Biz.L("扫描成功"); |
| | | CurStep.Status = StepStatus.Success; |
| | | action.Data.ShortMsg = new("扫描成功", ShortMessage.Types.Success); |
| | | } |
| | | } |
| | |
| | | data.ExecCode = "Scan"; |
| | | data.PkgLevel = dtl.PKG_LEVEL; |
| | | CurCmd = data; |
| | | CurStep.Message = Biz.L("扫描标签"); |
| | | CurStep.Status = StepStatus.Normal; |
| | | action.Data.Data = data; |
| | | action.Data.ShortMsg = new("扫描标签", ShortMessage.Types.Normal); |
| | | //action.LocaleMsg = new($"请扫描第{dtl.PKG_LEVEL}层包装[{dtl.PkgType.PKG_NAME}]的标签条码"); |
| | |
| | | if (PrintTimes < 3 && !CurCmd.IsNullOrEmpty()) |
| | | { |
| | | PrintTimes++; |
| | | CurStep.Message = Biz.L("重新打印"); |
| | | CurStep.Status = StepStatus.Normal; |
| | | action.Data.Data = CurCmd; |
| | | action.Data.ShortMsg = new("重新打印", ShortMessage.Types.Normal); |
| | | //action.LocaleMsg = new Locale($"开始{PrintTimes}次打印第{dtl.PKG_LEVEL}层包装[{dtl.PkgType.PKG_NAME}]的标签[{LabelDic[dtl.PKG_LEVEL]?.LABEL_CODE}: {LabelDic[dtl.PKG_LEVEL].LABEL_NAME}]"); |
| | |
| | | { |
| | | CurCmd = null; |
| | | PrintTimes = 0; |
| | | CurStep.Message = Biz.L("打印失败"); |
| | | CurStep.Status = StepStatus.Error; |
| | | action.Data.ShortMsg = new("打印失败", ShortMessage.Types.Failed); |
| | | action.IsSuccessed = false; |
| | | //action.LocaleMsg = new($"尝试第{PrintTimes}次打印第{dtl.PKG_LEVEL}层包装[{dtl.PkgType.PKG_NAME}]的标签[{LabelDic[dtl.PKG_LEVEL]?.LABEL_CODE}: {LabelDic[dtl.PKG_LEVEL].LABEL_NAME}]失败,工序已重置,请重新扫描进站产品条码"); |
| | |
| | | if (!PkgProd.IsNullOrEmpty() && (pInput.WeightInfo.Weight < PkgProd.MIN_WEIGHT || PkgProd.MIN_WEIGHT < pInput.WeightInfo.Weight)) |
| | | { |
| | | action.IsSuccessed = false; |
| | | CurStep.Message = Biz.L("重量超限"); |
| | | CurStep.Status = StepStatus.Error; |
| | | action.Data.Data = CurCmd; |
| | | action.Data.ShortMsg = new("重量超限", ShortMessage.Types.Failed); |
| | | //action.LocaleMsg = new($"外包装重量[{0}]超出产品[{1}]在包装规则[{2}]中的预设范围[{3} - {4}],请处理后重新上称称重"); |
| | |
| | | data.ExecCode = "Scan"; |
| | | data.PkgLevel = dtl.PKG_LEVEL; |
| | | CurCmd = data; |
| | | action.Data.Data = data; |
| | | CurStep.Message = Biz.L("扫描标签"); |
| | | CurStep.Status = StepStatus.Normal; |
| | | action.Data.Data = data; |
| | | action.Data.ShortMsg = new("扫描标签", ShortMessage.Types.Normal); |
| | | //action.LocaleMsg = new($"请扫描第{dtl.PKG_LEVEL}层包装[{dtl.PkgType.PKG_NAME}]的标签条码"); |
| | | action.LocaleMsg = new("MES.WorkAction.PackingAction.PleaseScanLabel", dtl.PKG_LEVEL, dtl.PkgType.PKG_NAME); |
| | |
| | | data.PrintLable = LabelDic[dtl.PKG_LEVEL]; |
| | | CurCmd = data; |
| | | PrintTimes++; |
| | | action.Data.Data = data; |
| | | CurStep.Message = Biz.L("打印标签"); |
| | | CurStep.Status = StepStatus.Normal; |
| | | action.Data.Data = data; |
| | | action.Data.ShortMsg = new("打印标签", ShortMessage.Types.Normal); |
| | | //action.LocaleMsg = new Locale($"开始第{PrintTimes}次打印第{dtl.PKG_LEVEL}层包装[{dtl.PkgType.PKG_NAME}]的标签[{LabelDic[dtl.PKG_LEVEL]?.LABEL_CODE}: {LabelDic[dtl.PKG_LEVEL].LABEL_NAME}]"); |
| | | action.LocaleMsg = new Locale("MES.WorkAction.PackingAction.BeginPrint", PrintTimes, dtl.PKG_LEVEL, dtl.PkgType.PKG_NAME, LabelDic[dtl.PKG_LEVEL]?.LABEL_CODE, LabelDic[dtl.PKG_LEVEL].LABEL_NAME); |
| | |
| | | else |
| | | { |
| | | action.IsSuccessed = false; |
| | | CurStep.Message = Biz.L("称重失败"); |
| | | CurStep.Status = StepStatus.Error; |
| | | action.Data.Data = CurCmd; |
| | | action.Data.ShortMsg = new("称重失败", ShortMessage.Types.Failed); |
| | | //action.LocaleMsg = new($"外包装称重数据异常,请重新上称称重"); |
| | |
| | | data.ExecCode = "Weighing"; |
| | | data.PkgLevel = CurPkgItem.PKG_LEVEL; |
| | | CurCmd = data; |
| | | CurStep.Message = Biz.L("包装成功"); |
| | | CurStep.Status = StepStatus.Success; |
| | | action.Data.Data = data; |
| | | action.Data.ShortMsg = new("包装成功", ShortMessage.Types.Success); |
| | | //action.LocaleMsg = new($"请把包装[{CurPkgItem.Package.SN}]上称称重"); |
| | |
| | | data.ExecCode = "Scan"; |
| | | data.PkgLevel = dtl.PKG_LEVEL; |
| | | CurCmd = data; |
| | | CurStep.Message = Biz.L("扫描标签"); |
| | | CurStep.Status = StepStatus.Normal; |
| | | action.Data.Data = data; |
| | | action.Data.ShortMsg = new("扫描标签", ShortMessage.Types.Normal); |
| | | //action.LocaleMsg = new($"请扫描第{dtl.PKG_LEVEL}层包装[{dtl.PkgType.PKG_NAME}]的标签条码"); |
| | |
| | | data.PrintLable = LabelDic[dtl.PKG_LEVEL]; |
| | | CurCmd = data; |
| | | PrintTimes++; |
| | | CurStep.Message = Biz.L("打印标签"); |
| | | CurStep.Status = StepStatus.Normal; |
| | | action.Data.Data = data; |
| | | action.Data.ShortMsg = new("打印标签", ShortMessage.Types.Normal); |
| | | //action.LocaleMsg = new Locale($"开始第{PrintTimes}次打印第{min.PKG_LEVEL}层包装[{min.PkgType.PKG_NAME}]的标签[{LabelDic[min.PKG_LEVEL]?.LABEL_CODE}: {LabelDic[min.PKG_LEVEL].LABEL_NAME}]"); |
| | |
| | | data.ExecCode = "Weighing"; |
| | | data.PkgLevel = CurPkgItem.PKG_LEVEL; |
| | | CurCmd = data; |
| | | CurStep.Message = Biz.L("上称称重"); |
| | | CurStep.Status = StepStatus.Normal; |
| | | action.Data.Data = data; |
| | | action.Data.ShortMsg = new("上称称重", ShortMessage.Types.Success); |
| | | //action.LocaleMsg = new($"请把外包装上称称重"); |
| | |
| | | data.ExecCode = "Scan"; |
| | | data.PkgLevel = dtl.PKG_LEVEL; |
| | | CurCmd = data; |
| | | action.Data.Data = data; |
| | | CurStep.Message = Biz.L("扫描标签"); |
| | | CurStep.Status = StepStatus.Normal; |
| | | action.Data.Data = data; |
| | | action.Data.ShortMsg = new("扫描标签", ShortMessage.Types.Normal); |
| | | //action.LocaleMsg = new($"请扫描第{dtl.PKG_LEVEL}层包装[{dtl.PkgType.PKG_NAME}]的标签条码"); |
| | | action.LocaleMsg = new("MES.WorkAction.PackingAction.PleaseScanLabel", dtl.PKG_LEVEL, dtl.PkgType.PKG_NAME); |
| | |
| | | data.PrintLable = LabelDic[dtl.PKG_LEVEL]; |
| | | CurCmd = data; |
| | | PrintTimes++; |
| | | action.Data.Data = data; |
| | | CurStep.Message = Biz.L("打印标签"); |
| | | CurStep.Status = StepStatus.Normal; |
| | | action.Data.Data = data; |
| | | action.Data.ShortMsg = new("打印标签", ShortMessage.Types.Normal); |
| | | //action.LocaleMsg = new Locale($"开始第{PrintTimes}次打印第{dtl.PKG_LEVEL}层包装[{dtl.PkgType.PKG_NAME}]的标签[{LabelDic[dtl.PKG_LEVEL]?.LABEL_CODE}: {LabelDic[dtl.PKG_LEVEL].LABEL_NAME}]"); |
| | | action.LocaleMsg = new Locale("MES.WorkAction.PackingAction.BeginPrint", PrintTimes, dtl.PKG_LEVEL, dtl.PkgType.PKG_NAME, LabelDic[dtl.PKG_LEVEL]?.LABEL_CODE, LabelDic[dtl.PKG_LEVEL].LABEL_NAME); |
| | |
| | | //数据异常 |
| | | else |
| | | { |
| | | CurStep.Message = Biz.L("包装错误"); |
| | | CurStep.Status = StepStatus.Error; |
| | | action.Data.ShortMsg = new("包装错误", ShortMessage.Types.Error); |
| | | var pdtl = PkgRule.Details.First(q => q.PKG_LEVEL == pInput.PkgLevel); |
| | | action.IsSuccessed = false; |
| | |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | CurStep.Message = Biz.L("包装异常"); |
| | | CurStep.Status = StepStatus.Error; |
| | | action.Data.ShortMsg = new("包装异常", ShortMessage.Types.Exception); |
| | | var dtl = PkgRule.Details.First(q => q.PKG_LEVEL == pInput.PkgLevel); |
| | | action.CatchExceptionWithLog(ex, $"包装行为:扫描第{dtl.PKG_LEVEL}层包装[{dtl.PkgType.PKG_NAME}]的标签条码[{input.SN}]后保存数据失败"); |
| | |
| | | data.ExecCode = "Complete"; |
| | | data.PkgLevel = CurPkg.Item.PKG_LEVEL; |
| | | CurCmd = data; |
| | | CurStep.Message = Biz.L("保存包装数据"); |
| | | CurStep.Status = StepStatus.Normal; |
| | | action.Data.Data = data; |
| | | action.Data.ShortMsg = new("保存包装数据", ShortMessage.Types.Normal); |
| | | //action.LocaleMsg = new($"第{CurPkg.Item.PKG_LEVEL}层包装[{CurPkg.Item.PKG_NAME}]已经全部完成,保存包装数据"); |
| | |
| | | } |
| | | |
| | | IsFinished = true; |
| | | CurStep.Message = Biz.L("包装完成"); |
| | | CurStep.Status = StepStatus.Finished; |
| | | action.Data.ShortMsg = new("包装完成", ShortMessage.Types.Success); |
| | | |