| | |
| | | using Tiger.Model.Entitys.MES.Position; |
| | | using System.Globalization; |
| | | using Tiger.Business.MES.WorkAction; |
| | | using System.Collections; |
| | | |
| | | namespace Tiger.Business.MES.Transaction |
| | | { |
| | |
| | | return action is PackingAction ? GetBoxCode(lvars, action as PackingAction) : ""; |
| | | case "GetCardQR": |
| | | return action is PackingAction ? GetCardCode(lvars, action as PackingAction) : ""; |
| | | case "GetCardSN": |
| | | List<string> minPkgList = new List<string>(); |
| | | var _pkaction = action is PackingAction ? action as PackingAction : null; |
| | | if (_pkaction != null) |
| | | { |
| | | minPkgList = GetMinPkgList(_pkaction); |
| | | } |
| | | return string.Join("\r\n", minPkgList); |
| | | case "GetDescription": |
| | | return WorkBatch.Product.ExtInfo.Packaging; //WorkBatch.Product.ITEM_DESC; |
| | | return WorkBatch.Product.ITEM_DESC; |
| | | case "GetFengZ": |
| | | return WorkBatch.Product.ExtInfo.Packaging; |
| | | case "GetPAndO": |
| | | return WorkBatch.WO.SALES_CONTRACT; |
| | | case "GetLTD": |
| | |
| | | case "GetHWDate": |
| | | List<string> list = new List<string>(); |
| | | var _action = action is PackingAction ? action as PackingAction : null; |
| | | if (_action.CurPkg.Item.PKG_LEVEL == 1) |
| | | if (_action!=null) |
| | | { |
| | | list.Add(CurSN); |
| | | } |
| | | else |
| | | { |
| | | list = _action != null ? _action.GetMinPackageList(_action.CurPkg.Item).Select(q => q.SN).ToList() : new List<string>(); |
| | | list = GetMinPkgList(_action); |
| | | } |
| | | return GetHuaWeiWeek(WorkBatch.Batch.ORDER_NO, list); |
| | | case "GetQty": |
| | | List<string> qtylist = new List<string>(); |
| | | var _qtyAction = action is PackingAction ? action as PackingAction : null; |
| | | if (_qtyAction != null) |
| | | { |
| | | qtylist = GetMinPkgList(_qtyAction); |
| | | } |
| | | return $"{qtylist.Count}PCS"; |
| | | case "GetModel": |
| | | return GetLabelVarWo(lv, WorkBatch.Product.ExtInfo.Model); |
| | | case "GetInput": |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取最小包装条码列表 |
| | | /// </summary> |
| | | /// <param name="action"></param> |
| | | /// <returns></returns> |
| | | private List<string> GetMinPkgList(PackingAction action) { |
| | | List<string> list = new List<string>(); |
| | | if (action.CurPkg.Item.PKG_LEVEL == 1) |
| | | { |
| | | list.Add(CurSN); |
| | | } |
| | | else |
| | | { |
| | | list = action.GetMinPackageList(action.CurPkg.Item).Select(q => q.SN).ToList(); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取白盒条码 |
| | | /// </summary> |
| | | /// <param name="action"></param> |
| | |
| | | /// <returns></returns> |
| | | private string GetCardOrBoxQR(string code, List<BAS_LABEL_VAR> lvars, PackingAction action) |
| | | { |
| | | var itemCode = WorkBatch.Product.ITEM_CODE; |
| | | var minPkgList = action.GetMinPackageList(action.CurPkg.Item).Select(q => q.SN); |
| | | var wo = WorkBatch.Batch.ORDER_NO; |
| | | var snList = string.Join("\r\n", action.GetMinPackageList(action.CurPkg.Item).Select(q => q.SN)); |
| | | var snList = string.Join("\r\n", minPkgList); |
| | | if (snList.IsNullOrEmpty()) { snList = $"{CurSN}"; } |
| | | var _sn = minPkgList.FirstOrDefault() ?? CurSN; |
| | | var itemCode = Biz.Db.Queryable<MES_CUST_SN>().Where(q => q.FLOW_SN == _sn || q.CUST_CODE == _sn).First()?.ITEM_CODE; |
| | | var weight = action.CurPkg.WeightInfo.Weight; |
| | | var unit = action.CurPkg.WeightInfo.Unit.ToUpper(); |
| | | var model = WorkBatch.Product.ExtInfo.Model; |
| | |
| | | case 1: |
| | | return weeks.First(); |
| | | case 2: |
| | | return string.Join("/", weeks.Select(q => q + $"({dic.Count(d => d.Value == q)})")); |
| | | return string.Join("、", weeks.Select(q => q + $"({dic.Count(d => d.Value == q)}PCS)")); |
| | | default: |
| | | return string.Join("/", weeks.Take(2)) + " (+)"; |
| | | return string.Join("、", weeks.Take(2)) + " (+)"; |
| | | } |
| | | } |
| | | #endregion |