|
|
@ -151,8 +151,8 @@ namespace Myshipping.Application
|
|
|
|
|| oldObj.VOYNO != model.VOYNO
|
|
|
|
|| oldObj.VOYNO != model.VOYNO
|
|
|
|
|| oldObj.BOOKING_SLOT_TYPE != model.BOOKING_SLOT_TYPE
|
|
|
|
|| oldObj.BOOKING_SLOT_TYPE != model.BOOKING_SLOT_TYPE
|
|
|
|
|| oldObj.CARRIERID != model.CARRIERID
|
|
|
|
|| oldObj.CARRIERID != model.CARRIERID
|
|
|
|
|| oldObj.PLACERECEIPT != model.PLACERECEIPT
|
|
|
|
|| oldObj.PORTLOADID != model.PORTLOADID
|
|
|
|
|| oldObj.PLACEDELIVERY != model.PLACEDELIVERY)
|
|
|
|
|| oldObj.PORTDISCHARGEID != model.PORTDISCHARGEID)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
isNeedUpdateOldStock = true;
|
|
|
|
isNeedUpdateOldStock = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -169,8 +169,8 @@ namespace Myshipping.Application
|
|
|
|
CONTRACT_NO = oldObj.CONTRACT_NO,
|
|
|
|
CONTRACT_NO = oldObj.CONTRACT_NO,
|
|
|
|
VESSEL = oldObj.VESSEL,
|
|
|
|
VESSEL = oldObj.VESSEL,
|
|
|
|
VOYNO = oldObj.VOYNO,
|
|
|
|
VOYNO = oldObj.VOYNO,
|
|
|
|
PLACERECEIPT = oldObj.PLACERECEIPT,
|
|
|
|
PORTLOADID = oldObj.PORTLOADID,
|
|
|
|
PLACEDELIVERY = oldObj.PLACEDELIVERY,
|
|
|
|
PORTDISCHARGEID = oldObj.PORTDISCHARGEID,
|
|
|
|
TenantId = model.TenantId
|
|
|
|
TenantId = model.TenantId
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -212,8 +212,8 @@ namespace Myshipping.Application
|
|
|
|
CONTRACT_NO = model.CONTRACT_NO,
|
|
|
|
CONTRACT_NO = model.CONTRACT_NO,
|
|
|
|
VESSEL = model.VESSEL,
|
|
|
|
VESSEL = model.VESSEL,
|
|
|
|
VOYNO = model.VOYNO,
|
|
|
|
VOYNO = model.VOYNO,
|
|
|
|
PLACERECEIPT = model.PLACERECEIPT,
|
|
|
|
PORTLOADID = model.PORTLOADID,
|
|
|
|
PLACEDELIVERY = model.PLACEDELIVERY,
|
|
|
|
PORTDISCHARGEID = model.PORTDISCHARGEID,
|
|
|
|
TenantId = model.TenantId
|
|
|
|
TenantId = model.TenantId
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
@ -352,7 +352,7 @@ namespace Myshipping.Application
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 解析收货地,得到装货港名称及代码
|
|
|
|
// 解析收货地,得到装货港名称及五字码
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PLACERECEIPT))
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PLACERECEIPT))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var portEnName = dto.DataObj.PLACERECEIPT.Split(',')[0]?.Trim();
|
|
|
|
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);
|
|
|
|
_logger.LogInformation("收货地为空,订舱编号:{SLOT_BOOKING_NO}", dto.DataObj.SLOT_BOOKING_NO);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 解析交货地,得到为卸货港名称及代码
|
|
|
|
// 解析交货地,得到为卸货港名称及五字码, 以及国家信息
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PLACEDELIVERY))
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PLACEDELIVERY))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var portEnName = dto.DataObj.PLACEDELIVERY.Split(',')[0]?.Trim();
|
|
|
|
var portEnName = dto.DataObj.PLACEDELIVERY.Split(',')[0]?.Trim();
|
|
|
@ -389,6 +389,8 @@ namespace Myshipping.Application
|
|
|
|
{
|
|
|
|
{
|
|
|
|
dto.DataObj.PORTDISCHARGE = portInfo.EnName;
|
|
|
|
dto.DataObj.PORTDISCHARGE = portInfo.EnName;
|
|
|
|
dto.DataObj.PORTDISCHARGEID = portInfo.EdiCode;
|
|
|
|
dto.DataObj.PORTDISCHARGEID = portInfo.EdiCode;
|
|
|
|
|
|
|
|
dto.DataObj.PORTDISCHARGE_COUNTRY = portInfo.Country;
|
|
|
|
|
|
|
|
dto.DataObj.PORTDISCHARGE_COUNTRY_CODE = portInfo.CountryCode;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -521,8 +523,8 @@ namespace Myshipping.Application
|
|
|
|
|| oldObj.VOYNO != model.VOYNO
|
|
|
|
|| oldObj.VOYNO != model.VOYNO
|
|
|
|
|| oldObj.BOOKING_SLOT_TYPE != model.BOOKING_SLOT_TYPE
|
|
|
|
|| oldObj.BOOKING_SLOT_TYPE != model.BOOKING_SLOT_TYPE
|
|
|
|
|| oldObj.CARRIERID != model.CARRIERID
|
|
|
|
|| oldObj.CARRIERID != model.CARRIERID
|
|
|
|
|| oldObj.PLACERECEIPT != model.PLACERECEIPT
|
|
|
|
|| oldObj.PORTLOADID != model.PORTLOADID
|
|
|
|
|| oldObj.PLACEDELIVERY != model.PLACEDELIVERY)
|
|
|
|
|| oldObj.PORTDISCHARGEID != model.PORTDISCHARGEID)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
isNeedUpdateOldStock = true;
|
|
|
|
isNeedUpdateOldStock = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -538,8 +540,8 @@ namespace Myshipping.Application
|
|
|
|
CONTRACT_NO = oldObj.CONTRACT_NO,
|
|
|
|
CONTRACT_NO = oldObj.CONTRACT_NO,
|
|
|
|
VESSEL = oldObj.VESSEL,
|
|
|
|
VESSEL = oldObj.VESSEL,
|
|
|
|
VOYNO = oldObj.VOYNO,
|
|
|
|
VOYNO = oldObj.VOYNO,
|
|
|
|
PLACERECEIPT = oldObj.PLACERECEIPT,
|
|
|
|
PORTLOADID = oldObj.PORTLOADID,
|
|
|
|
PLACEDELIVERY = oldObj.PLACEDELIVERY,
|
|
|
|
PORTDISCHARGEID = oldObj.PORTDISCHARGEID,
|
|
|
|
TenantId = model.TenantId
|
|
|
|
TenantId = model.TenantId
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -661,8 +663,8 @@ namespace Myshipping.Application
|
|
|
|
CONTRACT_NO = model.CONTRACT_NO,
|
|
|
|
CONTRACT_NO = model.CONTRACT_NO,
|
|
|
|
VESSEL = model.VESSEL,
|
|
|
|
VESSEL = model.VESSEL,
|
|
|
|
VOYNO = model.VOYNO,
|
|
|
|
VOYNO = model.VOYNO,
|
|
|
|
PLACERECEIPT = model.PLACERECEIPT,
|
|
|
|
PORTLOADID = model.PORTLOADID,
|
|
|
|
PLACEDELIVERY = model.PLACEDELIVERY,
|
|
|
|
PORTDISCHARGEID = model.PORTDISCHARGEID,
|
|
|
|
TenantId = model.TenantId
|
|
|
|
TenantId = model.TenantId
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -823,6 +825,45 @@ namespace Myshipping.Application
|
|
|
|
//更新库存
|
|
|
|
//更新库存
|
|
|
|
await _publisher.PublishAsync(new ChannelEventSource("BookingSlotStock:Update", input));
|
|
|
|
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
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 舱位引入
|
|
|
|
#region 舱位引入
|
|
|
@ -1048,8 +1089,8 @@ namespace Myshipping.Application
|
|
|
|
CONTRACT_NO = latestSlot.CONTRACT_NO,
|
|
|
|
CONTRACT_NO = latestSlot.CONTRACT_NO,
|
|
|
|
VESSEL = latestSlot.VESSEL,
|
|
|
|
VESSEL = latestSlot.VESSEL,
|
|
|
|
VOYNO = latestSlot.VOYNO,
|
|
|
|
VOYNO = latestSlot.VOYNO,
|
|
|
|
PLACERECEIPT = latestSlot.PLACERECEIPT,
|
|
|
|
PORTLOADID = latestSlot.PORTLOADID,
|
|
|
|
PLACEDELIVERY = latestSlot.PLACEDELIVERY,
|
|
|
|
PORTDISCHARGEID = latestSlot.PORTDISCHARGEID,
|
|
|
|
TenantId = latestSlot.TenantId,
|
|
|
|
TenantId = latestSlot.TenantId,
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
}
|
|
|
|