From 4c5041a2dc64e75c3a1827a13b43a52384202491 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期四, 17 十月 2024 09:06:02 +0800 Subject: [PATCH] 标签获取客户更新 --- Tiger.Business.MES/Transaction/Position.cs | 20 +++++++++++++------- 1 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Tiger.Business.MES/Transaction/Position.cs b/Tiger.Business.MES/Transaction/Position.cs index 2d923f0..21362c9 100644 --- a/Tiger.Business.MES/Transaction/Position.cs +++ b/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); @@ -576,7 +576,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 +606,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().ToList()); + 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": -- Gitblit v1.9.3