服务端的TigerApi 框架,基于.NET6 2024 版本
Rodney Chen
2024-07-16 415d9d76d0f73f804c7ac9e51591bd15c7d84517
Tiger.Business.MES/Transaction/Position.cs
@@ -54,6 +54,7 @@
        public WorkBatch CurBatch { get; set; }
        public IWorkBatch WorkBatch => CurBatch;
        public MES_WIP_DATA CurWipSN { get; set; }
        public MES_WIP_HIS CurWipSNHis { get; set; }
        public List<WorkStep> Steps { get; set; } = new();
        public bool IsFinishAllSteps => Steps.Any() && !Steps.Any(q => !q.IsFinished);
        public int CurStep => Steps.Where(q => !q.IsFinished).OrderBy(q => q.Sequence).FirstOrDefault()?.Sequence ?? 0;
@@ -86,23 +87,23 @@
                    if (wo.IsNullOrEmpty())
                    {
                        action.IsSuccessed = false;
                        action.LocaleMsg = new($"工单[{input.OrderNo}]不存在", input.OrderNo);
                        //action.LocaleMsg = new("MES.Transaction.Position.SelectOrder.EmptyException", input.OrderNO);
                        //action.LocaleMsg = new($"工单[{input.OrderNo}]不存在", input.OrderNo);
                        action.LocaleMsg = new("MES.Transaction.Position.SelectOrder.EmptyException", input.OrderNo);
                        return action;
                    }
                    if (wo.STATUS != BIZ_MES_WO.STATUSs.Release.GetValue() && wo.STATUS != BIZ_MES_WO.STATUSs.Working.GetValue())
                    {
                        action.IsSuccessed = false;
                        action.LocaleMsg = new($"工单[{input.OrderNo}]状态[{wo.STATUS.GetEnum<BIZ_MES_WO.STATUSs>().GetName()}]不能生产");
                        //action.LocaleMsg = new("MES.Transaction.Position.SelectOrder.StatusException", input.OrderNO, query.STATUS.GetEnum<BIZ_MES_WO.STATUSs>().GetName());
                        //action.LocaleMsg = new($"工单[{input.OrderNo}]状态[{wo.STATUS.GetEnum<BIZ_MES_WO.STATUSs>().GetName()}]不能生产");
                        action.LocaleMsg = new("MES.Transaction.Position.SelectOrder.StatusException", input.OrderNo, wo.STATUS.GetEnum<BIZ_MES_WO.STATUSs>().GetName());
                        return action;
                    }
                    var batch = await Biz.Db.Queryable<BIZ_MES_WO_BATCH>().ByAuth(input.AuthOption).Where(q => q.ORDER_NO == input.OrderNo && q.ACT_LINE == CurLine.LINE_CODE).FirstAsync();
                    if (batch.IsNullOrEmpty())
                    {
                        action.IsSuccessed = false;
                        action.LocaleMsg = new($"工单[{input.OrderNo}]没有下发到产线状态[{CurLine.LINE_CODE}]");
                        //action.LocaleMsg = new("MES.Transaction.Position.SelectOrder.LineException", input.OrderNO, CurLine.LINE_CODE);
                        //action.LocaleMsg = new($"工单[{input.OrderNo}]没有下发到产线状态[{CurLine.LINE_CODE}]");
                        action.LocaleMsg = new("MES.Transaction.Position.SelectOrder.LineException", input.OrderNo, CurLine.LINE_CODE);
                        return action;
                    }
                    var wb = new WorkBatch(input.OrderNo).Init(CurLine.LINE_CODE);