修改船期后,如果船期的启运港Id不为空,则批量更新时添加条件:根据启运港Id查订舱;批量更新订舱时添加修改截港时间截单时间

master
zhangxiaofeng 6 months ago
parent ecd062b1a3
commit c90fe9b61e

@ -29,8 +29,8 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<BookingOrder> _order; private readonly SqlSugarRepository<BookingOrder> _order;
private readonly ILogger<BookingVesselInfoService> _logger; private readonly ILogger<BookingVesselInfoService> _logger;
private readonly IHubContext<ChatHub, IChatClient> _chatHubContext; private readonly IHubContext<ChatHub, IChatClient> _chatHubContext;
public BookingVesselInfoService(SqlSugarRepository<DjyVesselInfo> rep, ILogger<BookingVesselInfoService> logger, SqlSugarRepository<BookingOrder> order, public BookingVesselInfoService(SqlSugarRepository<DjyVesselInfo> rep, ILogger<BookingVesselInfoService> logger, SqlSugarRepository<BookingOrder> order,
ISysCacheService sysCacheService, ISysCacheService sysCacheService,
IBookingOrderService bookingorderservice, IBookingOrderService bookingorderservice,
IHubContext<ChatHub, IChatClient> chatHubContext) IHubContext<ChatHub, IChatClient> chatHubContext)
{ {
@ -153,10 +153,20 @@ namespace Myshipping.Application
} }
if ((dto.ETA != null || dto.ETD != null || dto.ATD != null) && !string.IsNullOrEmpty(old.Vessel) && !string.IsNullOrEmpty(old.Voyno) && !string.IsNullOrEmpty(old.CARRIERID)) if ((dto.ETA != null || dto.ETD != null || dto.ATD != null)
&& !string.IsNullOrEmpty(old.Vessel)
&& !string.IsNullOrEmpty(old.Voyno)
&& !string.IsNullOrEmpty(old.CARRIERID))
{ {
var order = await _order.AsQueryable().Filter(null, true).Where(x => x.TenantId == UserManager.TENANT_ID && x.IsDeleted == false && x.VESSEL == old.Vessel && x.VOYNO == old.Voyno var order = await _order.AsQueryable()
&& x.CARRIERID == old.CARRIERID).ToListAsync(); .Filter(null, true)
.Where(x => x.TenantId == UserManager.TENANT_ID
&& x.IsDeleted == false
&& x.VESSEL == old.Vessel
&& x.VOYNO == old.Voyno
&& x.CARRIERID == old.CARRIERID)
.WhereIF(!string.IsNullOrEmpty(old.PortLoadingId), x => x.PORTLOADID == old.PortLoadingId)
.ToListAsync();
bool issend = false; bool issend = false;
if (order != null) if (order != null)
{ {
@ -213,6 +223,17 @@ namespace Myshipping.Application
it.ATD = dto.ATD; it.ATD = dto.ATD;
} }
if (dto.ClosingDate != null && dto.ClosingDate != it.CLOSINGDATE)
{
flag = true;
it.CLOSINGDATE = dto.ClosingDate;
}
if (dto.CloseDocTime != null && dto.CloseDocTime != it.CLOSEDOCDATE)
{
flag = true;
it.CLOSEDOCDATE = dto.CloseDocTime;
}
if (flag) if (flag)
{ {
issend = true; issend = true;

Loading…
Cancel
Save