服务端的TigerApi 框架,基于.NET6 2024 版本
Ben Lin
2024-10-11 67238bdfbeb1f06b9870133c9b9e86c45013fad2
Tiger.Business.MES/WorkAction/PackageInputCheck.cs
@@ -26,6 +26,7 @@
        public MES_CUST_SN FlowCSN  { get; set; }
        public List<mes_MOPickList> MoPickList { get; set; }
        public BAS_ITEM_CUST CustInfo { get; set; }
        public double U9Cost = 0;
        #endregion Propertys & Variables
        #region Functions
@@ -101,6 +102,22 @@
            }
            var wipSn = CurPosition.CurWipSNs.First();
            //判断当前条码是否在U9投产
            var begin = DateTime.Now;
            if (Biz.DataSource["YadaU9C"].Client.Queryable<mes_HisBoxBarCode>().Any(q => q.BarCode == wipSn.SN))
            {
                CurStep.Message = Biz.L("投料错误");
                CurStep.Status = StepStatus.Error;
                action.Data.ShortMsg = new("投料错误", ShortMessage.Types.Failed);
                action.IsSuccessed = false;
                //action.LocaleMsg = new($"投料错误,条码[{0}]已经在U9有投产记录,不允许在MES重复投入");
                action.LocaleMsg = new("MES.WorkAction.PackageInputCheck.U9HasHistory", wipSn.SN);
                //重置工序操作
                CurPosition.ResetNode();
                return action;
            }
            U9Cost = (DateTime.Now - begin).TotalSeconds;
            FlowCSN = Biz.Db.Queryable<MES_CUST_SN>().Where(q => q.FLOW_SN == wipSn.SN || q.CUST_SN == wipSn.SN).First();
            //找不到生产记录,认为扫描错误
            if (FlowCSN.IsNullOrEmpty())
@@ -173,8 +190,8 @@
            //更新厂内流程码
            FlowCSN.CUST_CODE = CurPosition.WorkBatch.WO.CUST_CODE;
            FlowCSN.WORK_ORDER = CurPosition.WorkBatch.WO.ORDER_NO;
            FlowCSN.ITEM_CODE = CurPosition.WorkBatch.WO.ITEM_CODE;
            FlowCSN.PKG_ORDER = CurPosition.WorkBatch.WO.ORDER_NO;
            FlowCSN.PROD_CODE = CurPosition.WorkBatch.WO.ITEM_CODE;
            //记录行为操作记录
            var wipActs = new List<MES_WIP_ACT>();
@@ -229,7 +246,8 @@
                    ACT_TYPE = NodeAct.ACT_TYPE,
                    ACT_SN = wipSn.SN,
                    ACT_RESULT = "Y",
                    TRACE_INFO = $"条码[{wipSn.SN}]可以在工单[{wipSn.WORK_ORDER}]投料生产",
                    ELAPSED_TIME = CurStep.GetElapsedTime().TotalMilliseconds.ToInt64(),
                    TRACE_INFO = $"条码[{wipSn.SN}]可以在工单[{wipSn.WORK_ORDER}]投料生产,其中U9检查耗时{U9Cost:0.0000}秒",
                };
                wipActs.Add(wipAct);
            }