From 0a73b07c5efd882960af101ac8f8e12b8d2f560f Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期六, 28 九月 2024 12:07:49 +0800 Subject: [PATCH] 一些更改 --- Tiger.Business.MES/Transaction/Position.cs | 24 ++++++++++++++++++------ 1 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Tiger.Business.MES/Transaction/Position.cs b/Tiger.Business.MES/Transaction/Position.cs index c2f109a..752d850 100644 --- a/Tiger.Business.MES/Transaction/Position.cs +++ b/Tiger.Business.MES/Transaction/Position.cs @@ -509,13 +509,13 @@ case "GetSN": return CurSN; case "GetBAS_ITEM": - return WorkBatch.Product.ITEM_CODE; + return WorkBatch.Product.CUST_PROD_CODE; case "GetCustomer": return WorkBatch.Batch.ToJson(); case "GetBoxQR": return action is PackingAction ? GetBoxCode(lvars, action as PackingAction) : ""; case "GetCardQR": - return action is PackingAction? GetCardCode(lvars, action as PackingAction) : ""; + return action is PackingAction ? GetCardCode(lvars, action as PackingAction) : ""; case "GetDescription": return WorkBatch.Product.ITEM_DESC; case "GetPAndO": @@ -523,7 +523,17 @@ case "GetLTD": return WorkBatch.Batch.Customer.SHORT_NAME; case "GetHWDate": - return WorkBatch.Batch.ToJson(); + List<string> list = new List<string>(); + var _action = action is PackingAction ? action as PackingAction : null; + if (_action.CurPkg.Item.PKG_LEVEL == 1) + { + list.Add(CurSN); + } + else + { + list = _action != null ? _action.GetMinPackageList(_action.CurPkg.Item).Select(q => q.SN).ToList() : new List<string>(); + } + return GetHuaWeiWeek(WorkBatch.Batch.ORDER_NO, list); case "GetModel": return GetLabelVarWo(lv, WorkBatch.Product.ExtInfo.Model); case "GetInput": @@ -634,9 +644,10 @@ /// <returns></returns> private string GetCardOrBoxQR(string code, List<BAS_LABEL_VAR> lvars, PackingAction action) { - var itemCode = WorkBatch.Product.ITEM_CODE; + var itemCode = WorkBatch.Product.CUST_PROD_CODE; var wo = WorkBatch.Batch.ORDER_NO; var snList = string.Join("\r\n", action.GetMinPackageList(action.CurPkg.Item).Select(q => q.SN)); + if (snList.IsNullOrEmpty()) { snList = $"{CurSN}"; } var weight = action.CurPkg.WeightInfo.Weight; var unit = action.CurPkg.WeightInfo.Unit.ToUpper(); var model = WorkBatch.Product.ExtInfo.Model; @@ -644,9 +655,10 @@ 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}|{snList}|{weight}|鍨嬪彿:{model},杈撳叆:{Input},杈撳嚭:{OutPut},鐢垫簮:{Power},绮惧害:{Accuracy},澶囨敞:{Remark}"; + return $"{code}|{itemCode}|{wo}|\r\n{snList}|{weight}|鍨嬪彿:{model},杈撳叆:{Input},鏄剧ず:{Display},杈撳嚭:{OutPut},鐢垫簮:{Power},绮惧害:{Accuracy},澶囨敞:{Remark}"; } /// <summary> @@ -665,7 +677,7 @@ var item = snOrder.FirstOrDefault(q => q.FLOW_SN == sn || q.CUST_SN == sn); if (!item.IsNullOrEmpty()) { - var date = item.ACT_START_TIME < new DateTime(2000, 1, 1) ? item.PLAN_START_TIME : item.ACT_START_TIME; ; + var date = item.ACT_START_TIME < new DateTime(2000, 1, 1) ? item.PLAN_START_TIME : item.ACT_START_TIME; var firstDay = new DateTime(date.Year, 1, 1); int daysOffset = firstDay.DayOfWeek.GetValue() > 3 ? (firstDay.DayOfWeek.GetValue() - 7) : 0; int year = date.Year + ((date - firstDay).TotalDays + daysOffset < 0 ? -1 : 0); -- Gitblit v1.9.3