服务端的TigerApi 框架,基于.NET6 2024 版本
Rodney Chen
2024-10-18 c827cf7fe5e4561dbb8424f6d423200f2f03caa4
Tiger.Business.MES/Transaction/Position.cs
@@ -117,7 +117,7 @@
                    {
                        action.IsSuccessed = false;
                        //action.LocaleMsg = new($"工单[{0}]状态[{1}]不能生产");
                        action.LocaleMsg = new("MES.Transaction.Position.SelectOrder.StatusException", input.OrderNo, wo.STATUS.GetEnum<BIZ_MES_WO.STATUSs>().GetName());
                        action.LocaleMsg = new("MES.Transaction.Position.SelectOrder.StatusException", input.OrderNo, wo.STATUS.GetEnumDesc<BIZ_MES_WO.STATUSs>());
                        return action;
                    }
                    var batch = await Biz.Db.Queryable<BIZ_MES_WO_BATCH>().ByAuth(input.AuthOption)
@@ -135,7 +135,7 @@
                    {
                        action.IsSuccessed = false;
                        //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());
                        action.LocaleMsg = new("MES.Transaction.Position.SelectOrder.BatchStatusException", input.OrderNo, batch.BATCH_NO, batch.STATUS.GetEnumDesc<BIZ_MES_WO_BATCH.STATUSs>());
                        return action;
                    }
                    var wb = new WorkBatch(input.OrderNo).Init(CurLine.LINE_CODE);
@@ -557,6 +557,10 @@
                                    return WorkBatch.Product.ITEM_NAME;
                                case "GetCustomer":
                                    return WorkBatch.Batch.Customer.ToJson();
                                case "GetSalesOrder":
                                    return WorkBatch.WO.SALES_ORDER;
                                case "GetPackNumber":
                                    return WorkBatch.WO.ORDER_NO;
                                case "GetBoxQR":
                                    return action is PackingAction ? GetBoxCode(lvars, action as PackingAction) : "";
                                case "GetCardQR":
@@ -576,7 +580,7 @@
                                case "GetPAndO":
                                    return WorkBatch.WO.SALES_CONTRACT;
                                case "GetLTD":
                                    return WorkBatch.Batch.Customer.CUST_NAME_CN;
                                    return WorkBatch.WO.Customer?.CUST_NAME_CN;
                                case "GetHWDate":
                                    List<string> list = new List<string>();
                                    var _action = action is PackingAction ? action as PackingAction : null;
@@ -606,13 +610,19 @@
                                case "GetVarByWo":
                                    return GetLabelVarWo(lv, "");
                                case "GetLOTNO":
                                    string _lotnos = "";
                                    var _orderAction = action is PackingAction ? action as PackingAction : null;
                                    if (_orderAction != null)
                                    {
                                        var snList = _orderAction.GetMinPackageList(_orderAction.CurPkg.Item).Select(q => q.FLOW_SN);
                                        return string.Join(",", Biz.Db.Queryable<MES_CUST_SN>()
                                                .Where((q) => snList.Contains(q.FLOW_SN))
                                                .Select((q) => q.WORK_ORDER).Distinct());
                                        var snList = _orderAction.GetMinPackageList(_orderAction.CurPkg.Item).Select(q => q.FLOW_SN).ToList();
                                        if (!snList.Any())
                                        {
                                            snList.Add(_orderAction.CurPkg.CustSN.FLOW_SN);
                                        }
                                        _lotnos = string.Join(",", Biz.Db.Queryable<MES_CUST_SN>()
                                            .Where((q) => snList.Contains(q.FLOW_SN))
                                            .Select((q) => q.WORK_ORDER).Distinct().ToList());
                                        return _lotnos;
                                    }
                                    return "";
                                case "GetNOTES":
@@ -752,13 +762,13 @@
            var itemCode = action.CurPkg.CustSN?.ITEM_CODE;
            var weight = action.CurPkg.WeightInfo.Weight;
            var unit = action.CurPkg.WeightInfo.Unit.ToUpper();
            var model = WorkBatch.Product.ExtInfo.Model;
            var Input = WorkBatch.Product.ExtInfo.Input;
            var OutPut = WorkBatch.Product.ExtInfo.OutPut;
            var Power = WorkBatch.Product.ExtInfo.Power;
            var Accuracy = WorkBatch.Product.ExtInfo.Accuracy;
            var Display = WorkBatch.Product.ExtInfo.Display;
            var Remark = WorkBatch.Product.ExtInfo.Remark;
            var model = WorkBatch.Product.ExtInfo?.Model;
            var Input = WorkBatch.Product.ExtInfo?.Input;
            var OutPut = WorkBatch.Product.ExtInfo?.OutPut;
            var Power = WorkBatch.Product.ExtInfo?.Power;
            var Accuracy = WorkBatch.Product.ExtInfo?.Accuracy;
            var Display = WorkBatch.Product.ExtInfo?.Display;
            var Remark = WorkBatch.Product.ExtInfo?.Remark;
            return $"{code}|{itemCode}|{wo}|\r\n{snList}|{weight}{unit}|型号:{model},输入:{Input},显示:{Display},输出:{OutPut},电源:{Power},精度:{Accuracy},备注:{Remark}";
        }