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.

111 lines
7.9 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)
8 months ago
.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)
8 months ago
.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)
8 months ago
.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)
8 months ago
.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.CustomSICutDate, src => src.CUSTOM_SI_CUT_DATE.HasValue ? src.CUSTOM_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)
8 months ago
.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)
8 months ago
.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)
8 months ago
.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)
8 months ago
.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.CustomSICutDate, src => src.CUSTOM_SI_CUT_DATE.HasValue ? src.CUSTOM_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<TaskBCInfoReadDto, TaskBCInfoDto>()
.Map(dest => dest.CarrierId, src => src.CarrierId)
.Map(dest => dest.Carrier, src => src.Carrier)
.Map(dest => dest.MBLNo, src => src.MBLNo)
.Map(dest => dest.BookingSlotType, src => src.BookingSlotType)
.Map(dest => dest.BookingSlotTypeName, src => src.BookingSlotTypeName)
.Map(dest => dest.Vessel, src => src.Vessel)
.Map(dest => dest.VoyNo, src => src.VoyNo)
.Map(dest => dest.VGMSubmissionCutDate, src => src.VGMCutoffTime.HasValue ? src.VGMCutoffTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
.Map(dest => dest.WeekAt, src => src.WeekAt)
.Map(dest => dest.CarriageType, src => src.CarriageType)
.Map(dest => dest.CarriageTypeName, src => src.CarriageTypeName)
.Map(dest => dest.ContractNo, src => src.ContractNo)
.Map(dest => dest.CtnStat, src => src.CtnStat)
.Map(dest => dest.CYCutoffTime, src => src.CYCutoffTime.HasValue ? src.CYCutoffTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
.Map(dest => dest.DetensionFreeDays, src => src.DetensionFreeDays)
.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.ManifestCutDate.HasValue ? src.ManifestCutDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
.Map(dest => dest.MDGFCutDate, src => src.MDGFCutDate.HasValue ? src.MDGFCutDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
.Map(dest => dest.SICutDate, src => src.SICutDate.HasValue ? src.SICutDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
.Map(dest => dest.CustomSICutDate, src => src.CustomSICutDate.HasValue ? src.CustomSICutDate.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.TransferPort1)
.Map(dest => dest.TransferPort2, src => src.TransferPort2);
}
}
}