|
|
|
@ -4,7 +4,11 @@ using DS.Module.Core.Helpers;
|
|
|
|
|
using DS.Module.DjyServiceStatus;
|
|
|
|
|
using DS.Module.SqlSugar;
|
|
|
|
|
using DS.Module.UserModule;
|
|
|
|
|
using DS.WMS.Core.Code.Interface;
|
|
|
|
|
using DS.WMS.Core.Code.Method;
|
|
|
|
|
using DS.WMS.Core.Invoice.Dtos;
|
|
|
|
|
using DS.WMS.Core.Map.Interface;
|
|
|
|
|
using DS.WMS.Core.Map.Method;
|
|
|
|
|
using DS.WMS.Core.Op.Dtos;
|
|
|
|
|
using DS.WMS.Core.Op.Entity;
|
|
|
|
|
using DS.WMS.Core.TaskPlat.Dtos;
|
|
|
|
@ -39,10 +43,16 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
private readonly IUser user;
|
|
|
|
|
private readonly ISaasDbService saasService;
|
|
|
|
|
private readonly IDjyServiceStatusService _djyServiceStatusService;
|
|
|
|
|
private readonly IMappingYardService _mappingYardService;
|
|
|
|
|
private readonly IMappingCarrierService _mappingCarrierService;
|
|
|
|
|
private readonly ICodePortService _codePortService;
|
|
|
|
|
|
|
|
|
|
private readonly string shippingOrderCompareUrl;
|
|
|
|
|
private readonly string shippingOrderCompareResultUrl;
|
|
|
|
|
|
|
|
|
|
const string CONST_MAPPING_YARD_MODULE = "BillTrace";
|
|
|
|
|
const string CONST_MAPPING_CARRIER_MODULE = "CarrierBaseMapping";
|
|
|
|
|
|
|
|
|
|
private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger();
|
|
|
|
|
|
|
|
|
|
public TaskShippingOrderCompareService(IServiceProvider serviceProvider)
|
|
|
|
@ -52,6 +62,9 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
user = _serviceProvider.GetRequiredService<IUser>();
|
|
|
|
|
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
|
|
|
|
|
_djyServiceStatusService = _serviceProvider.GetRequiredService<IDjyServiceStatusService>();
|
|
|
|
|
_mappingYardService = _serviceProvider.GetRequiredService<IMappingYardService>();
|
|
|
|
|
_mappingCarrierService = _serviceProvider.GetRequiredService<IMappingCarrierService>();
|
|
|
|
|
_codePortService = _serviceProvider.GetRequiredService<ICodePortService>();
|
|
|
|
|
|
|
|
|
|
shippingOrderCompareUrl = AppSetting.app(new string[] { "ShippingOrderCompare", "Url" });
|
|
|
|
|
shippingOrderCompareResultUrl = AppSetting.app(new string[] { "ShippingOrderCompare", "ResultUrl" });
|
|
|
|
@ -121,11 +134,49 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
|
|
|
|
|
Logger.Log(NLog.LogLevel.Info, "批次={no}获取订舱数据完成", batchNo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//附主信息
|
|
|
|
|
var mainInfo = model.Adapt<TaskMessageMain>();
|
|
|
|
|
|
|
|
|
|
//这里需要对场站进行映射翻译
|
|
|
|
|
var mapYardList = _mappingYardService.GetAllList().GetAwaiter().GetResult().Data;
|
|
|
|
|
|
|
|
|
|
if (mapYardList.Count > 0)
|
|
|
|
|
mapYardList = mapYardList.Where(a => a.Module.Equals(CONST_MAPPING_YARD_MODULE, StringComparison.OrdinalIgnoreCase)).ToList();
|
|
|
|
|
|
|
|
|
|
if (mapYardList.Any(a => a.LinkId == model.YardId))
|
|
|
|
|
{
|
|
|
|
|
mainInfo.YardCode = mapYardList.FirstOrDefault(a => a.LinkId == model.YardId).MapCode;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
throw new Exception($"场站:{model.Yard} 没有对应的出口运踪映射代码");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var codePortList = _codePortService.GetAllList().GetAwaiter().GetResult().Data;
|
|
|
|
|
|
|
|
|
|
if (codePortList.Any(a => a.Id == model.LoadPortId))
|
|
|
|
|
mainInfo.PortLoad = codePortList.FirstOrDefault(a => a.Id == model.LoadPortId).PortName;
|
|
|
|
|
|
|
|
|
|
if (codePortList.Any(a => a.Id == model.DischargePortId))
|
|
|
|
|
mainInfo.PortDischarge = codePortList.FirstOrDefault(a => a.Id == model.DischargePortId).PortName;
|
|
|
|
|
|
|
|
|
|
if (codePortList.Any(a => a.Id == model.DeliveryPlaceId))
|
|
|
|
|
mainInfo.PlaceDelivery = codePortList.FirstOrDefault(a => a.Id == model.DeliveryPlaceId).PortName;
|
|
|
|
|
|
|
|
|
|
if (codePortList.Any(a => a.Id == model.DestinationId))
|
|
|
|
|
mainInfo.Destination = codePortList.FirstOrDefault(a => a.Id == model.DestinationId).PortName;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var mapCarrierList = _mappingCarrierService.GetAllList().GetAwaiter().GetResult().Data;
|
|
|
|
|
|
|
|
|
|
if (mapCarrierList.Count > 0)
|
|
|
|
|
mapCarrierList = mapCarrierList.Where(a => a.Module.Equals(CONST_MAPPING_CARRIER_MODULE, StringComparison.OrdinalIgnoreCase)).ToList();
|
|
|
|
|
|
|
|
|
|
if (mapYardList.Any(a => a.LinkId == model.CarrierId))
|
|
|
|
|
{
|
|
|
|
|
mainInfo.CarrierCode = mapYardList.FirstOrDefault(a => a.LinkId == model.CarrierId).MapCode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mainInfo.BusiPKId = model.Id.ToString();
|
|
|
|
|
mainInfo.UserId = user.UserId;
|
|
|
|
|