服务端的TigerApi 框架,基于.NET6 2024 版本
Rodney Chen
2024-10-14 76e5a482a1be93af036ff6d75d367c7401810682
Tiger.Business.MES/Transaction/Position.cs
@@ -102,7 +102,7 @@
            var action = new ApiAction();
            try
            {
                if (!WoContext.ExistsBatch(input.OrderNo, CurLine.LINE_CODE, batchNo))
                if (!WoContext.ExistsBatch(input.OrderNo, CurLine.LINE_CODE, batchNo, true))
                {
                    var wo = await Biz.Db.Queryable<BIZ_MES_WO>().ByAuth(input.AuthOption).Where(q => q.ORDER_NO == input.OrderNo).FirstAsync();
                    //验证明细是否正确
@@ -116,7 +116,7 @@
                    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($"工单[{0}]状态[{1}]不能生产");
                        action.LocaleMsg = new("MES.Transaction.Position.SelectOrder.StatusException", input.OrderNo, wo.STATUS.GetEnum<BIZ_MES_WO.STATUSs>().GetName());
                        return action;
                    }
@@ -134,8 +134,8 @@
                    if (batch.STATUS != BIZ_MES_WO_BATCH.STATUSs.Release.GetValue() && batch.STATUS != BIZ_MES_WO_BATCH.STATUSs.Working.GetValue())
                    {
                        action.IsSuccessed = false;
                        //action.LocaleMsg = new($"工单[{input.OrderNo}]状态[{wo.STATUS.GetEnum<BIZ_MES_WO_BATCH.STATUSs>().GetName()}]不能生产");
                        action.LocaleMsg = new("MES.Transaction.Position.SelectOrder.StatusException", input.OrderNo, batch.STATUS.GetEnum<BIZ_MES_WO_BATCH.STATUSs>().GetName());
                        //action.LocaleMsg = new($"工单[{0}]批次[1]状态[{2}]不能生产");
                        action.LocaleMsg = new("MES.Transaction.Position.SelectOrder.BatchStatusException", input.OrderNo, batch.BATCH_NO, batch.STATUS.GetEnum<BIZ_MES_WO_BATCH.STATUSs>().GetName());
                        return action;
                    }
                    var wb = new WorkBatch(input.OrderNo).Init(CurLine.LINE_CODE);
@@ -225,7 +225,12 @@
            if (CurWipSNs.Any())
            {
                info.CurNode = CurWipSNs.First().NODE_NAME;
                info.NextNode = string.Join(",", CurBatch.GetNextNodes(CurWipSNs.First()).Select(q => q.NODE_NAME));
                var nextNodes = CurBatch.GetNextNodes(CurWipSNs.First());
                info.NextNode = string.Join(",", nextNodes.Select(q => q.NODE_NAME));
                if (nextNodes.Count == 1 && nextNodes.Single().OPER_CODE == "EndNode")
                {
                    info.IsReachedEndNode = true;
                }
            }
            else
            {
@@ -587,15 +592,15 @@
                                    }
                                    return $"{qtylist.Count}PCS";
                                case "GetModel":
                                    return GetLabelVarWo(lv, WorkBatch.Product.ExtInfo.Model);
                                case "GetInput":
                                    return GetLabelVarWo(lv, WorkBatch.Product.ExtInfo.Input);
                                case "GetOutput":
                                    return GetLabelVarWo(lv, WorkBatch.Product.ExtInfo.OutPut);
                                case "GetPower":
                                    return GetLabelVarWo(lv, WorkBatch.Product.ExtInfo.Power);
                                case "GetAccuracy":
                                    return GetLabelVarWo(lv, WorkBatch.Product.ExtInfo.Accuracy);
                                    return GetLabelVarWo(lv, WorkBatch.Product.ExtInfo?.Model);
                                case "GetInput":
                                    return GetLabelVarWo(lv, WorkBatch.Product.ExtInfo?.Input);
                                case "GetOutput":
                                    return GetLabelVarWo(lv, WorkBatch.Product.ExtInfo?.OutPut);
                                case "GetPower":
                                    return GetLabelVarWo(lv, WorkBatch.Product.ExtInfo?.Power);
                                case "GetAccuracy":
                                    return GetLabelVarWo(lv, WorkBatch.Product.ExtInfo?.Accuracy);
                                case "GetVarByWo":
                                    return GetLabelVarWo(lv, "");
                                default: