|
|
|
@ -1643,40 +1643,45 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
#region 舱位
|
|
|
|
|
[HttpPost("/BookingSlot/delete")]
|
|
|
|
|
public async Task Delete([FromQuery] long id)
|
|
|
|
|
public async Task Delete([FromQuery] string Ids)
|
|
|
|
|
{
|
|
|
|
|
var slot = await _repBase.FirstOrDefaultAsync(x => x.Id == id);
|
|
|
|
|
if (slot == null)
|
|
|
|
|
var idArr = Ids.Split(',');
|
|
|
|
|
foreach (var idStr in idArr)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Oh("舱位信息不存在");
|
|
|
|
|
}
|
|
|
|
|
await _repBase.UpdateAsync(x => x.Id == id, x => new BookingSlotBase()
|
|
|
|
|
{
|
|
|
|
|
IsDeleted = true,
|
|
|
|
|
UpdatedTime = DateTime.Now,
|
|
|
|
|
UpdatedUserId = UserManager.UserId,
|
|
|
|
|
UpdatedUserName = UserManager.Name
|
|
|
|
|
});
|
|
|
|
|
var id = Convert.ToInt64(idStr);
|
|
|
|
|
|
|
|
|
|
await _repCtn.UpdateAsync(x => x.SLOT_ID == id, x => new BookingSlotCtn()
|
|
|
|
|
{
|
|
|
|
|
IsDeleted = true,
|
|
|
|
|
UpdatedTime = DateTime.Now,
|
|
|
|
|
UpdatedUserId = UserManager.UserId,
|
|
|
|
|
UpdatedUserName = UserManager.Name
|
|
|
|
|
});
|
|
|
|
|
var slot = await _repBase.FirstOrDefaultAsync(x => x.Id == id);
|
|
|
|
|
if (slot == null)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Oh("舱位信息不存在");
|
|
|
|
|
}
|
|
|
|
|
await _repBase.UpdateAsync(x => x.Id == id, x => new BookingSlotBase()
|
|
|
|
|
{
|
|
|
|
|
IsDeleted = true,
|
|
|
|
|
UpdatedTime = DateTime.Now,
|
|
|
|
|
UpdatedUserId = UserManager.UserId,
|
|
|
|
|
UpdatedUserName = UserManager.Name
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
await _publisher.PublishAsync(new ChannelEventSource("BookingSlotStock:Update", new BookingSlotStockUpdateModel
|
|
|
|
|
{
|
|
|
|
|
BOOKING_SLOT_TYPE = slot.BOOKING_SLOT_TYPE,
|
|
|
|
|
CARRIERID = slot.CARRIERID,
|
|
|
|
|
CONTRACT_NO = slot.CONTRACT_NO,
|
|
|
|
|
VESSEL = slot.VESSEL,
|
|
|
|
|
VOYNO = slot.VOYNO,
|
|
|
|
|
PORTLOADID = slot.PORTLOADID,
|
|
|
|
|
PORTDISCHARGEID = slot.PORTDISCHARGEID,
|
|
|
|
|
TenantId = UserManager.TENANT_ID
|
|
|
|
|
}));
|
|
|
|
|
await _repCtn.UpdateAsync(x => x.SLOT_ID == id, x => new BookingSlotCtn()
|
|
|
|
|
{
|
|
|
|
|
IsDeleted = true,
|
|
|
|
|
UpdatedTime = DateTime.Now,
|
|
|
|
|
UpdatedUserId = UserManager.UserId,
|
|
|
|
|
UpdatedUserName = UserManager.Name
|
|
|
|
|
});
|
|
|
|
|
await _publisher.PublishAsync(new ChannelEventSource("BookingSlotStock:Update", new BookingSlotStockUpdateModel
|
|
|
|
|
{
|
|
|
|
|
BOOKING_SLOT_TYPE = slot.BOOKING_SLOT_TYPE,
|
|
|
|
|
CARRIERID = slot.CARRIERID,
|
|
|
|
|
CONTRACT_NO = slot.CONTRACT_NO,
|
|
|
|
|
VESSEL = slot.VESSEL,
|
|
|
|
|
VOYNO = slot.VOYNO,
|
|
|
|
|
PORTLOADID = slot.PORTLOADID,
|
|
|
|
|
PORTDISCHARGEID = slot.PORTDISCHARGEID,
|
|
|
|
|
TenantId = UserManager.TENANT_ID
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|