diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index e21bb36d..10c66bd9 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -1561,23 +1561,6 @@ namespace Myshipping.Application _logger.LogWarning($"保存请求[{reqId}],转为实体对象完成"); } - //存在船名航次引入船期数据 - if (!string.IsNullOrEmpty(input.VESSEL) && !string.IsNullOrEmpty(input.VOYNO)) - { - var vesselInfo = _vesselInfo.AsQueryable().Filter(null, true).Where(x => x.IsDeleted == false && x.TenantId == UserManager.UserId && x.Vessel == input.VESSEL && x.Voyno == input.VESSEL && x.ATD != null).ToList().FirstOrDefault(); - if (vesselInfo != null) - { - entity.YgtETD = vesselInfo.ETD; - entity.StartETA = vesselInfo.ETA; - entity.ATD = vesselInfo.ATD; - - if (!string.IsNullOrEmpty(reqId)) - { - _logger.LogWarning($"保存请求[{reqId}],引用船期数据完成"); - } - } - - } //判断是否订阅运踪目的港起运港标识 if (!string.IsNullOrEmpty(entity.MBLNO)) { @@ -1651,6 +1634,26 @@ namespace Myshipping.Application { entity.VOYNO = entity.VOYNOINNER; } + + //存在船名航次引入船期数据 + if (!string.IsNullOrEmpty(input.VESSEL) && !string.IsNullOrEmpty(input.VOYNO) && !string.IsNullOrEmpty(input.CARRIERID)) + { + var vesselInfo = await _vesselInfo.AsQueryable() + .Where(x => x.Vessel == input.VESSEL && x.Voyno == input.VOYNO && x.CARRIERID == input.CARRIERID && x.ATD != null) + .FirstAsync(); + if (vesselInfo != null) + { + entity.StartETA = vesselInfo.ETA; + entity.ATD = vesselInfo.ATD; + entity.YgtETD = vesselInfo.YgtETD; + + if (!string.IsNullOrEmpty(reqId)) + { + _logger.LogWarning($"保存请求[{reqId}],引用船期数据完成"); + } + } + } + entity.VERSION = Guid.NewGuid().ToString(); entity.BOOKINGNO = Yitter.IdGenerator.YitIdHelper.NextId().ToString(); entity.BSDATE = DateTime.Today; @@ -1731,6 +1734,11 @@ namespace Myshipping.Application } else { + //把前端传递的已修改字段转换为属性名称 + var lstPropName = new List + { + "CNTRTOTAL","IsBookingYZ" + }; var mlist = await _rep.AsQueryable().Filter(null, true).Where(x => x.Id == input.Id).FirstAsync(); @@ -1793,7 +1801,11 @@ namespace Myshipping.Application entity.ATD = null; entity.YgtETD = null; } - + lstPropName.AddRange(new string[] { + nameof(BookingOrder.StartETA), + nameof(BookingOrder.ATD), + nameof(BookingOrder.YgtETD) + }); if (!string.IsNullOrEmpty(reqId)) { @@ -1801,11 +1813,6 @@ namespace Myshipping.Application } } - //把前端传递的已修改字段转换为属性名称 - var lstPropName = new List - { - "CNTRTOTAL","IsBookingYZ" - }; if (input.ChangedFields != null && input.ChangedFields.Count > 0) { var propsOrder = typeof(BookingOrder).GetProperties();