|
|
|
@ -425,6 +425,24 @@ namespace Myshipping.Application.Service.BookingOrder
|
|
|
|
|
//Legs
|
|
|
|
|
if (model.scheduleDetails != null && model.scheduleDetails.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
if(model.scheduleDetails.Any(x => x.fromLocation.cityGeoId == model.originGeoId))
|
|
|
|
|
{
|
|
|
|
|
showDto.orignCountryCode = model.scheduleDetails.FirstOrDefault(x => x.fromLocation.cityGeoId == model.originGeoId).fromLocation.countryCode;
|
|
|
|
|
}
|
|
|
|
|
else if (model.scheduleDetails.Any(x => x.toLocation.cityGeoId == model.originGeoId))
|
|
|
|
|
{
|
|
|
|
|
showDto.orignCountryCode = model.scheduleDetails.FirstOrDefault(x => x.toLocation.cityGeoId == model.originGeoId).toLocation.countryCode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (model.scheduleDetails.Any(x => x.fromLocation.cityGeoId == model.destinationGeoId))
|
|
|
|
|
{
|
|
|
|
|
showDto.deliveryCountryCode = model.scheduleDetails.FirstOrDefault(x => x.fromLocation.cityGeoId == model.destinationGeoId).fromLocation.countryCode;
|
|
|
|
|
}
|
|
|
|
|
else if (model.scheduleDetails.Any(x => x.toLocation.cityGeoId == model.destinationGeoId))
|
|
|
|
|
{
|
|
|
|
|
showDto.deliveryCountryCode = model.scheduleDetails.FirstOrDefault(x => x.toLocation.cityGeoId == model.destinationGeoId).toLocation.countryCode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var legs = model.scheduleDetails.Select(b =>
|
|
|
|
|
{
|
|
|
|
|
MSKAPISPOTScheduleRateResultShowLegsDto leg = new MSKAPISPOTScheduleRateResultShowLegsDto
|
|
|
|
@ -491,6 +509,8 @@ namespace Myshipping.Application.Service.BookingOrder
|
|
|
|
|
|
|
|
|
|
return leg;
|
|
|
|
|
}).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
showDto.Legs = legs.OrderBy(t => t.ETD).Select((t, idx) => {
|
|
|
|
|
t.SortNo = idx + 1;
|
|
|
|
|
return t;
|
|
|
|
@ -728,8 +748,10 @@ namespace Myshipping.Application.Service.BookingOrder
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
foreach (var detail in selectedShipSchedule.scheduleDetails)
|
|
|
|
|
for(int i=0;i< selectedShipSchedule.scheduleDetails.Count;i++)
|
|
|
|
|
{
|
|
|
|
|
var detail = selectedShipSchedule.scheduleDetails[i];
|
|
|
|
|
|
|
|
|
|
var currDto = new MSKAPIBookingSchedules();
|
|
|
|
|
//ETD
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(detail.fromLocation.date))
|
|
|
|
@ -774,21 +796,62 @@ namespace Myshipping.Application.Service.BookingOrder
|
|
|
|
|
|
|
|
|
|
currDto.serviceCode = detail.serviceCode;
|
|
|
|
|
|
|
|
|
|
currDto.startLocation = new MSKAPIBookingRouteDetailsBase {
|
|
|
|
|
cityName = selectedShipSchedule.scheduleDetails.FirstOrDefault().fromLocation.cityName,
|
|
|
|
|
ISOcountryCode = selectedShipSchedule.scheduleDetails.FirstOrDefault().fromLocation.countryCode,
|
|
|
|
|
UNLocationCode = selectedShipSchedule.scheduleDetails.FirstOrDefault().fromLocation.unLocCode,
|
|
|
|
|
maerskCityGeoId = selectedShipSchedule.scheduleDetails.FirstOrDefault().fromLocation.cityGeoId,
|
|
|
|
|
};
|
|
|
|
|
//首个
|
|
|
|
|
if(i == 0)
|
|
|
|
|
{
|
|
|
|
|
currDto.startLocation = new MSKAPIBookingRouteDetailsBase
|
|
|
|
|
{
|
|
|
|
|
cityName = selectedShipSchedule.scheduleDetails.FirstOrDefault().fromLocation.cityName,
|
|
|
|
|
ISOcountryCode = selectedShipSchedule.scheduleDetails.FirstOrDefault().fromLocation.countryCode,
|
|
|
|
|
UNLocationCode = selectedShipSchedule.scheduleDetails.FirstOrDefault().fromLocation.unLocCode,
|
|
|
|
|
maerskCityGeoId = selectedShipSchedule.scheduleDetails.FirstOrDefault().fromLocation.cityGeoId,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
currDto.endLocation = new MSKAPIBookingRouteDetailsBase
|
|
|
|
|
currDto.endLocation = new MSKAPIBookingRouteDetailsBase
|
|
|
|
|
{
|
|
|
|
|
cityName = selectedShipSchedule.scheduleDetails.FirstOrDefault().toLocation.cityName,
|
|
|
|
|
ISOcountryCode = selectedShipSchedule.scheduleDetails.FirstOrDefault().toLocation.countryCode,
|
|
|
|
|
UNLocationCode = selectedShipSchedule.scheduleDetails.FirstOrDefault().toLocation.unLocCode,
|
|
|
|
|
maerskSiteGeoId = selectedShipSchedule.scheduleDetails.FirstOrDefault().toLocation.siteGeoId,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
else if(i == selectedShipSchedule.scheduleDetails.Count - 1)
|
|
|
|
|
{
|
|
|
|
|
cityName = selectedShipSchedule.scheduleDetails.FirstOrDefault().toLocation.cityName,
|
|
|
|
|
ISOcountryCode = selectedShipSchedule.scheduleDetails.FirstOrDefault().toLocation.countryCode,
|
|
|
|
|
UNLocationCode = selectedShipSchedule.scheduleDetails.FirstOrDefault().toLocation.unLocCode,
|
|
|
|
|
maerskCityGeoId = selectedShipSchedule.scheduleDetails.FirstOrDefault().toLocation.cityGeoId,
|
|
|
|
|
};
|
|
|
|
|
currDto.startLocation = new MSKAPIBookingRouteDetailsBase
|
|
|
|
|
{
|
|
|
|
|
cityName = selectedShipSchedule.scheduleDetails.FirstOrDefault().fromLocation.cityName,
|
|
|
|
|
ISOcountryCode = selectedShipSchedule.scheduleDetails.FirstOrDefault().fromLocation.countryCode,
|
|
|
|
|
UNLocationCode = selectedShipSchedule.scheduleDetails.FirstOrDefault().fromLocation.unLocCode,
|
|
|
|
|
maerskSiteGeoId = selectedShipSchedule.scheduleDetails.FirstOrDefault().fromLocation.siteGeoId,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
currDto.endLocation = new MSKAPIBookingRouteDetailsBase
|
|
|
|
|
{
|
|
|
|
|
cityName = selectedShipSchedule.scheduleDetails.FirstOrDefault().toLocation.cityName,
|
|
|
|
|
ISOcountryCode = selectedShipSchedule.scheduleDetails.FirstOrDefault().toLocation.countryCode,
|
|
|
|
|
UNLocationCode = selectedShipSchedule.scheduleDetails.FirstOrDefault().toLocation.unLocCode,
|
|
|
|
|
maerskCityGeoId = selectedShipSchedule.scheduleDetails.FirstOrDefault().toLocation.cityGeoId,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
currDto.startLocation = new MSKAPIBookingRouteDetailsBase
|
|
|
|
|
{
|
|
|
|
|
cityName = selectedShipSchedule.scheduleDetails.FirstOrDefault().fromLocation.cityName,
|
|
|
|
|
ISOcountryCode = selectedShipSchedule.scheduleDetails.FirstOrDefault().fromLocation.countryCode,
|
|
|
|
|
UNLocationCode = selectedShipSchedule.scheduleDetails.FirstOrDefault().fromLocation.unLocCode,
|
|
|
|
|
maerskSiteGeoId = selectedShipSchedule.scheduleDetails.FirstOrDefault().fromLocation.siteGeoId,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
currDto.endLocation = new MSKAPIBookingRouteDetailsBase
|
|
|
|
|
{
|
|
|
|
|
cityName = selectedShipSchedule.scheduleDetails.FirstOrDefault().toLocation.cityName,
|
|
|
|
|
ISOcountryCode = selectedShipSchedule.scheduleDetails.FirstOrDefault().toLocation.countryCode,
|
|
|
|
|
UNLocationCode = selectedShipSchedule.scheduleDetails.FirstOrDefault().toLocation.unLocCode,
|
|
|
|
|
maerskSiteGeoId = selectedShipSchedule.scheduleDetails.FirstOrDefault().toLocation.siteGeoId,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bookingDto.bookingBody.transport.routeDetails.selectedRoute.bookingSchedules.Add(currDto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|