服务端的TigerApi 框架,基于.NET6 2024 版本
Rodney Chen
2024-10-09 65369be5502820d6367beab53e33fe3645f23a06
Tiger.Business.MES/Transaction/PackingNode.cs
@@ -253,6 +253,15 @@
            var curNode = CurBatch.GetNode(PostCode);
            try
            {
                //工序节点逻辑增加如果根基当前岗位找不到对应工序的时候要报错
                if (curNode.IsNullOrEmpty())
                {
                    action.Data.ShortMsg = new("未知工序", ShortMessage.Types.Error);
                    action.IsSuccessed = false;
                    //action.LocaleMsg = new($"岗位[{0}]在工单[{1}]工艺路线中找不到对应的工序,请检查工单工艺路线中工序与岗位的绑定关系是否正确");
                    action.LocaleMsg = new("MES.Transaction.PackingNode.NodeSubmit.OperateNodeError", PostCode, CurBatch.WO.ORDER_NO);
                    return action;
                }
                //当工步列表为空,则执行当前工序的必要逻辑当作第一个工序节点,完成后按需求创建后续的工步列表
                if (Steps.IsNullOrEmpty())
                {
@@ -615,14 +624,11 @@
                {
                    if (Context.ContainsKey("CurPackage"))
                    {
                        var CurPkg = Context["CurPackage"] as WipPkg;
                        int shipQty = input.Data.ToInt32();
                        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();
                        //有填出货数量则验证当前包装数量必须等于(出货数量/包装规则数量)的余数
@@ -633,7 +639,13 @@
                            action.LocaleMsg = new("MES.Transaction.PackingNode.NotMatchShipQty", shipQty, curQty, shipQty % ruleQty); 
                            return action;
                        }
                        NodeCmd = "PkgSubmit";
                        action = TempPkgAction.Submit(null);
                        if (!action.IsSuccessed)
                        {
                            NodeCmd = null;
                        }
                    }
                    else
                    {
@@ -660,6 +672,7 @@
            catch (Exception ex)
            {
                action.CatchExceptionWithLog(ex, $"包装工序:手动结束包装异常");
                NodeCmd = null;
            }
            return action;
        }