|
|
|
@ -151,8 +151,8 @@ namespace Myshipping.Application
|
|
|
|
|
|| oldObj.VOYNO != model.VOYNO
|
|
|
|
|
|| oldObj.BOOKING_SLOT_TYPE != model.BOOKING_SLOT_TYPE
|
|
|
|
|
|| oldObj.CARRIERID != model.CARRIERID
|
|
|
|
|
|| oldObj.PLACERECEIPT != model.PLACERECEIPT
|
|
|
|
|
|| oldObj.PLACEDELIVERY != model.PLACEDELIVERY)
|
|
|
|
|
|| oldObj.PORTLOADID != model.PORTLOADID
|
|
|
|
|
|| oldObj.PORTDISCHARGEID != model.PORTDISCHARGEID)
|
|
|
|
|
{
|
|
|
|
|
isNeedUpdateOldStock = true;
|
|
|
|
|
}
|
|
|
|
@ -169,8 +169,8 @@ namespace Myshipping.Application
|
|
|
|
|
CONTRACT_NO = oldObj.CONTRACT_NO,
|
|
|
|
|
VESSEL = oldObj.VESSEL,
|
|
|
|
|
VOYNO = oldObj.VOYNO,
|
|
|
|
|
PLACERECEIPT = oldObj.PLACERECEIPT,
|
|
|
|
|
PLACEDELIVERY = oldObj.PLACEDELIVERY,
|
|
|
|
|
PORTLOADID = oldObj.PORTLOADID,
|
|
|
|
|
PORTDISCHARGEID = oldObj.PORTDISCHARGEID,
|
|
|
|
|
TenantId = model.TenantId
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
@ -212,8 +212,8 @@ namespace Myshipping.Application
|
|
|
|
|
CONTRACT_NO = model.CONTRACT_NO,
|
|
|
|
|
VESSEL = model.VESSEL,
|
|
|
|
|
VOYNO = model.VOYNO,
|
|
|
|
|
PLACERECEIPT = model.PLACERECEIPT,
|
|
|
|
|
PLACEDELIVERY = model.PLACEDELIVERY,
|
|
|
|
|
PORTLOADID = model.PORTLOADID,
|
|
|
|
|
PORTDISCHARGEID = model.PORTDISCHARGEID,
|
|
|
|
|
TenantId = model.TenantId
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
@ -352,7 +352,7 @@ namespace Myshipping.Application
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 解析收货地,得到装货港名称及代码
|
|
|
|
|
// 解析收货地,得到装货港名称及五字码
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PLACERECEIPT))
|
|
|
|
|
{
|
|
|
|
|
var portEnName = dto.DataObj.PLACERECEIPT.Split(',')[0]?.Trim();
|
|
|
|
@ -378,7 +378,7 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation("收货地为空,订舱编号:{SLOT_BOOKING_NO}", dto.DataObj.SLOT_BOOKING_NO);
|
|
|
|
|
}
|
|
|
|
|
// 解析交货地,得到为卸货港名称及代码
|
|
|
|
|
// 解析交货地,得到为卸货港名称及五字码, 以及国家信息
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PLACEDELIVERY))
|
|
|
|
|
{
|
|
|
|
|
var portEnName = dto.DataObj.PLACEDELIVERY.Split(',')[0]?.Trim();
|
|
|
|
@ -389,6 +389,8 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
dto.DataObj.PORTDISCHARGE = portInfo.EnName;
|
|
|
|
|
dto.DataObj.PORTDISCHARGEID = portInfo.EdiCode;
|
|
|
|
|
dto.DataObj.PORTDISCHARGE_COUNTRY = portInfo.Country;
|
|
|
|
|
dto.DataObj.PORTDISCHARGE_COUNTRY_CODE = portInfo.CountryCode;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -521,8 +523,8 @@ namespace Myshipping.Application
|
|
|
|
|
|| oldObj.VOYNO != model.VOYNO
|
|
|
|
|
|| oldObj.BOOKING_SLOT_TYPE != model.BOOKING_SLOT_TYPE
|
|
|
|
|
|| oldObj.CARRIERID != model.CARRIERID
|
|
|
|
|
|| oldObj.PLACERECEIPT != model.PLACERECEIPT
|
|
|
|
|
|| oldObj.PLACEDELIVERY != model.PLACEDELIVERY)
|
|
|
|
|
|| oldObj.PORTLOADID != model.PORTLOADID
|
|
|
|
|
|| oldObj.PORTDISCHARGEID != model.PORTDISCHARGEID)
|
|
|
|
|
{
|
|
|
|
|
isNeedUpdateOldStock = true;
|
|
|
|
|
}
|
|
|
|
@ -538,8 +540,8 @@ namespace Myshipping.Application
|
|
|
|
|
CONTRACT_NO = oldObj.CONTRACT_NO,
|
|
|
|
|
VESSEL = oldObj.VESSEL,
|
|
|
|
|
VOYNO = oldObj.VOYNO,
|
|
|
|
|
PLACERECEIPT = oldObj.PLACERECEIPT,
|
|
|
|
|
PLACEDELIVERY = oldObj.PLACEDELIVERY,
|
|
|
|
|
PORTLOADID = oldObj.PORTLOADID,
|
|
|
|
|
PORTDISCHARGEID = oldObj.PORTDISCHARGEID,
|
|
|
|
|
TenantId = model.TenantId
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
@ -661,8 +663,8 @@ namespace Myshipping.Application
|
|
|
|
|
CONTRACT_NO = model.CONTRACT_NO,
|
|
|
|
|
VESSEL = model.VESSEL,
|
|
|
|
|
VOYNO = model.VOYNO,
|
|
|
|
|
PLACERECEIPT = model.PLACERECEIPT,
|
|
|
|
|
PLACEDELIVERY = model.PLACEDELIVERY,
|
|
|
|
|
PORTLOADID = model.PORTLOADID,
|
|
|
|
|
PORTDISCHARGEID = model.PORTDISCHARGEID,
|
|
|
|
|
TenantId = model.TenantId
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
@ -823,6 +825,45 @@ namespace Myshipping.Application
|
|
|
|
|
//更新库存
|
|
|
|
|
await _publisher.PublishAsync(new ChannelEventSource("BookingSlotStock:Update", input));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 重新计算某租户下面所有的库存
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost("/BookingSlot/refreshAllStock")]
|
|
|
|
|
public async Task RefreshAllStock([FromBody] long telentId)
|
|
|
|
|
{
|
|
|
|
|
var logger = App.GetService<ILogger<BookingSlotStockSubscriber>>();
|
|
|
|
|
BookingSlotStockSubscriber subscriber = new BookingSlotStockSubscriber(logger);
|
|
|
|
|
var group = await _repBase.AsQueryable().Filter(null, true)
|
|
|
|
|
.Where(x => x.TenantId == telentId && x.IsDeleted == false)
|
|
|
|
|
.GroupBy(x => new
|
|
|
|
|
{
|
|
|
|
|
x.VESSEL,
|
|
|
|
|
x.VOYNO,
|
|
|
|
|
x.CARRIERID,
|
|
|
|
|
x.CONTRACT_NO,
|
|
|
|
|
x.BOOKING_SLOT_TYPE,
|
|
|
|
|
x.PORTLOADID,
|
|
|
|
|
x.PORTDISCHARGEID,
|
|
|
|
|
x.TenantId
|
|
|
|
|
}).Select(x => new
|
|
|
|
|
{
|
|
|
|
|
x.VESSEL,
|
|
|
|
|
x.VOYNO,
|
|
|
|
|
x.CARRIERID,
|
|
|
|
|
x.CONTRACT_NO,
|
|
|
|
|
x.BOOKING_SLOT_TYPE,
|
|
|
|
|
x.PORTLOADID,
|
|
|
|
|
x.PORTDISCHARGEID,
|
|
|
|
|
x.TenantId
|
|
|
|
|
}).ToListAsync();
|
|
|
|
|
foreach (var item in group)
|
|
|
|
|
{
|
|
|
|
|
BookingSlotStockUpdateModel model = item.Adapt<BookingSlotStockUpdateModel>();
|
|
|
|
|
await subscriber.BookingSlotStock(model);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 舱位引入
|
|
|
|
@ -1048,8 +1089,8 @@ namespace Myshipping.Application
|
|
|
|
|
CONTRACT_NO = latestSlot.CONTRACT_NO,
|
|
|
|
|
VESSEL = latestSlot.VESSEL,
|
|
|
|
|
VOYNO = latestSlot.VOYNO,
|
|
|
|
|
PLACERECEIPT = latestSlot.PLACERECEIPT,
|
|
|
|
|
PLACEDELIVERY = latestSlot.PLACEDELIVERY,
|
|
|
|
|
PORTLOADID = latestSlot.PORTLOADID,
|
|
|
|
|
PORTDISCHARGEID = latestSlot.PORTDISCHARGEID,
|
|
|
|
|
TenantId = latestSlot.TenantId,
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
|