修改订舱台账增加“货物状态”的个人配置判断,只有开启了此列显示才批量读取货物状态信息

optimize
jianghaiqing 1 year ago
parent c7b2ebed6e
commit 912b56900d

@ -134,7 +134,7 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<BookingExtendState> _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<SysTenant> repTenant, SqlSugarRepository<BookingStatus> repBookingStatus, SqlSugarRepository<BookingEDIExt> bookingEDIExt, SqlSugarRepository<BookingServiceItem> serviceItem,
SqlSugarRepository<ParaContractNoInfo> paraContractNoInfoRepository, IHttpContextAccessor httpContextAccessor, IBookingGoodsStatusConfigService GoodsConfig, SqlSugarRepository<DjyWebsiteAccountConfig> djyWebsiteAccountConfigRepository,
ISysOrgService orgService, SqlSugarRepository<BookingLineOpMgrConfig> repLineOpMgrConfig, SqlSugarRepository<SysEmp> repSysEmp, SqlSugarRepository<BookingAutoYardImport> 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<ITGoodsStatusDto>();
var itconfigs = new List<ITConfigsDto>();
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<ServiceProjectStatusDto> statusList = new List<ServiceProjectStatusDto>();
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<List<ServiceProjectStatusDto>>(JSON.Serialize(queryRlt.ext));
if (queryRlt.succ)
{
statusList = JSON.Deserialize<List<ServiceProjectStatusDto>>(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<GoodsStatusList>();
}
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
{

Loading…
Cancel
Save