服务端的TigerApi 框架,基于.NET6 2024 版本
Rodney Chen
2024-08-10 f12084241b438c025550d4f9337935abf9a52c81
Tiger.Business.MES/WorkAction/PackingAction.cs
@@ -194,15 +194,8 @@
                case "Scan":
                    if (CurCmd.IsNullOrEmpty() || CurCmd.ExecCode == "Scan" || (CurCmd.ExecCode == "Print" && CurCmd.PkgLevel == pInput.PkgLevel))
                    {
                        //客户端扫描成功
                        if (pInput.IsFinish)
                        {
                            CurCmd = null;
                            PrintTimes = 0;
                            action = SavePkgData(input, action);
                        }
                        //客户端扫描失败
                        else
                        if (!pInput.IsFinish || pInput.PkgSN.IsNullOrEmpty())
                        {
                            var dtl = PkgRule.Details.First(q => q.PKG_LEVEL == pInput.PkgLevel);
                            action.IsSuccessed = false;
@@ -210,6 +203,19 @@
                            action.LocaleMsg = new("MES.WorkAction.PackingAction.ScanFail", dtl.PKG_LEVEL, dtl.PkgType.PKG_NAME);
                            return action;
                        }
                        //验证当前包装条码是否已经被扫描过
                        if (GetPackageList(CurPkg.Item).Any(q => q.SN == pInput.PkgSN))
                        {
                            var dtl = PkgRule.Details.First(q => q.PKG_LEVEL == pInput.PkgLevel);
                            action.IsSuccessed = false;
                            //action.LocaleMsg = new($"条码[{pInput.PkgSN}]无需重复扫描,请扫描第{dtl.PKG_LEVEL}层包装[{dtl.PkgType.PKG_NAME}]的标签条码");
                            action.LocaleMsg = new("MES.WorkAction.PackingAction.ScanRepeat", pInput.PkgSN, dtl.PKG_LEVEL, dtl.PkgType.PKG_NAME);
                            return action;
                        }
                        //客户端扫描成功
                        CurCmd = null;
                        PrintTimes = 0;
                        action = SavePkgData(input, action);
                    }
                    break;
                //Print:打印,打印当前包装层级的标签
@@ -344,6 +350,7 @@
                            AUTH_ORG = CurPosition.WorkBatch.WO.AUTH_ORG,
                            AUTH_PROD = CurPosition.CurLine.LINE_CODE,
                            SN = pInput.PkgSN,
                            WIP_ID = CurPosition.CurWipSNs.Count == 1 ? CurPosition.CurWipSNs.First().ID : null,
                            PKG_TYPE = dtl.PkgType.PKG_NAME,
                            ITEM_CODE = CurPosition.CurWipSNs.First().ITEM_CODE,
                            QTY = CurPosition.CurWipSNs.First().QTY,
@@ -543,6 +550,7 @@
                {
                    AUTH_ORG = CurPosition.WorkBatch.WO.AUTH_ORG,
                    AUTH_PROD = CurPosition.CurLine.LINE_CODE,
                    WIP_ID = wipSn.ID,
                    HIS_ID = CurPosition.CurWipSNHiss.First(q => q.SN == wipSn.SN).ID,
                    SN = wipSn.SN,
                    STATUS = wipSn.STATUS,
@@ -560,7 +568,11 @@
                    POST_CODE = wipSn.POST_CODE,
                    OPER_CODE = wipSn.OPER_CODE,
                    SEGMENT = wipSn.SEGMENT,
                    FLOW_SN = wipSn.FLOW_SN,
                    TRAY_SN = wipSn.TRAY_SN,
                    INNER_SN = wipSn.INNER_SN,
                    CARTON_SN = wipSn.CARTON_SN,
                    PALLET_SN = wipSn.PALLET_SN,
                    OPERATION_TIME = DateTime.Now,
                    SFTS_CODE = wipSn.SFTS_CODE,
                    SFT_CODE = wipSn.SFT_CODE,
@@ -589,7 +601,7 @@
                        //包装信息保存到在制品信息表
                        db.Updateable<MES_WIP_DATA>()
                            .SetColumns(q => q.TRAY_SN == CurPkg.Item.Package.SN)
                            .SetColumns(q => q.CONTAINER_SN == q.CARTON_SN)
                            .SetColumns(q => q.INNER_SN == q.CARTON_SN)
                            .SetColumns(q => q.CARTON_SN == CurPkg.Item.Package.SN)
                            .Where(q => q.WORK_ORDER == pkg.WORK_ORDER && q.SN == pkg.SN)
                            .ExecuteCommand();