diff --git a/Myshipping.Application/Service/BookingVesselInfo/BookingVesselInfoService.cs b/Myshipping.Application/Service/BookingVesselInfo/BookingVesselInfoService.cs index 4f4593a7..17e9797c 100644 --- a/Myshipping.Application/Service/BookingVesselInfo/BookingVesselInfoService.cs +++ b/Myshipping.Application/Service/BookingVesselInfo/BookingVesselInfoService.cs @@ -29,8 +29,8 @@ namespace Myshipping.Application private readonly SqlSugarRepository _order; private readonly ILogger _logger; private readonly IHubContext _chatHubContext; - public BookingVesselInfoService(SqlSugarRepository rep, ILogger logger, SqlSugarRepository order, - ISysCacheService sysCacheService, + public BookingVesselInfoService(SqlSugarRepository rep, ILogger logger, SqlSugarRepository order, + ISysCacheService sysCacheService, IBookingOrderService bookingorderservice, IHubContext 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 - && x.CARRIERID == old.CARRIERID).ToListAsync(); + 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 + && x.CARRIERID == old.CARRIERID) + .WhereIF(!string.IsNullOrEmpty(old.PortLoadingId), x => x.PORTLOADID == old.PortLoadingId) + .ToListAsync(); bool issend = false; if (order != null) { @@ -213,6 +223,17 @@ namespace Myshipping.Application 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) { issend = true;