# Conflicts:
#	Myshipping.Application/Service/BookingOrder/BookingOrderService.cs
optimize
jianghaiqing 1 year ago
commit a5d1ffb71e

@ -79,8 +79,6 @@ using System.Collections;
using System.Security.Principal;
using Myshipping.Core.Const;
using ICSharpCode.SharpZipLib.BZip2;
using Furion.ClayObject;
using System.Dynamic;
namespace Myshipping.Application
{
@ -136,7 +134,6 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<BookingExtendState> _repextendstate;
private readonly IServiceWorkFlowManageService _serviceWorkFlowManageService;
private readonly IDjyUserConfigService _djyUserConfigService;
const string CONST_MAPPING_MODULE = "BOOK_OR_CLOSING";
@ -160,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, IDjyUserConfigService djyUserConfigService)
IServiceWorkFlowManageService serviceWorkFlowManageService)
{
this._logger = logger;
this._rep = rep;
@ -206,7 +203,6 @@ namespace Myshipping.Application
this._repAutoYard = repAutoYard;
this._repextendstate = repextendstate;
_serviceWorkFlowManageService = serviceWorkFlowManageService;
_djyUserConfigService = djyUserConfigService;
}
#region 主表和箱信息
@ -470,38 +466,21 @@ namespace Myshipping.Application
var itgoodsStatus = new List<ITGoodsStatusDto>();
var itconfigs = new List<ITConfigsDto>();
//是否展示服务状态列表
bool isUserShowGoodsStatus = true;
List<ServiceProjectStatusDto> statusList = new List<ServiceProjectStatusDto>();
if (App.Configuration["ServiceStatusOpenAuto"] == "1")
{
var djyUserCfg = _djyUserConfigService.Multi(new string[] { "booking_list_column" })
.GetAwaiter().GetResult().FirstOrDefault();
if (djyUserCfg != null)
QueryServiceProjectWithStatusBatch batchQuery = new QueryServiceProjectWithStatusBatch
{
//如果不存在goodsStatusList则不获取服务状态详情
isUserShowGoodsStatus = !Regex.IsMatch(djyUserCfg.ConfigJson, "\\bfield\\b.*?\\bgoodsStatusList\\b");
}
BookingIds = bookingidlist.ToArray(),
QueryType = TrackingQueryTypeEnum.QUERY_SERVICE_ALL,
TenantId = list.Items.FirstOrDefault().TenantId.Value
};
var queryRlt = _serviceWorkFlowManageService.GetEnableStatusListByBusinessBatch(batchQuery)
.GetAwaiter().GetResult();
if (isUserShowGoodsStatus)
if (queryRlt.succ)
{
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));
}
statusList = JSON.Deserialize<List<ServiceProjectStatusDto>>(JSON.Serialize(queryRlt.ext));
}
}
else
@ -630,53 +609,37 @@ namespace Myshipping.Application
if (App.Configuration["ServiceStatusOpenAuto"] == "1")
{
if (isUserShowGoodsStatus)
{
var currStatusList = statusList.Where(a => long.Parse(a.BusiId) == item.Id).ToList();
var currStatusList = statusList.Where(a => long.Parse(a.BusiId) == item.Id).ToList();
if (currStatusList.Count > 0)
if (currStatusList.Count > 0)
{
if (currStatusList.Any(a => a.StatusSKUCode.Equals("YFVGM", StringComparison.OrdinalIgnoreCase) && a.IsYield))
{
if (currStatusList.Any(a => a.StatusSKUCode.Equals("YFVGM", StringComparison.OrdinalIgnoreCase) && a.IsYield))
{
var currSt = currStatusList.FirstOrDefault(a =>
a.StatusSKUCode.Equals("YFVGM", StringComparison.OrdinalIgnoreCase) && a.IsYield);
if (currSt != null && currSt.ActDate.HasValue)
item.IsVGM = currSt.ActDate.Value;
}
if (currStatusList.Any(a => a.StatusSKUCode.Equals("YFCD", StringComparison.OrdinalIgnoreCase) && a.IsYield))
{
var currSt = currStatusList.FirstOrDefault(a =>
a.StatusSKUCode.Equals("YFCD", StringComparison.OrdinalIgnoreCase) && a.IsYield);
if (currSt != null && currSt.ActDate.HasValue)
item.IsCanDan = currSt.ActDate.Value;
}
if (currStatusList.Any(a => a.StatusSKUCode.Equals("ZZFX", StringComparison.OrdinalIgnoreCase) && a.IsYield))
{
var currSt = currStatusList.FirstOrDefault(a =>
a.StatusSKUCode.Equals("ZZFX", StringComparison.OrdinalIgnoreCase) && a.IsYield);
if (currSt != null && currSt.ActDate.HasValue)
item.IsZZFX = currSt.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();
item.IsVGM = currStatusList.FirstOrDefault(a =>
a.StatusSKUCode.Equals("YFVGM", StringComparison.OrdinalIgnoreCase) && a.IsYield).ActDate.Value;
}
else
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.GoodsStatusList = new List<GoodsStatusList>();
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();
}
else
{
@ -2252,6 +2215,19 @@ namespace Myshipping.Application
{
throw Oops.Bah("调用运踪接口相关账号未维护!");
}
/*
* 2023-9-8
*
*
*/
if (order.ParentId > 0)
{
_logger.LogError("分单不再订阅运踪");
return;
}
var url = _cache.GetAllDictData().Result;
BillTraceDto billdto = new BillTraceDto();
List<BillTraceList> billTraceList = new List<BillTraceList>();
@ -8454,6 +8430,12 @@ HLCUTA12307DPXJ3 以这票为例 6个柜
var order = await _rep.AsQueryable().Filter(null, true).Where(x => ids.Contains(x.Id) && x.TenantId == UserManager.TENANT_ID && x.IsDeleted == false).ToListAsync();
foreach (var item in order)
{
//2023-9-8增加校验分单不能单独推送东胜只能随主单推送
if (item.ParentId > 0)
{
continue;
}
var dto = item.Adapt<SyncBookingOrderDto>();
//箱使
var CtnDayNumlist = await GetGoodsStatusList(item.Id);
@ -9255,8 +9237,6 @@ HLCUTA12307DPXJ3 以这票为例 6个柜
if (statusList != null)
{
var maxStatus = statusList.Where(a => a.IsYield)
//.OrderByDescending(a=>a.WFSortNo)
//.ThenByDescending(a => a.CalcSortNo)
.OrderByDescending(a => a.SortNo)
.FirstOrDefault();
@ -9266,7 +9246,7 @@ HLCUTA12307DPXJ3 以这票为例 6个柜
.First(a => a.Id == bookingId);
model.BSSTATUSNAME = maxStatus.ShowName;
//model.VERSION = IDGen.NextID().ToString().Replace("-", "");
model.VERSION = IDGen.NextID().ToString().Replace("-", "");
//更新订舱
_rep.AsUpdateable(model)
@ -9350,8 +9330,6 @@ HLCUTA12307DPXJ3 以这票为例 6个柜
if (statusList != null)
{
var maxStatus = statusList.Where(a => a.IsYield)
//.OrderByDescending(a => a.WFSortNo)
//.ThenByDescending(a => a.CalcSortNo)
.OrderByDescending(a => a.SortNo)
.FirstOrDefault();
@ -9367,7 +9345,7 @@ HLCUTA12307DPXJ3 以这票为例 6个柜
model.BSSTATUSNAME = string.Empty;
}
//model.VERSION = IDGen.NextID().ToString().Replace("-", "");
model.VERSION = IDGen.NextID().ToString().Replace("-", "");
//更新订舱
_rep.AsUpdateable(model)
@ -9414,9 +9392,7 @@ HLCUTA12307DPXJ3 以这票为例 6个柜
if (statusList != null)
{
var maxStatus = statusList.Where(a => a.IsYield)
//.OrderByDescending(a => a.WFSortNo)
//.ThenByDescending(a => a.CalcSortNo)
.OrderByDescending(a=>a.SortNo)
.OrderByDescending(a => a.SortNo)
.FirstOrDefault();
var model = _rep.AsQueryable().Filter(null, true)

Loading…
Cancel
Save