From 912b56900d060218adbab76097dbe5222ce2f1b7 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 11 Sep 2023 17:27:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=A2=E8=88=B1=E5=8F=B0?= =?UTF-8?q?=E8=B4=A6=E5=A2=9E=E5=8A=A0=E2=80=9C=E8=B4=A7=E7=89=A9=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E2=80=9D=E7=9A=84=E4=B8=AA=E4=BA=BA=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=88=A4=E6=96=AD=EF=BC=8C=E5=8F=AA=E6=9C=89=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E4=BA=86=E6=AD=A4=E5=88=97=E6=98=BE=E7=A4=BA=E6=89=8D=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E8=AF=BB=E5=8F=96=E8=B4=A7=E7=89=A9=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingOrderService.cs | 100 +++++++++++------- 1 file changed, 62 insertions(+), 38 deletions(-) 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 {