|
|
|
@ -623,13 +623,9 @@ namespace Myshipping.Application
|
|
|
|
|
var portEnName = dto.DataObj.PLACERECEIPT.Split(',')[0]?.Trim();
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(portEnName))
|
|
|
|
|
{
|
|
|
|
|
var cachePort = await _cache.GetAllCodePort();
|
|
|
|
|
var cachePortLoad = await _cache.GetAllCodePortLoad();
|
|
|
|
|
var portInfo = await PlaceToPortHelper.PlaceReceiptToPortload(portEnName, cachePortLoad, () => _cache.GetAllMappingPortLoad());
|
|
|
|
|
|
|
|
|
|
var portInfo = cachePort.FirstOrDefault(x => x.EnName.StartsWith(portEnName, StringComparison.OrdinalIgnoreCase));
|
|
|
|
|
if (portInfo == null)
|
|
|
|
|
{
|
|
|
|
|
portInfo = cachePort.FirstOrDefault(x => x.EnName.Contains(portEnName, StringComparison.OrdinalIgnoreCase));
|
|
|
|
|
}
|
|
|
|
|
if (portInfo == null)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation("通过收货地城市名称未匹配到港口信息,订舱编号:{SLOT_BOOKING_NO}", dto.DataObj.SLOT_BOOKING_NO);
|
|
|
|
@ -656,11 +652,8 @@ namespace Myshipping.Application
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(portEnName))
|
|
|
|
|
{
|
|
|
|
|
var cachePort = await _cache.GetAllCodePort();
|
|
|
|
|
var portInfo = cachePort.FirstOrDefault(x => x.EnName.StartsWith(portEnName + ',', StringComparison.OrdinalIgnoreCase));
|
|
|
|
|
if (portInfo == null)
|
|
|
|
|
{
|
|
|
|
|
portInfo = cachePort.FirstOrDefault(x => x.EnName.Contains(portEnName, StringComparison.OrdinalIgnoreCase));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var portInfo = await PlaceToPortHelper.PlaceDeliveryToPort(portEnName, cachePort, () => _cache.GetAllMappingPort());
|
|
|
|
|
|
|
|
|
|
if (portInfo == null)
|
|
|
|
|
{
|
|
|
|
@ -1140,6 +1133,7 @@ namespace Myshipping.Application
|
|
|
|
|
var list = await _repBase.AsQueryable().Filter(null, true)
|
|
|
|
|
.Where(x => x.TenantId == telentId
|
|
|
|
|
&& x.IsDeleted == false
|
|
|
|
|
&& x.IS_CANCELLATION == false
|
|
|
|
|
&& !string.IsNullOrEmpty(x.PLACERECEIPT)
|
|
|
|
|
&& !string.IsNullOrEmpty(x.PLACEDELIVERY)
|
|
|
|
|
&& (string.IsNullOrEmpty(x.PORTLOADID) || string.IsNullOrEmpty(x.PORTDISCHARGEID)))
|
|
|
|
@ -1163,9 +1157,10 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
// 解析收货地,得到装货港名称及五字码
|
|
|
|
|
var portEnName = item.PLACERECEIPT.Split(',')[0]?.Trim();
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(portEnName))
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(portEnName)
|
|
|
|
|
&& (string.IsNullOrEmpty(item.PORTLOADID) || string.IsNullOrEmpty(item.PORTLOAD)))
|
|
|
|
|
{
|
|
|
|
|
var portInfo = cachePortLoad.FirstOrDefault(x => x.EnName.Equals(portEnName, StringComparison.OrdinalIgnoreCase));
|
|
|
|
|
var portInfo = await PlaceToPortHelper.PlaceReceiptToPortload(portEnName, cachePortLoad, () => _cache.GetAllMappingPortLoad());
|
|
|
|
|
if (portInfo != null)
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(item.PORTLOADID))
|
|
|
|
@ -1189,12 +1184,13 @@ namespace Myshipping.Application
|
|
|
|
|
var portEnName2 = item.PLACEDELIVERY.Split(',')[0]?.Trim();
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(portEnName2))
|
|
|
|
|
{
|
|
|
|
|
var portInfo = cachePort.FirstOrDefault(x => x.EnName.StartsWith(portEnName2, StringComparison.OrdinalIgnoreCase));
|
|
|
|
|
if (portInfo == null)
|
|
|
|
|
{
|
|
|
|
|
portInfo = cachePort.FirstOrDefault(x => x.EnName.Contains(portEnName2, StringComparison.OrdinalIgnoreCase));
|
|
|
|
|
}
|
|
|
|
|
if (portInfo != null)
|
|
|
|
|
var portInfo = await PlaceToPortHelper.PlaceDeliveryToPort(portEnName2, cachePort, () => _cache.GetAllMappingPort());
|
|
|
|
|
|
|
|
|
|
if (portInfo != null
|
|
|
|
|
&& (string.IsNullOrEmpty(item.PORTDISCHARGEID)
|
|
|
|
|
|| string.IsNullOrEmpty(item.PORTDISCHARGE)
|
|
|
|
|
|| string.IsNullOrEmpty(item.PORTDISCHARGE_COUNTRY_CODE)
|
|
|
|
|
|| string.IsNullOrEmpty(item.PORTDISCHARGE_COUNTRY)))
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(item.PORTDISCHARGEID))
|
|
|
|
|
{
|
|
|
|
@ -1237,38 +1233,38 @@ namespace Myshipping.Application
|
|
|
|
|
x.PORTDISCHARGE_COUNTRY,
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
var group = updateList.Where(x => !string.IsNullOrEmpty(x.VESSEL)
|
|
|
|
|
&& !string.IsNullOrEmpty(x.VOYNO)
|
|
|
|
|
&& !string.IsNullOrEmpty(x.CONTRACT_NO)
|
|
|
|
|
&& !string.IsNullOrEmpty(x.BOOKING_SLOT_TYPE)
|
|
|
|
|
&& !string.IsNullOrEmpty(x.CARRIERID)
|
|
|
|
|
&& !string.IsNullOrEmpty(x.PORTLOADID)
|
|
|
|
|
&& !string.IsNullOrEmpty(x.PORTDISCHARGEID))
|
|
|
|
|
.GroupBy(x => new
|
|
|
|
|
{
|
|
|
|
|
x.VESSEL,
|
|
|
|
|
x.VOYNO,
|
|
|
|
|
x.CARRIERID,
|
|
|
|
|
x.BOOKING_SLOT_TYPE,
|
|
|
|
|
x.PORTDISCHARGEID,
|
|
|
|
|
x.PORTLOADID,
|
|
|
|
|
x.CONTRACT_NO
|
|
|
|
|
}).ToList();
|
|
|
|
|
|
|
|
|
|
foreach (var item in group)
|
|
|
|
|
{
|
|
|
|
|
await _publisher.PublishAsync(new ChannelEventSource("BookingSlotStock:Update", new BookingSlotStockUpdateModel
|
|
|
|
|
{
|
|
|
|
|
BOOKING_SLOT_TYPE = item.Key.BOOKING_SLOT_TYPE,
|
|
|
|
|
CARRIERID = item.Key.CARRIERID,
|
|
|
|
|
CONTRACT_NO = item.Key.CONTRACT_NO,
|
|
|
|
|
VESSEL = item.Key.VESSEL,
|
|
|
|
|
VOYNO = item.Key.VOYNO,
|
|
|
|
|
PORTLOADID = item.Key.PORTLOADID,
|
|
|
|
|
PORTDISCHARGEID = item.Key.PORTDISCHARGEID,
|
|
|
|
|
TenantId = UserManager.TENANT_ID
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
|
//var group = updateList.Where(x => !string.IsNullOrEmpty(x.VESSEL)
|
|
|
|
|
// && !string.IsNullOrEmpty(x.VOYNO)
|
|
|
|
|
// && !string.IsNullOrEmpty(x.CONTRACT_NO)
|
|
|
|
|
// && !string.IsNullOrEmpty(x.BOOKING_SLOT_TYPE)
|
|
|
|
|
// && !string.IsNullOrEmpty(x.CARRIERID)
|
|
|
|
|
// && !string.IsNullOrEmpty(x.PORTLOADID)
|
|
|
|
|
// && !string.IsNullOrEmpty(x.PORTDISCHARGEID))
|
|
|
|
|
// .GroupBy(x => new
|
|
|
|
|
// {
|
|
|
|
|
// x.VESSEL,
|
|
|
|
|
// x.VOYNO,
|
|
|
|
|
// x.CARRIERID,
|
|
|
|
|
// x.BOOKING_SLOT_TYPE,
|
|
|
|
|
// x.PORTDISCHARGEID,
|
|
|
|
|
// x.PORTLOADID,
|
|
|
|
|
// x.CONTRACT_NO
|
|
|
|
|
// }).ToList();
|
|
|
|
|
|
|
|
|
|
//foreach (var item in group)
|
|
|
|
|
//{
|
|
|
|
|
// await _publisher.PublishAsync(new ChannelEventSource("BookingSlotStock:Update", new BookingSlotStockUpdateModel
|
|
|
|
|
// {
|
|
|
|
|
// BOOKING_SLOT_TYPE = item.Key.BOOKING_SLOT_TYPE,
|
|
|
|
|
// CARRIERID = item.Key.CARRIERID,
|
|
|
|
|
// CONTRACT_NO = item.Key.CONTRACT_NO,
|
|
|
|
|
// VESSEL = item.Key.VESSEL,
|
|
|
|
|
// VOYNO = item.Key.VOYNO,
|
|
|
|
|
// PORTLOADID = item.Key.PORTLOADID,
|
|
|
|
|
// PORTDISCHARGEID = item.Key.PORTDISCHARGEID,
|
|
|
|
|
// TenantId = UserManager.TENANT_ID
|
|
|
|
|
// }));
|
|
|
|
|
//}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
@ -3106,7 +3102,7 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
BookingSlotBase slotInfo = null;
|
|
|
|
|
|
|
|
|
|
if(bookingSlotAllocList.Count > 0)
|
|
|
|
|
if (bookingSlotAllocList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
slotInfo = bookingSlotAllocList.FirstOrDefault().Slot;
|
|
|
|
|
}
|
|
|
|
@ -3114,7 +3110,7 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
slotInfo = _repBase.AsQueryable().Filter(null, true).First(t => t.Id == slotId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (slotInfo != null)
|
|
|
|
|
{
|
|
|
|
@ -3147,7 +3143,7 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string srcPriceDate = bcSrcDto.PriceCalculationDate.HasValue? bcSrcDto.PriceCalculationDate.Value.ToString("yyyy-MM-dd"): "";
|
|
|
|
|
string srcPriceDate = bcSrcDto.PriceCalculationDate.HasValue ? bcSrcDto.PriceCalculationDate.Value.ToString("yyyy-MM-dd") : "";
|
|
|
|
|
string targetPriceDate = bcTargetDto.PriceCalculationDate.HasValue ? bcTargetDto.PriceCalculationDate.Value.ToString("yyyy-MM-dd") : "";
|
|
|
|
|
|
|
|
|
|
//如果原始的没有解析计费日期,就不做提醒了
|
|
|
|
@ -3359,7 +3355,7 @@ namespace Myshipping.Application
|
|
|
|
|
messageInfo.Main.MBlNo = dto.mblNo;
|
|
|
|
|
messageInfo.Main.ETD = dto.etd;
|
|
|
|
|
|
|
|
|
|
messageInfo.Main.TaskTitle = $"重要提醒-{dto.cautionNoticeType.GetDescription()} BLNo:{dto.mblNo} {dto.vessel}/{dto.voyno} {(dto.etd.HasValue? dto.etd.Value.ToString("yyyy-MM-dd"):"")} ";
|
|
|
|
|
messageInfo.Main.TaskTitle = $"重要提醒-{dto.cautionNoticeType.GetDescription()} BLNo:{dto.mblNo} {dto.vessel}/{dto.voyno} {(dto.etd.HasValue ? dto.etd.Value.ToString("yyyy-MM-dd") : "")} ";
|
|
|
|
|
messageInfo.Main.TaskDesp = $"重要提醒-{dto.cautionNoticeType.GetDescription()} BLNo:{dto.mblNo} {dto.vessel}/{dto.voyno} {(dto.etd.HasValue ? dto.etd.Value.ToString("yyyy-MM-dd") : "")}";
|
|
|
|
|
|
|
|
|
|
messageInfo.Main.CautionNoticeInfo = new TaskManageOrderCautionNoticeInfo
|
|
|
|
@ -3473,11 +3469,11 @@ namespace Myshipping.Application
|
|
|
|
|
notifyList = new List<CautionNoticeTaskNoitfyDto>()
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if(!string.IsNullOrWhiteSpace(bcSrcDto.ETD))
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(bcSrcDto.ETD))
|
|
|
|
|
{
|
|
|
|
|
DateTime etd = DateTime.MinValue;
|
|
|
|
|
|
|
|
|
|
if(DateTime.TryParse(bcSrcDto.ETD,out etd))
|
|
|
|
|
if (DateTime.TryParse(bcSrcDto.ETD, out etd))
|
|
|
|
|
{
|
|
|
|
|
notice.etd = etd;
|
|
|
|
|
}
|
|
|
|
|