|
|
@ -1093,7 +1093,7 @@ namespace Myshipping.Application
|
|
|
|
[HttpPost("/BookingSlot/refreshAllStock")]
|
|
|
|
[HttpPost("/BookingSlot/refreshAllStock")]
|
|
|
|
public async Task RefreshAllStock([FromBody] long telentId)
|
|
|
|
public async Task RefreshAllStock([FromBody] long telentId)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
await _repStock.DeleteAsync(x => x.TenantId == telentId);
|
|
|
|
var n = await _repStock.DeleteAsync(x => x.TenantId == telentId);
|
|
|
|
|
|
|
|
|
|
|
|
var logger = App.GetService<ILogger<BookingSlotStockSubscriber>>();
|
|
|
|
var logger = App.GetService<ILogger<BookingSlotStockSubscriber>>();
|
|
|
|
BookingSlotStockSubscriber subscriber = new BookingSlotStockSubscriber(logger);
|
|
|
|
BookingSlotStockSubscriber subscriber = new BookingSlotStockSubscriber(logger);
|
|
|
@ -1146,6 +1146,11 @@ namespace Myshipping.Application
|
|
|
|
.Select(x => new BookingSlotBase()
|
|
|
|
.Select(x => new BookingSlotBase()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Id = x.Id,
|
|
|
|
Id = x.Id,
|
|
|
|
|
|
|
|
VESSEL = x.VESSEL,
|
|
|
|
|
|
|
|
VOYNO = x.VOYNO,
|
|
|
|
|
|
|
|
CARRIERID = x.CARRIERID,
|
|
|
|
|
|
|
|
CONTRACT_NO = x.CONTRACT_NO,
|
|
|
|
|
|
|
|
BOOKING_SLOT_TYPE = x.BOOKING_SLOT_TYPE,
|
|
|
|
SLOT_BOOKING_NO = x.SLOT_BOOKING_NO,
|
|
|
|
SLOT_BOOKING_NO = x.SLOT_BOOKING_NO,
|
|
|
|
PLACERECEIPT = x.PLACERECEIPT,
|
|
|
|
PLACERECEIPT = x.PLACERECEIPT,
|
|
|
|
PLACEDELIVERY = x.PLACEDELIVERY,
|
|
|
|
PLACEDELIVERY = x.PLACEDELIVERY,
|
|
|
@ -1155,6 +1160,7 @@ namespace Myshipping.Application
|
|
|
|
PORTDISCHARGE = x.PORTDISCHARGE,
|
|
|
|
PORTDISCHARGE = x.PORTDISCHARGE,
|
|
|
|
PORTDISCHARGE_COUNTRY_CODE = x.PORTDISCHARGE_COUNTRY_CODE,
|
|
|
|
PORTDISCHARGE_COUNTRY_CODE = x.PORTDISCHARGE_COUNTRY_CODE,
|
|
|
|
PORTDISCHARGE_COUNTRY = x.PORTDISCHARGE_COUNTRY,
|
|
|
|
PORTDISCHARGE_COUNTRY = x.PORTDISCHARGE_COUNTRY,
|
|
|
|
|
|
|
|
TenantId = x.TenantId
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.ToListAsync();
|
|
|
|
.ToListAsync();
|
|
|
|
HashSet<long> updateIdSet = new HashSet<long>();
|
|
|
|
HashSet<long> updateIdSet = new HashSet<long>();
|
|
|
@ -1239,38 +1245,39 @@ namespace Myshipping.Application
|
|
|
|
x.PORTDISCHARGE_COUNTRY,
|
|
|
|
x.PORTDISCHARGE_COUNTRY,
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
//var group = updateList.Where(x => !string.IsNullOrEmpty(x.VESSEL)
|
|
|
|
var group = updateList.Where(x => !string.IsNullOrEmpty(x.VESSEL)
|
|
|
|
// && !string.IsNullOrEmpty(x.VOYNO)
|
|
|
|
&& !string.IsNullOrEmpty(x.VOYNO)
|
|
|
|
// && !string.IsNullOrEmpty(x.CONTRACT_NO)
|
|
|
|
&& !string.IsNullOrEmpty(x.CONTRACT_NO)
|
|
|
|
// && !string.IsNullOrEmpty(x.BOOKING_SLOT_TYPE)
|
|
|
|
&& !string.IsNullOrEmpty(x.BOOKING_SLOT_TYPE)
|
|
|
|
// && !string.IsNullOrEmpty(x.CARRIERID)
|
|
|
|
&& !string.IsNullOrEmpty(x.CARRIERID)
|
|
|
|
// && !string.IsNullOrEmpty(x.PORTLOADID)
|
|
|
|
&& !string.IsNullOrEmpty(x.PORTLOADID)
|
|
|
|
// && !string.IsNullOrEmpty(x.PORTDISCHARGEID))
|
|
|
|
&& !string.IsNullOrEmpty(x.PORTDISCHARGEID))
|
|
|
|
// .GroupBy(x => new
|
|
|
|
.GroupBy(x => new
|
|
|
|
// {
|
|
|
|
{
|
|
|
|
// x.VESSEL,
|
|
|
|
x.VESSEL,
|
|
|
|
// x.VOYNO,
|
|
|
|
x.VOYNO,
|
|
|
|
// x.CARRIERID,
|
|
|
|
x.CARRIERID,
|
|
|
|
// x.BOOKING_SLOT_TYPE,
|
|
|
|
x.BOOKING_SLOT_TYPE,
|
|
|
|
// x.PORTDISCHARGEID,
|
|
|
|
x.PORTDISCHARGEID,
|
|
|
|
// x.PORTLOADID,
|
|
|
|
x.PORTLOADID,
|
|
|
|
// x.CONTRACT_NO
|
|
|
|
x.CONTRACT_NO,
|
|
|
|
// }).ToList();
|
|
|
|
x.TenantId
|
|
|
|
|
|
|
|
}).ToList();
|
|
|
|
//foreach (var item in group)
|
|
|
|
|
|
|
|
//{
|
|
|
|
foreach (var item in group)
|
|
|
|
// await _publisher.PublishAsync(new ChannelEventSource("BookingSlotStock:Update", new BookingSlotStockUpdateModel
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
await _publisher.PublishAsync(new ChannelEventSource("BookingSlotStock:Update", new BookingSlotStockUpdateModel
|
|
|
|
// BOOKING_SLOT_TYPE = item.Key.BOOKING_SLOT_TYPE,
|
|
|
|
{
|
|
|
|
// CARRIERID = item.Key.CARRIERID,
|
|
|
|
BOOKING_SLOT_TYPE = item.Key.BOOKING_SLOT_TYPE,
|
|
|
|
// CONTRACT_NO = item.Key.CONTRACT_NO,
|
|
|
|
CARRIERID = item.Key.CARRIERID,
|
|
|
|
// VESSEL = item.Key.VESSEL,
|
|
|
|
CONTRACT_NO = item.Key.CONTRACT_NO,
|
|
|
|
// VOYNO = item.Key.VOYNO,
|
|
|
|
VESSEL = item.Key.VESSEL,
|
|
|
|
// PORTLOADID = item.Key.PORTLOADID,
|
|
|
|
VOYNO = item.Key.VOYNO,
|
|
|
|
// PORTDISCHARGEID = item.Key.PORTDISCHARGEID,
|
|
|
|
PORTLOADID = item.Key.PORTLOADID,
|
|
|
|
// TenantId = UserManager.TENANT_ID
|
|
|
|
PORTDISCHARGEID = item.Key.PORTDISCHARGEID,
|
|
|
|
// }));
|
|
|
|
TenantId = item.Key.TenantId
|
|
|
|
//}
|
|
|
|
}));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|