服务端的TigerApi 框架,基于.NET6 2024 版本
Ben Lin
2024-08-07 06940a626353664dbb6e567f97cbe35a9774b098
Tiger.Business.MES/Transaction/PackingNode.cs
@@ -304,6 +304,40 @@
                            wipSN.DFT_FLAG = "Y";
                            wipSN.DFT_COUNT++;
                            wipSN.DFT_CODE = input.DFT_CODE;
                            var dft = CurBatch.Defects.FirstOrDefault(q => q.DFT_CODE == wipSN.DFT_CODE);
                            var defect = new MES_WIP_DFT()
                            {
                                AUTH_ORG = wipSN.AUTH_ORG,
                                AUTH_PROD = wipSN.LINE_CODE,
                                SN = wipSN.SN,
                                STATUS = MES_WIP_DFT.STATUSs.WaitHandle.GetValue(),
                                ITEM_CODE = wipSN.ITEM_CODE,
                                WORK_ORDER = wipSN.WORK_ORDER,
                                BATCH_NO = wipSN.BATCH_NO,
                                ROT_CODE = wipSN.ROT_CODE,
                                NODE_ID = wipSN.NODE_ID,
                                NODE_NAME = wipSN.NODE_NAME,
                                FTY_CODE = wipSN.FTY_CODE,
                                WS_CODE = wipSN.WS_CODE,
                                LINE_CODE = wipSN.LINE_CODE,
                                POST_CODE = wipSN.POST_CODE,
                                OPER_CODE = wipSN.OPER_CODE,
                                SEGMENT = wipSN.SEGMENT,
                                DFT_CODE = dft.DFT_CODE,
                                DFT_NAME = dft.DFT_NAME,
                                DFT_LEVEL = dft.DFT_LEVEL,
                                TRAY_SN = wipSN.TRAY_SN,
                                CONTAINER_SN = wipSN.CONTAINER_SN,
                                PALLET_SN = wipSN.PALLET_SN,
                                INV_FLAG = wipSN.INV_FLAG,
                                OPERATION_TIME = DateTime.Now,
                                SFTS_CODE = wipSN.SFTS_CODE,
                                SFT_CODE = wipSN.SFT_CODE,
                                PRD_CODE = wipSN.PRD_CODE,
                                OBA_BATCH = wipSN.OBA_BATCH,
                                LOCK_BATCH = wipSN.LOCK_BATCH,
                            };
                            CurDefects.Add(defect);
                        }
                    }
@@ -330,6 +364,11 @@
                           db.Storageable(woSNs, UserCode).ExecuteCommand();
                           db.Storageable(wipSNs, UserCode).ExecuteCommand();
                           db.Storageable(CurWipSNHiss, UserCode).ExecuteCommand();
                            //如果有不良则保存
                            if (CurDefects.Any())
                            {
                                db.Storageable(CurDefects, UserCode).ExecuteCommand();
                            }
                            //如果是投入站
                            if (curNode.IS_INPUT == "Y")
                            {
@@ -376,7 +415,6 @@
                //未完成所有工步
                if (!IsFinishAllSteps)
                {
                    var result = new ApiAction<SubmitOutput>(new SubmitOutput());
                    //未完成所有工序节点工步
                    if (!IsFinishNodeSteps)
                    {
@@ -385,14 +423,14 @@
                        NextSteps.Clear();
                        NextSteps.Add(next);
                        //根据后续工步返回ApiAction
                        result.Data.SetValue(CurBatch, CurStep, next.ID, IsFinishAllSteps);
                        action.Data.SetValue(CurBatch, CurStep, next.ID, IsFinishAllSteps);
                        //根据工序节点工步的序号返回相应的操作提示
                        switch (next.Sequence)
                        {
                            case 2:
                                //action.LocaleMsg = new($"请执行第二步");
                                result.LocaleMsg = new("MES.Transaction.CollectNode.第二步操作提示");
                                action.LocaleMsg = new("MES.Transaction.CollectNode.第二步操作提示");
                                break;
                            default:
                                break;
@@ -401,12 +439,11 @@
                    //已完成所有工序节点工步,开始执行行为工步
                    else
                    {
                        result = BeginNextActionStep(input);
                        action = BeginNextActionStep(input);
                    }
                    return result;
                }
                //已完成所有工步
                else
                if (IsFinishAllSteps)
                {
                    action.Data.SetValue(CurBatch, CurStep, "", IsFinishAllSteps);
                    action = DoIfFinishAllSteps(action);
@@ -435,7 +472,11 @@
            //action.LocaleMsg = new($"工单[{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", CurWipSNs.First().WORK_ORDER, CurSN, CurWipSNs.First().POST_CODE, CurWipSNs.First().NODE_NAME,CurWipSNs.First().STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>());
            //重置工序
            ResetNode();
            //if (!isClone)
            {
                ResetNode();
            }
            return action;
        }