修改马士基API查询船期功能

master
jianghaiqing 9 months ago
parent 26d02975a4
commit 4731781f01

@ -11891,6 +11891,9 @@ namespace Myshipping.Application
if (string.IsNullOrWhiteSpace(model.vesselOperatorCarrierCode)) if (string.IsNullOrWhiteSpace(model.vesselOperatorCarrierCode))
throw Oops.Oh($"服务船公司不能为空"); throw Oops.Oh($"服务船公司不能为空");
if (string.IsNullOrWhiteSpace(model.carrierId))
throw Oops.Oh("船公司代码不能为空");
if (string.IsNullOrWhiteSpace(model.startDate)) if (string.IsNullOrWhiteSpace(model.startDate))
throw Oops.Oh($"预计离港日期不能为空"); throw Oops.Oh($"预计离港日期不能为空");
@ -11960,7 +11963,60 @@ namespace Myshipping.Application
if (resultInfo != null && resultInfo.code == 200 if (resultInfo != null && resultInfo.code == 200
&& resultInfo.data != null && resultInfo.data.Count > 0) && resultInfo.data != null && resultInfo.data.Count > 0)
{ {
list = resultInfo.data.Adapt<List<SearchShipSailingScheduleResultDto>>(); 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) catch (Exception ex)

@ -75,6 +75,21 @@ namespace Myshipping.Application
/// </summary> /// </summary>
public Nullable<DateTime> arrivalDateTime { get; set; } public Nullable<DateTime> arrivalDateTime { get; set; }
/// <summary>
/// 路线相关数据
/// </summary>
public MSKAPISearchFacilities facilities { get; set; }
/// <summary>
/// 头程船信息
/// </summary>
public MSKDepartureVessel firstDepartureVessel { get; set; }
/// <summary>
/// 通过的时间,以分钟为单位
/// </summary>
public string transitTime { get; set; }
/// <summary> /// <summary>
/// The details for the individual schedule /// The details for the individual schedule
/// </summary> /// </summary>
@ -101,15 +116,7 @@ namespace Myshipping.Application
/// </summary> /// </summary>
public MSKAPISearchFacilitiesCityInfo deliveryDestination { get; set; } public MSKAPISearchFacilitiesCityInfo deliveryDestination { get; set; }
/// <summary>
/// 头程船信息
/// </summary>
public MSKDepartureVessel firstDepartureVessel { get; set; }
/// <summary>
/// 通过的时间,以分钟为单位
/// </summary>
public string transitTime { get; set; }
} }
/// <summary> /// <summary>

@ -6,7 +6,130 @@ using System.Threading.Tasks;
namespace Myshipping.Application namespace Myshipping.Application
{ {
public class SearchShipSailingScheduleResultDto: MSKAPISearchPoint2PointScheduleResultDataDto /// <summary>
/// 查询船期回执
/// </summary>
public class SearchShipSailingScheduleResultDto
{ {
/// <summary>
/// 产品id
/// </summary>
public string carrierProductId { get; set; }
/// <summary>
/// 产品序号
/// </summary>
public string carrierProductSequenceId { get; set; }
/// <summary>
/// ETD
/// </summary>
public Nullable<DateTime> ETD { get; set; }
/// <summary>
/// ATD
/// </summary>
public Nullable<DateTime> ATD { get; set; }
/// <summary>
/// 城市名(始发地)
/// </summary>
public string orignCityName { get; set; }
/// <summary>
/// 地点的GEO ID(始发地)
/// </summary>
public string orignCarrierSiteGeoID { get; set; }
/// <summary>
/// 地点的名称(始发地)
/// </summary>
public string orignLocationName { get; set; }
/// <summary>
/// 国家代码(始发地)
/// </summary>
public string orignCountryCode { get; set; }
/// <summary>
/// 位置类型(始发地)
/// </summary>
public string orignLocationType { get; set; }
/// <summary>
/// 五字码(始发地)
/// </summary>
public string orignUNLocationCode { get; set; }
/// <summary>
/// 区代码(始发地)
/// </summary>
public string orignUNRegionCode { get; set; }
/// <summary>
/// 城市名(目的地)
/// </summary>
public string deliveryCityName { get; set; }
/// <summary>
/// 地点的GEO ID(目的地)
/// </summary>
public string deliveryCarrierSiteGeoID { get; set; }
/// <summary>
/// 地点的名称(目的地)
/// </summary>
public string deliveryLocationName { get; set; }
/// <summary>
/// 国家代码(目的地)
/// </summary>
public string deliveryCountryCode { get; set; }
/// <summary>
/// 位置类型(目的地)
/// </summary>
public string deliveryLocationType { get; set; }
/// <summary>
/// 五字码(目的地)
/// </summary>
public string deliveryUNLocationCode { get; set; }
/// <summary>
/// 区代码(目的地)
/// </summary>
public string deliveryUNRegionCode { get; set; }
/// <summary>
/// IMO
/// </summary>
public string vesselIMONumber { get; set; }
/// <summary>
/// 航次号
/// </summary>
public string carrierVesselCode { get; set; }
/// <summary>
/// 运输方式
/// </summary>
public string transportMode { get; set; }
/// <summary>
/// 船名
/// </summary>
public string vesselName { get; set; }
/// <summary>
/// 航次代码
/// </summary>
public string carrierDepartureVoyageNumber { get; set; }
/// <summary>
/// 承运人代码(MAEU, SEAU, SEJJ, MCPU, MAEI)
/// </summary>
public string vesselOperatorCarrierCode { get; set; }
} }
} }

Loading…
Cancel
Save