diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 1dac3e57..336b6d95 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -134,7 +134,7 @@ namespace Myshipping.Application private readonly SqlSugarRepository _repextendstate; private readonly IServiceWorkFlowManageService _serviceWorkFlowManageService; - + private readonly IDjyUserConfigService _djyUserConfigService; const string CONST_MAPPING_MODULE = "BOOK_OR_CLOSING"; const string CONST_MAPPING_MODULE_ROUTE = "BOOK_OR_CLOSING_RT"; @@ -157,7 +157,7 @@ namespace Myshipping.Application SqlSugarRepository repTenant, SqlSugarRepository repBookingStatus, SqlSugarRepository bookingEDIExt, SqlSugarRepository serviceItem, SqlSugarRepository paraContractNoInfoRepository, IHttpContextAccessor httpContextAccessor, IBookingGoodsStatusConfigService GoodsConfig, SqlSugarRepository djyWebsiteAccountConfigRepository, ISysOrgService orgService, SqlSugarRepository repLineOpMgrConfig, SqlSugarRepository repSysEmp, SqlSugarRepository repAutoYard, - IServiceWorkFlowManageService serviceWorkFlowManageService) + IServiceWorkFlowManageService serviceWorkFlowManageService, IDjyUserConfigService djyUserConfigService) { this._logger = logger; this._rep = rep; @@ -203,6 +203,7 @@ namespace Myshipping.Application this._repAutoYard = repAutoYard; this._repextendstate = repextendstate; _serviceWorkFlowManageService = serviceWorkFlowManageService; + _djyUserConfigService = djyUserConfigService; } #region 主表和箱信息 @@ -466,21 +467,37 @@ namespace Myshipping.Application var itgoodsStatus = new List(); var itconfigs = new List(); + var pageColsCfg = _djyUserConfigService.Multi(new string[] { "booking_list_column" }) + .GetAwaiter().GetResult().FirstOrDefault(); + + bool isUseGoodsStatus = true; + + //这里因为个人配置的不是标准的格式化数据,所以这里只做了正则匹配 + if (pageColsCfg != null && !string.IsNullOrWhiteSpace(pageColsCfg.ConfigJson)) + { + isUseGoodsStatus = Regex.IsMatch(pageColsCfg.ConfigJson, "\\\"field\\\"\\s?\\:\\s?\\\"goodsStatusList\\\""); + + _logger.LogInformation("取到个人配置里是否展示 goodsStatusList(货物状态)={rlt}", (isUseGoodsStatus ? "展示" : "隐藏")); + } + List statusList = new List(); if (App.Configuration["ServiceStatusOpenAuto"] == "1") { - QueryServiceProjectWithStatusBatch batchQuery = new QueryServiceProjectWithStatusBatch + if (isUseGoodsStatus) { - BookingIds = bookingidlist.ToArray(), - QueryType = TrackingQueryTypeEnum.QUERY_SERVICE_ALL, - TenantId = list.Items.FirstOrDefault().TenantId.Value - }; - var queryRlt = _serviceWorkFlowManageService.GetEnableStatusListByBusinessBatch(batchQuery) - .GetAwaiter().GetResult(); + QueryServiceProjectWithStatusBatch batchQuery = new QueryServiceProjectWithStatusBatch + { + BookingIds = bookingidlist.ToArray(), + QueryType = TrackingQueryTypeEnum.QUERY_SERVICE_ALL, + TenantId = list.Items.FirstOrDefault().TenantId.Value + }; + var queryRlt = _serviceWorkFlowManageService.GetEnableStatusListByBusinessBatch(batchQuery) + .GetAwaiter().GetResult(); - if (queryRlt.succ) - { - statusList = JSON.Deserialize>(JSON.Serialize(queryRlt.ext)); + if (queryRlt.succ) + { + statusList = JSON.Deserialize>(JSON.Serialize(queryRlt.ext)); + } } } else @@ -609,37 +626,44 @@ namespace Myshipping.Application if (App.Configuration["ServiceStatusOpenAuto"] == "1") { - var currStatusList = statusList.Where(a => long.Parse(a.BusiId) == item.Id).ToList(); - - if (currStatusList.Count > 0) + if (isUseGoodsStatus) { - if (currStatusList.Any(a => a.StatusSKUCode.Equals("YFVGM", StringComparison.OrdinalIgnoreCase) && a.IsYield)) - { - item.IsVGM = currStatusList.FirstOrDefault(a => - a.StatusSKUCode.Equals("YFVGM", StringComparison.OrdinalIgnoreCase) && a.IsYield).ActDate.Value; - } - if (currStatusList.Any(a => a.StatusSKUCode.Equals("YFCD", StringComparison.OrdinalIgnoreCase) && a.IsYield)) + var currStatusList = statusList.Where(a => long.Parse(a.BusiId) == item.Id).ToList(); + + if (currStatusList.Count > 0) { - item.IsCanDan = currStatusList.FirstOrDefault(a => - a.StatusSKUCode.Equals("YFCD", StringComparison.OrdinalIgnoreCase) && a.IsYield).ActDate.Value; + if (currStatusList.Any(a => a.StatusSKUCode.Equals("YFVGM", StringComparison.OrdinalIgnoreCase) && a.IsYield)) + { + item.IsVGM = currStatusList.FirstOrDefault(a => + a.StatusSKUCode.Equals("YFVGM", StringComparison.OrdinalIgnoreCase) && a.IsYield).ActDate.Value; + } + if (currStatusList.Any(a => a.StatusSKUCode.Equals("YFCD", StringComparison.OrdinalIgnoreCase) && a.IsYield)) + { + item.IsCanDan = currStatusList.FirstOrDefault(a => + a.StatusSKUCode.Equals("YFCD", StringComparison.OrdinalIgnoreCase) && a.IsYield).ActDate.Value; + } + if (currStatusList.Any(a => a.StatusSKUCode.Equals("ZZFX", StringComparison.OrdinalIgnoreCase) && a.IsYield)) + { + item.IsZZFX = currStatusList.FirstOrDefault(a => + a.StatusSKUCode.Equals("ZZFX", StringComparison.OrdinalIgnoreCase) && a.IsYield).ActDate.Value; + } + + item.GoodsStatusList = currStatusList.OrderBy(a => a.CalcSortNo) + .Select(a => new GoodsStatusList + { + FinishTime = a.ActDate, + IsLast = a.IsEnd, + Sort = a.ActSortNo, + StatusName = a.ShowName, + SystemCode = a.StatusSKUCode, + ExtData = !string.IsNullOrWhiteSpace(a.ActVal) ? a.ActVal : string.Empty, + Remark = !string.IsNullOrWhiteSpace(a.ActRemark) ? a.ActRemark : string.Empty + }).ToList(); } - if (currStatusList.Any(a => a.StatusSKUCode.Equals("ZZFX", StringComparison.OrdinalIgnoreCase) && a.IsYield)) + else { - item.IsZZFX = currStatusList.FirstOrDefault(a => - a.StatusSKUCode.Equals("ZZFX", StringComparison.OrdinalIgnoreCase) && a.IsYield).ActDate.Value; + item.GoodsStatusList = new List(); } - - item.GoodsStatusList = currStatusList.OrderBy(a => a.CalcSortNo) - .Select(a => new GoodsStatusList - { - FinishTime = a.ActDate, - IsLast = a.IsEnd, - Sort = a.ActSortNo, - StatusName = a.ShowName, - SystemCode = a.StatusSKUCode, - ExtData = !string.IsNullOrWhiteSpace(a.ActVal) ? a.ActVal : string.Empty, - Remark = !string.IsNullOrWhiteSpace(a.ActRemark) ? a.ActRemark : string.Empty - }).ToList(); } else {