Merge branch 'master' into master_ben
| | |
| | | var action = new ApiAction<SubmitOutput>(new SubmitOutput()); |
| | | try |
| | | { |
| | | if (input.Qty.ToInt32() <= 0) |
| | | { |
| | | action.Data.ShortMsg = new("请输入包装数量", ShortMessage.Types.Error); |
| | | action.Data.OperInfo = new(); |
| | | action.Data.Data = "QtyError"; |
| | | action.IsSuccessed = false; |
| | | action.LocaleMsg = new($"包装数量[{input.Qty}]不正确,请重新输入数量后继续包装操作"); |
| | | //action.LocaleMsg = new("MES.Transaction.PackingNode.Submit.QtyError", input.Qty); |
| | | return action; |
| | | } |
| | | //PkgSubmit:手动结束包装,手动保存暂存的包装数据 |
| | | if (NodeCmd == "PkgSubmit") |
| | | { |
| | |
| | | { |
| | | TempPkgAction = new PackingAction(); |
| | | TempPkgAction.Init(this); |
| | | |
| | | var CurPkg = Context["CurPackage"] as WipPkg; |
| | | int shipQty = input.Data.ToInt32(); |
| | | int curQty = CurPkg.Item.TotalQty; |
| | | int ruleQty = TempPkgAction.PkgRule.GetTotalQty(); |
| | | //有填出货数量则验证当前包装数量必须等于(出货数量/包装规则数量)的余数 |
| | | if (shipQty > 0 && curQty != shipQty % ruleQty) |
| | | { |
| | | action.IsSuccessed = false; |
| | | //action.LocaleMsg = new($"出货数量设定为[{0}],目前包装了[{1}],包装尾数的数量必需是[{2}],请装够数量后再结束包装"); |
| | | action.LocaleMsg = new("MES.Transaction.PackingNode.NotMatchShipQty", shipQty, curQty, shipQty % ruleQty); |
| | | return action; |
| | | } |
| | | |
| | | NodeCmd = "PkgSubmit"; |
| | | action = TempPkgAction.Submit(null); |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using Tiger.Business.MES.Transaction; |
| | | using Tiger.IBusiness; |
| | | using Tiger.IBusiness.MES.WorkAction; |
| | | using Tiger.Model; |
| | |
| | | data.ExecCode = "Print"; |
| | | data.PkgLevel = min.PKG_LEVEL; |
| | | data.PrintLable = LabelDic[min.PKG_LEVEL]; |
| | | data.RealPrint = data.PkgLevel != CurPkg.Item.PKG_LEVEL || CurPosition is not YadaPacking || (CurPosition as YadaPacking).IsPrintCustomerLabel; |
| | | CurCmd = data; |
| | | PrintTimes++; |
| | | CurStep?.SetStatusMessage(StepStatus.Normal, Biz.L("打印标签")); |
| | |
| | | data.ExecCode = "Print"; |
| | | data.PkgLevel = dtl.PKG_LEVEL; |
| | | data.PrintLable = LabelDic[dtl.PKG_LEVEL]; |
| | | data.RealPrint = data.PkgLevel != CurPkg.Item.PKG_LEVEL || CurPosition is not YadaPacking || (CurPosition as YadaPacking).IsPrintCustomerLabel; |
| | | CurCmd = data; |
| | | PrintTimes++; |
| | | CurStep?.SetStatusMessage(StepStatus.Normal, Biz.L("打印标签")); |
| | |
| | | data.ExecCode = "Print"; |
| | | data.PkgLevel = dtl.PKG_LEVEL; |
| | | data.PrintLable = LabelDic[dtl.PKG_LEVEL]; |
| | | data.RealPrint = data.PkgLevel != CurPkg.Item.PKG_LEVEL || CurPosition is not YadaPacking || (CurPosition as YadaPacking).IsPrintCustomerLabel; |
| | | CurCmd = data; |
| | | PrintTimes++; |
| | | CurStep?.SetStatusMessage(StepStatus.Normal, Biz.L("打印标签")); |
| | |
| | | data.ExecCode = "Print"; |
| | | data.PkgLevel = dtl.PKG_LEVEL; |
| | | data.PrintLable = LabelDic[dtl.PKG_LEVEL]; |
| | | data.RealPrint = data.PkgLevel != CurPkg.Item.PKG_LEVEL || CurPosition is not YadaPacking || (CurPosition as YadaPacking).IsPrintCustomerLabel; |
| | | CurCmd = data; |
| | | PrintTimes++; |
| | | CurStep?.SetStatusMessage(StepStatus.Normal, Biz.L("打印标签")); |
| | |
| | | ACT_TYPE = NodeAct.ACT_TYPE, |
| | | ACT_SN = wipSn.SN, |
| | | ACT_RESULT = "Y", |
| | | ACT_VALUE_1 = CurPkg.IsFinished ? "Y" : "N", |
| | | ACT_VALUE_2 = CurPkg.ToJson(), |
| | | ACT_VALUE_3 = CurPkg.IsFinished ? LabelDic[CurPkg.Item.PKG_LEVEL].ToJson() : "", |
| | | ELAPSED_TIME = CurStep.GetElapsedTime().TotalMilliseconds.ToInt64(), |
| | | TRACE_INFO = $"产品条码[{string.Join(",", CurPosition.CurSN)}]包装完成", |
| | | }; |
| | |
| | | #endregion |
| | | public BAS_LABEL_TEMP Label { get; set; } |
| | | public List<BAS_LABEL_PV> LabelPV { get; set; } |
| | | public bool NoNeedInStorePrint { get; set; } |
| | | #endregion Propertys & Variables |
| | | |
| | | #region Functions |
| | |
| | | { |
| | | var action = new ApiAction<SubmitOutput>(new SubmitOutput()); |
| | | |
| | | if (CurPosition is YadaPacking && !(CurPosition as YadaPacking).IsPrintCustomerLabel) |
| | | NoNeedInStorePrint = (!CurPosition.Context.ContainsKey("CurPackage") || !(CurPosition.Context["CurPackage"] as WipPkg).IsFinished) |
| | | || (CurPosition is YadaPacking && (CurPosition as YadaPacking).IsPrintCustomerLabel); |
| | | if (NoNeedInStorePrint) |
| | | { |
| | | action = End(input); |
| | | } |
| | |
| | | ACT_VALUE_2 = Label.Variables.ToJson(), |
| | | ACT_RESULT = "Y", |
| | | ELAPSED_TIME = CurStep.GetElapsedTime().TotalMilliseconds.ToInt64(), |
| | | TRACE_INFO = $"标签{Label.LABEL_NAME}[{Label.LABEL_CODE}]打印成功", |
| | | TRACE_INFO = NoNeedInStorePrint ? $"无需打印入库标签" : $"标签{Label.LABEL_NAME}[{Label.LABEL_CODE}]打印成功", |
| | | }; |
| | | if (CurPosition is YadaPacking && !(CurPosition as YadaPacking).IsPrintCustomerLabel) |
| | | { |
| | | wipAct.TRACE_INFO = $"无需打印入库标签"; |
| | | } |
| | | wipActs.Add(wipAct); |
| | | } |
| | | |
| | |
| | | }; |
| | | |
| | | IsFinished = true; |
| | | if (NoNeedInStorePrint) |
| | | { |
| | | CurStep.Message = Biz.L("无需打印"); |
| | | 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); |
| | | } |
| | | else |
| | | { |
| | | 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($"入库标签{0}[{1}打印成功"); |
| | | action.LocaleMsg = new("MES.WorkAction.PrintInStoreLabel.PrintSuccess", Label.LABEL_NAME, Label.LABEL_CODE); |
| | | } |
| | | return action; |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | public int PkgLevel { get; set; } |
| | | /// <summary> |
| | | /// 是否需要 |
| | | /// </summary> |
| | | public bool RealPrint { get; set; } = true; |
| | | /// <summary> |
| | | /// 当前需要打印的包装层级的标签信息 |
| | | /// </summary> |
| | | public BAS_LABEL_TEMP PrintLable { get; set; } |