From 1c74fd6f5aff6e0e58243be61531c6b7797a43bb Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 5 Mar 2024 10:37:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A9=AC=E5=A3=AB=E5=9F=BAAP?= =?UTF-8?q?I=E6=9F=A5=E8=AF=A2=E8=88=B9=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingOrder/BookingOrderService.cs | 15 ++++++++++----- .../Dto/SearchShipSailingScheduleResultDto.cs | 5 +++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index c82e2dd1..fd88788c 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -11971,11 +11971,19 @@ namespace Myshipping.Application { carrierProductId = a.carrierProductId, carrierProductSequenceId = a.carrierProductSequenceId, - ETD = b.departureDateTime.Value, - ATD = b.arrivalDateTime.Value, + ETD = b.departureDateTime, + ATD = b.arrivalDateTime, vesselOperatorCarrierCode = b.vesselOperatorCarrierCode }; + if (b.departureDateTime.HasValue && b.arrivalDateTime.HasValue) + { + TimeSpan ts = b.arrivalDateTime.Value.Subtract(b.departureDateTime.Value); + var timeDiff = ts.TotalHours; + + info.days = (int)Math.Ceiling(timeDiff / 24.0); + } + if(b.facilities != null) { info.orignCityName = b.facilities.collectionOrigin?.cityName; @@ -11993,9 +12001,6 @@ namespace Myshipping.Application info.deliveryLocationType = b.facilities.deliveryDestination?.locationType; info.deliveryUNLocationCode = b.facilities.deliveryDestination?.UNLocationCode; info.deliveryUNRegionCode = b.facilities.deliveryDestination?.UNRegionCode; - - - } info.vesselIMONumber = b.firstDepartureVessel?.vesselIMONumber; diff --git a/Myshipping.Application/Service/BookingOrder/Dto/SearchShipSailingScheduleResultDto.cs b/Myshipping.Application/Service/BookingOrder/Dto/SearchShipSailingScheduleResultDto.cs index 80e411b6..18f48fa7 100644 --- a/Myshipping.Application/Service/BookingOrder/Dto/SearchShipSailingScheduleResultDto.cs +++ b/Myshipping.Application/Service/BookingOrder/Dto/SearchShipSailingScheduleResultDto.cs @@ -131,5 +131,10 @@ namespace Myshipping.Application /// 承运人代码(MAEU, SEAU, SEJJ, MCPU, MAEI) /// public string vesselOperatorCarrierCode { get; set; } + + /// + /// 行程天数 + /// + public int days { get; set; } } }