You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
5.2 KiB
C#

using Mapster;
using Myshipping.Application.Entity;
using Myshipping.Application.Service.BookingSlot.Dto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
public class BookingSlotMapper : IRegister
{
public void Register(TypeAdapterConfig config)
{
config.ForType<BookingSlotBase, TaskBCInfoDto>()
.Map(dest => dest.CarrierId, src => src.CARRIERID)
.Map(dest => dest.Carrier, src => src.CARRIER)
.Map(dest => dest.MBLNo, src => src.SLOT_BOOKING_NO)
.Map(dest => dest.BookingSlotType, src => src.BOOKING_SLOT_TYPE)
.Map(dest => dest.BookingSlotTypeName, src => src.BOOKING_SLOT_TYPE_NAME)
.Map(dest => dest.Vessel, src => src.VESSEL)
.Map(dest => dest.VoyNo, src => src.VOYNO)
.Map(dest => dest.VGMSubmissionCutDate, src => src.VGM_SUBMISSION_CUT_DATE.HasValue ? src.VGM_SUBMISSION_CUT_DATE.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
.Map(dest => dest.WeekAt, src => src.WEEK_AT)
.Map(dest => dest.CarriageType, src => src.CARRIAGE_TYPE)
.Map(dest => dest.CarriageTypeName, src => src.CARRIAGE_TYPE_NAME)
.Map(dest => dest.ContractNo, src => src.CONTRACT_NO)
.Map(dest => dest.CtnStat, src => src.CTN_STAT)
.Map(dest => dest.CYCutoffTime, src => src.CY_CUT_DATE.HasValue? src.CY_CUT_DATE.Value.ToString("yyyy-MM-dd HH:mm:ss"):"")
.Map(dest => dest.DetensionFreeDays, src => src.DETENSION_FREE_DAYS)
.Map(dest => dest.ETD, src => src.ETD.HasValue ? src.ETD.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
.Map(dest => dest.ETA, src => src.ETA.HasValue ? src.ETA.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
.Map(dest => dest.LaneCode, src => src.LANECODE)
.Map(dest => dest.LaneName, src => src.LANENAME)
.Map(dest => dest.ManifestCutDate, src => src.MANIFEST_CUT_DATE.HasValue ? src.CY_CUT_DATE.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
.Map(dest => dest.MDGFCutDate, src => src.MDGF_CUT_DATE.HasValue ? src.MDGF_CUT_DATE.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
.Map(dest => dest.SICutDate, src => src.SI_CUT_DATE.HasValue ? src.SI_CUT_DATE.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
.Map(dest => dest.PlaceDelivery, src => src.PLACEDELIVERY)
.Map(dest => dest.PlaceReceipt, src => src.PLACERECEIPT)
.Map(dest => dest.PortDischarge, src => src.PORTDISCHARGE)
.Map(dest => dest.Portload, src => src.PORTLOAD)
.Map(dest => dest.TransferPort1, src => src.TRANSFER_PORT_1)
.Map(dest => dest.TransferPort2, src => src.TRANSFER_PORT_2);
config.ForType<BookingSlotBaseApiSaveDto, TaskBCInfoDto>()
.Map(dest => dest.CarrierId, src => src.CARRIERID)
.Map(dest => dest.Carrier, src => src.CARRIER)
.Map(dest => dest.MBLNo, src => src.SLOT_BOOKING_NO)
.Map(dest => dest.BookingSlotType, src => src.BOOKING_SLOT_TYPE)
.Map(dest => dest.BookingSlotTypeName, src => src.BOOKING_SLOT_TYPE_NAME)
.Map(dest => dest.Vessel, src => src.VESSEL)
.Map(dest => dest.VoyNo, src => src.VOYNO)
.Map(dest => dest.VGMSubmissionCutDate, src => src.VGM_SUBMISSION_CUT_DATE.HasValue ? src.VGM_SUBMISSION_CUT_DATE.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
.Map(dest => dest.WeekAt, src => src.WEEK_AT)
.Map(dest => dest.CarriageType, src => src.CARRIAGE_TYPE)
.Map(dest => dest.CarriageTypeName, src => src.CARRIAGE_TYPE_NAME)
.Map(dest => dest.ContractNo, src => src.CONTRACT_NO)
.Map(dest => dest.CtnStat, src => src.CTN_STAT)
.Map(dest => dest.CYCutoffTime, src => src.CY_CUT_DATE.HasValue ? src.CY_CUT_DATE.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
.Map(dest => dest.DetensionFreeDays, src => src.DETENSION_FREE_DAYS)
.Map(dest => dest.ETD, src => src.ETD.HasValue ? src.ETD.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
.Map(dest => dest.ETA, src => src.ETA.HasValue ? src.ETA.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
.Map(dest => dest.LaneCode, src => src.LANECODE)
.Map(dest => dest.LaneName, src => src.LANENAME)
.Map(dest => dest.ManifestCutDate, src => src.MANIFEST_CUT_DATE.HasValue ? src.MANIFEST_CUT_DATE.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
.Map(dest => dest.MDGFCutDate, src => src.MDGF_CUT_DATE.HasValue ? src.MDGF_CUT_DATE.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
.Map(dest => dest.SICutDate, src => src.SI_CUT_DATE.HasValue ? src.SI_CUT_DATE.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
.Map(dest => dest.PlaceDelivery, src => src.PLACEDELIVERY)
.Map(dest => dest.PlaceReceipt, src => src.PLACERECEIPT)
.Map(dest => dest.PortDischarge, src => src.PORTDISCHARGE)
.Map(dest => dest.Portload, src => src.PORTLOAD)
.Map(dest => dest.TransferPort1, src => src.TRANSFER_PORT_1)
.Map(dest => dest.TransferPort2, src => src.TRANSFER_PORT_2);
}
}
}