服务端的TigerApi 框架,基于.NET6 2024 版本
Ben Lin
2024-07-18 533e496149c1103bb8a418b785b1394462eac26e
Tiger.Business.MES/Transaction/CollectNode.cs
@@ -79,16 +79,16 @@
                            if (CurBatch.IsNullOrEmpty())
                            {
                                action.IsSuccessed = false;
                                action.LocaleMsg = new($"未选择工单,请先选择要生产的工单");
                                //action.LocaleMsg = new("MES.Transaction.CollectNode.Submit.NotSelectOrderException");
                                //action.LocaleMsg = new($"未选择工单,请先选择要生产的工单");
                                action.LocaleMsg = new("MES.Transaction.CollectNode.Submit.NotSelectOrderException");
                                return action;
                            }
                            //有当前工单且不是投入,则提示条码未投入生产,请先去首站扫描
                            else
                            {
                                action.IsSuccessed = false;
                                action.LocaleMsg = new($"条码[{input.SN}]尚未投入生产,请先去首站扫描", input.SN);
                                //action.LocaleMsg = new("MES.Transaction.CollectNode.Submit.NotInputException", input.SN);
                                //action.LocaleMsg = new($"条码[{input.SN}]尚未投入生产,请先去首站扫描", input.SN);
                                action.LocaleMsg = new("MES.Transaction.CollectNode.Submit.NotInputException", input.SN);
                                return action;
                            }
                        }
@@ -115,8 +115,8 @@
                //没有可执行的工步
                ResetSteps();
                action.IsSuccessed = false;
                action.LocaleMsg = new($"岗位[{CurPosition.POST_CODE}]工步执行异常,请重新扫描产品条码", CurPosition.POST_CODE);
                //action.LocaleMsg = new("MES.Transaction.CollectNode.Submit.WorkStepException", CurPosition.POST_CODE);
                //action.LocaleMsg = new($"岗位[{CurPosition.POST_CODE}]工步执行异常,请重新扫描产品条码", CurPosition.POST_CODE);
                action.LocaleMsg = new("MES.Transaction.CollectNode.Submit.WorkStepException", CurPosition.POST_CODE);
            }
            catch (Exception ex)
            {
@@ -204,11 +204,11 @@
                    wipSN.DFT_CODE = input.DFT_CODE;
                }
                var wipSnHis = new MES_WIP_HIS(CurWipSN = wipSN, $"工单[{wipSN.WORK_ORDER}]条码[{wipSN.SN}]在岗位[{wipSN.POST_CODE}]过站工序[{wipSN.NODE_NAME}]成功");
                CurWipSNHis = new MES_WIP_HIS(CurWipSN = wipSN, $"工单[{wipSN.WORK_ORDER}]条码[{wipSN.SN}]在岗位[{wipSN.POST_CODE}]过站工序[{wipSN.NODE_NAME}]成功");
                //初始化工步列表
                Steps.Clear();
                var curStep = new Biz.WorkStep(curNode.ID, Biz.WorkStep.Types.Node)
                var curStep = new Biz.WorkStep(curNode.ID, IWorkStep.Types.Node)
                {
                    Sequence = Steps.Count + 1,
                    Node = curNode,
@@ -217,7 +217,7 @@
                        var db = GetCommitDB();
                        db.Storageable(woSN, UserCode).ExecuteCommand();
                        db.Storageable(wipSN, UserCode).ExecuteCommand();
                        db.Storageable(wipSnHis, UserCode).ExecuteCommand();
                        db.Storageable(CurWipSNHis, UserCode).ExecuteCommand();
                    }
                };
                Steps.Add(curStep);
@@ -226,7 +226,7 @@
                var acts = CurBatch.NodeActs.Where(q => q.NODE_ID == curNode.ID).ToList();
                foreach (var act in acts)
                {
                    Steps.Add(new Biz.WorkStep(act.ID, Biz.WorkStep.Types.Action)
                    Steps.Add(new Biz.WorkStep(act.ID, IWorkStep.Types.Action)
                    {
                        Sequence = Steps.Count + 1,
                        Node = curNode,
@@ -235,6 +235,8 @@
                    });
                }
                //完成当前工序节点
                curStep.IsFinished = true;
                //未完成所有工步
                if (!IsFinishAllSteps)
                {
@@ -280,8 +282,8 @@
                throw dbTran.ErrorException;
            }
            //保存成功,返回过站消息
            action.LocaleMsg = new($"工单[{CurWipSN.WORK_ORDER}]的条码[{CurWipSN.SN}]在岗位[{CurWipSN.POST_CODE}]工序[{CurWipSN.NODE_NAME}]过站成功,状态[{CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()}]", CurWipSN.WORK_ORDER, CurWipSN.SN, CurWipSN.POST_CODE, CurWipSN.NODE_NAME, CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>());
            //action.LocaleMsg = new("MES.Transaction.CollectNode.ScanSn.PassSuccess", CurWipSN.WORK_ORDER, CurWipSN.SN, CurWipSN.POST_CODE, CurWipSN.NODE_NAME CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>());
            //action.LocaleMsg = new($"工单[{CurWipSN.WORK_ORDER}]的条码[{CurWipSN.SN}]在岗位[{CurWipSN.POST_CODE}]工序[{CurWipSN.NODE_NAME}]过站成功,状态[{CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()}]", CurWipSN.WORK_ORDER, CurWipSN.SN, CurWipSN.POST_CODE, CurWipSN.NODE_NAME, CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>());
            action.LocaleMsg = new("MES.Transaction.CollectNode.ScanSn.PassSuccess", CurWipSN.WORK_ORDER, CurWipSN.SN, CurWipSN.POST_CODE, CurWipSN.NODE_NAME,CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>());
            return action;
        }
        #endregion Functions