From 4731781f01181969f6d6bdd2eebbeefdd249e8be Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 5 Mar 2024 10:16:09 +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=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingOrderService.cs | 58 +++++++- ...SKAPISearchPoint2PointScheduleResultDto.cs | 25 ++-- .../Dto/SearchShipSailingScheduleResultDto.cs | 125 +++++++++++++++++- 3 files changed, 197 insertions(+), 11 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index abd8adde..c82e2dd1 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -11891,6 +11891,9 @@ namespace Myshipping.Application if (string.IsNullOrWhiteSpace(model.vesselOperatorCarrierCode)) throw Oops.Oh($"服务船公司不能为空"); + if (string.IsNullOrWhiteSpace(model.carrierId)) + throw Oops.Oh("船公司代码不能为空"); + if (string.IsNullOrWhiteSpace(model.startDate)) throw Oops.Oh($"预计离港日期不能为空"); @@ -11960,7 +11963,60 @@ namespace Myshipping.Application if (resultInfo != null && resultInfo.code == 200 && resultInfo.data != null && resultInfo.data.Count > 0) { - list = resultInfo.data.Adapt>(); + resultInfo.data.ForEach(a => + { + a.transportSchedules.ForEach(b => + { + SearchShipSailingScheduleResultDto info = new SearchShipSailingScheduleResultDto + { + carrierProductId = a.carrierProductId, + carrierProductSequenceId = a.carrierProductSequenceId, + ETD = b.departureDateTime.Value, + ATD = b.arrivalDateTime.Value, + vesselOperatorCarrierCode = b.vesselOperatorCarrierCode + }; + + if(b.facilities != null) + { + info.orignCityName = b.facilities.collectionOrigin?.cityName; + info.orignCarrierSiteGeoID = b.facilities.collectionOrigin?.carrierSiteGeoID; + info.orignLocationName = b.facilities.collectionOrigin?.locationName; + info.orignCountryCode = b.facilities.collectionOrigin?.countryCode; + info.orignLocationType = b.facilities.collectionOrigin?.locationType; + info.orignUNLocationCode = b.facilities.collectionOrigin?.UNLocationCode; + info.orignUNRegionCode = b.facilities.collectionOrigin?.UNRegionCode; + + info.deliveryCityName = b.facilities.deliveryDestination?.cityName; + info.deliveryCarrierSiteGeoID = b.facilities.deliveryDestination?.carrierSiteGeoID; + info.deliveryLocationName = b.facilities.deliveryDestination?.locationName; + info.deliveryCountryCode = b.facilities.deliveryDestination?.countryCode; + info.deliveryLocationType = b.facilities.deliveryDestination?.locationType; + info.deliveryUNLocationCode = b.facilities.deliveryDestination?.UNLocationCode; + info.deliveryUNRegionCode = b.facilities.deliveryDestination?.UNRegionCode; + + + + } + + info.vesselIMONumber = b.firstDepartureVessel?.vesselIMONumber; + info.carrierVesselCode = b.firstDepartureVessel?.carrierVesselCode; + info.vesselName = b.firstDepartureVessel?.vesselName; + + if (b.transportLegs != null && b.transportLegs.Count > 0) + { + var firstTransportLegs = b.transportLegs.FirstOrDefault(); + + if (firstTransportLegs.transport != null) + { + info.transportMode = firstTransportLegs.transport.transportMode; + info.carrierDepartureVoyageNumber = firstTransportLegs.transport.carrierDepartureVoyageNumber; + } + + } + + list.Add(info); + }); + }); } } catch (Exception ex) diff --git a/Myshipping.Application/Service/BookingOrder/Dto/MSKAPI/MSKAPISearchPoint2PointScheduleResultDto.cs b/Myshipping.Application/Service/BookingOrder/Dto/MSKAPI/MSKAPISearchPoint2PointScheduleResultDto.cs index 05d5b8df..c6af2ea2 100644 --- a/Myshipping.Application/Service/BookingOrder/Dto/MSKAPI/MSKAPISearchPoint2PointScheduleResultDto.cs +++ b/Myshipping.Application/Service/BookingOrder/Dto/MSKAPI/MSKAPISearchPoint2PointScheduleResultDto.cs @@ -75,6 +75,21 @@ namespace Myshipping.Application /// public Nullable arrivalDateTime { get; set; } + /// + /// 路线相关数据 + /// + public MSKAPISearchFacilities facilities { get; set; } + + /// + /// 头程船信息 + /// + public MSKDepartureVessel firstDepartureVessel { get; set; } + + /// + /// 通过的时间,以分钟为单位 + /// + public string transitTime { get; set; } + /// /// The details for the individual schedule /// @@ -101,15 +116,7 @@ namespace Myshipping.Application /// public MSKAPISearchFacilitiesCityInfo deliveryDestination { get; set; } - /// - /// 头程船信息 - /// - public MSKDepartureVessel firstDepartureVessel { get; set; } - - /// - /// 通过的时间,以分钟为单位 - /// - public string transitTime { get; set; } + } /// diff --git a/Myshipping.Application/Service/BookingOrder/Dto/SearchShipSailingScheduleResultDto.cs b/Myshipping.Application/Service/BookingOrder/Dto/SearchShipSailingScheduleResultDto.cs index 5d634b69..80e411b6 100644 --- a/Myshipping.Application/Service/BookingOrder/Dto/SearchShipSailingScheduleResultDto.cs +++ b/Myshipping.Application/Service/BookingOrder/Dto/SearchShipSailingScheduleResultDto.cs @@ -6,7 +6,130 @@ using System.Threading.Tasks; namespace Myshipping.Application { - public class SearchShipSailingScheduleResultDto: MSKAPISearchPoint2PointScheduleResultDataDto + /// + /// 查询船期回执 + /// + public class SearchShipSailingScheduleResultDto { + /// + /// 产品id + /// + public string carrierProductId { get; set; } + + /// + /// 产品序号 + /// + public string carrierProductSequenceId { get; set; } + + /// + /// ETD + /// + public Nullable ETD { get; set; } + + /// + /// ATD + /// + public Nullable ATD { get; set; } + + /// + /// 城市名(始发地) + /// + public string orignCityName { get; set; } + + /// + /// 地点的GEO ID(始发地) + /// + public string orignCarrierSiteGeoID { get; set; } + + /// + /// 地点的名称(始发地) + /// + public string orignLocationName { get; set; } + + /// + /// 国家代码(始发地) + /// + public string orignCountryCode { get; set; } + + /// + /// 位置类型(始发地) + /// + public string orignLocationType { get; set; } + + /// + /// 五字码(始发地) + /// + public string orignUNLocationCode { get; set; } + + /// + /// 区代码(始发地) + /// + public string orignUNRegionCode { get; set; } + + /// + /// 城市名(目的地) + /// + public string deliveryCityName { get; set; } + + /// + /// 地点的GEO ID(目的地) + /// + public string deliveryCarrierSiteGeoID { get; set; } + + /// + /// 地点的名称(目的地) + /// + public string deliveryLocationName { get; set; } + + /// + /// 国家代码(目的地) + /// + public string deliveryCountryCode { get; set; } + + /// + /// 位置类型(目的地) + /// + public string deliveryLocationType { get; set; } + + /// + /// 五字码(目的地) + /// + public string deliveryUNLocationCode { get; set; } + + /// + /// 区代码(目的地) + /// + public string deliveryUNRegionCode { get; set; } + + + /// + /// IMO + /// + public string vesselIMONumber { get; set; } + + /// + /// 航次号 + /// + public string carrierVesselCode { get; set; } + + /// + /// 运输方式 + /// + public string transportMode { get; set; } + + /// + /// 船名 + /// + public string vesselName { get; set; } + + /// + /// 航次代码 + /// + public string carrierDepartureVoyageNumber { get; set; } + + /// + /// 承运人代码(MAEU, SEAU, SEJJ, MCPU, MAEI) + /// + public string vesselOperatorCarrierCode { get; set; } } }