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.

365 lines
23 KiB
C#

using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.TaskPlat.Entity;
using Mapster;
using Microsoft.Extensions.DependencyInjection;
namespace DS.WMS.Core.TaskPlat.Dtos.Mapper
{
/// <summary>
/// 任务台用的Mapster自定义映射规则
/// </summary>
public static class TaskPlatMapsterSetup
{
/// <summary>
/// 添加映射规则
/// </summary>
public static void AddTaskPlatMapsterSetup(this IServiceCollection services)
{
// 邮件接收BC创建BC子任务 TaskManageOrderBCInfo, TaskBCInfo
{
TypeAdapterConfig<TaskManageOrderBCInfo, TaskBCInfo>.NewConfig()
.TwoWays()
.Map(dest => dest.BUSI_TYPE, src => src.BusiType)
.Map(dest => dest.BOOKING_PARTY, src => src.BookingParty)
.Map(dest => dest.SHIPPER, src => src.Shipper)
.Map(dest => dest.CONSIGNEE, src => src.Consignee)
.Map(dest => dest.NOTIFYPARTY, src => src.NotifyParty)
.Map(dest => dest.BC_MODIFY_TIMES, src => src.BCModifyTimes)
.Map(dest => dest.BC_MODIFY_DATE, src => src.BCModifyDate)
.Map(dest => dest.MBL_NO, src => src.MBLNo)
.Map(dest => dest.VESSEL, src => src.Vessel)
.Map(dest => dest.VOYNO, src => src.VoyNo)
.Map(dest => dest.CARRIER, src => src.Carrier)
.Map(dest => dest.PLACERECEIPT, src => src.PlaceReceipt)
.Map(dest => dest.PORTLOAD, src => src.Portload)
.Map(dest => dest.CLOSING_DATE, src => src.ClosingDate)
.Map(dest => dest.VGM_CUTOFF_TIME, src => src.VGMCutoffTime)
.Map(dest => dest.ETA, src => src.ETA)
.Map(dest => dest.ETD, src => src.ETD)
.Map(dest => dest.POD_ETA, src => src.PODETA)
.Map(dest => dest.CUT_SINGLE_TIME, src => src.CutSingleTime)
.Map(dest => dest.PORTDISCHARGE, src => src.PortDischarge)
.Map(dest => dest.PLACEDELIVERY, src => src.PlaceDelivery)
.Map(dest => dest.SHIPPING_METHOD, src => src.ShippingMethod)
.Map(dest => dest.SERVICE, src => src.Service)
.Map(dest => dest.PRETRANS_MODE, src => src.PreTransMode)
.Map(dest => dest.DESCRIPTION, src => src.Description)
.Map(dest => dest.ISSUEPLACE, src => src.IssuePlace)
.Map(dest => dest.COLLECTION_TERMINAL, src => src.CollectionTerminal)
.Map(dest => dest.CONTRACTNO, src => src.ContractNo)
.Map(dest => dest.PREPARDAT, src => src.PrepardAT)
.Map(dest => dest.SHIP_AGENT, src => src.ShipAgent)
.Map(dest => dest.YARD, src => src.Yard)
.Map(dest => dest.YARD_CONTACT_USR, src => src.YardContactUserName)
.Map(dest => dest.YARD_CONTACT_TEL, src => src.YardContactTel)
.Map(dest => dest.FST_CUSTOMER_SER_USRNAME, src => src.FstCustomerSerUserName)
.Map(dest => dest.FST_CUSTOMER_SER_TEL, src => src.FstCustomerSerUserTel)
.Map(dest => dest.FST_CUSTOMER_SER_EMAIL, src => src.FstCustomerSerUserEmail)
.Map(dest => dest.REMARK1, src => src.Remark1)
.Map(dest => dest.CY_CUTOFF_TIME, src => src.CYCutoffTime)
.Map(dest => dest.FROM_EMAIL, src => src.FromEmail)
.Map(dest => dest.RECV_EMAIL, src => src.RecvEmail)
.Map(dest => dest.CARRIERID, src => src.CarrierId)
.Map(dest => dest.LANECODE, src => src.LaneCode)
.Map(dest => dest.LANENAME, src => src.LaneName)
.Map(dest => dest.CARRIAGE_TYPE, src => src.CarriageType)
.Map(dest => dest.CARRIAGE_TYPE_NAME, src => src.CarriageTypeName)
.Map(dest => dest.BOOKING_SLOT_TYPE, src => src.BookingSlotType)
.Map(dest => dest.BOOKING_SLOT_TYPE_NAME, src => src.BookingSlotTypeName)
.Map(dest => dest.CTN_STAT, src => src.CtnStat)
.Map(dest => dest.WEEK_AT, src => src.WeekAt)
.Map(dest => dest.DETENSION_FREE_DAYS, src => src.DetensionFreeDays)
.Map(dest => dest.SI_CUT_DATE, src => src.SICutDate)
.Map(dest => dest.MANIFEST_CUT_DATE, src => src.ManifestCutDate)
.Map(dest => dest.MDGF_CUT_DATE, src => src.MDGFCutDate)
.Map(dest => dest.TRANSFER_PORT_1, src => src.TransferPort1)
.Map(dest => dest.TRANSFER_PORT_2, src => src.TransferPort2)
.Map(dest => dest.SECOND_VESSEL, src => src.SecondVessel)
.Map(dest => dest.SECOND_VOYNO, src => src.SecondVoyno)
.Map(dest => dest.SECOND_ETD, src => src.SecondETD)
.Map(dest => dest.SECOND_ETA, src => src.SecondETA)
.Map(dest => dest.BOOKING_COMFIRM_DATE, src => src.BookingConfirmDate)
.Map(dest => dest.BATCH_NO, src => src.BatchNo)
.Map(dest => dest.PRICE_CALCULATION_DATE, src => src.PriceCalculationDate);
}
// BC子任务转前端Dto TaskManageOrderBCInfo, TaskBCInfo
{
TypeAdapterConfig<TaskBCInfo, TaskBCShowBaseDto>.NewConfig().TwoWays()
.Map(dest => dest.Id, src => src.Id)
.Map(dest => dest.TaskId, src => src.TASK_ID)
.Map(dest => dest.BusiType, src => src.BUSI_TYPE)
.Map(dest => dest.BookingParty, src => src.BOOKING_PARTY)
.Map(dest => dest.Shipper, src => src.SHIPPER)
.Map(dest => dest.Consignee, src => src.CONSIGNEE)
.Map(dest => dest.NotifyParty, src => src.NOTIFYPARTY)
.Map(dest => dest.BCModifyTimes, src => src.BC_MODIFY_TIMES)
.Map(dest => dest.BCModifyDate, src => src.BC_MODIFY_DATE)
.Map(dest => dest.MBLNo, src => src.MBL_NO)
.Map(dest => dest.TaskId, src => src.TASK_ID)
.Map(dest => dest.Vessel, src => src.VESSEL)
.Map(dest => dest.VoyNo, src => src.VOYNO)
.Map(dest => dest.Carrier, src => src.CARRIER)
.Map(dest => dest.PlaceReceipt, src => src.PLACERECEIPT)
.Map(dest => dest.Portload, src => src.PORTLOAD)
.Map(dest => dest.ClosingDate, src => src.CLOSING_DATE)
.Map(dest => dest.VGMCutoffTime, src => src.VGM_CUTOFF_TIME)
.Map(dest => dest.ETA, src => src.ETA)
.Map(dest => dest.ETD, src => src.ETD)
.Map(dest => dest.PODETA, src => src.POD_ETA)
.Map(dest => dest.CutSingleTime, src => src.CUT_SINGLE_TIME)
.Map(dest => dest.PortDischarge, src => src.PORTDISCHARGE)
.Map(dest => dest.PlaceDelivery, src => src.PLACEDELIVERY)
.Map(dest => dest.ShippingMethod, src => src.SHIPPING_METHOD)
.Map(dest => dest.Service, src => src.SERVICE)
.Map(dest => dest.PreTransMode, src => src.PRETRANS_MODE)
.Map(dest => dest.Description, src => src.DESCRIPTION)
.Map(dest => dest.IssuePlace, src => src.ISSUEPLACE)
.Map(dest => dest.CollectionTerminal, src => src.COLLECTION_TERMINAL)
.Map(dest => dest.ContractNo, src => src.CONTRACTNO)
.Map(dest => dest.PrepardAT, src => src.PREPARDAT)
.Map(dest => dest.ShipAgent, src => src.SHIP_AGENT)
.Map(dest => dest.Yard, src => src.YARD)
.Map(dest => dest.YardContactUserName, src => src.YARD_CONTACT_USR)
.Map(dest => dest.YardContactTel, src => src.YARD_CONTACT_TEL)
.Map(dest => dest.FstCustomerSerUserName, src => src.FST_CUSTOMER_SER_USRNAME)
.Map(dest => dest.FstCustomerSerUserTel, src => src.FST_CUSTOMER_SER_TEL)
.Map(dest => dest.FstCustomerSerUserEmail, src => src.FST_CUSTOMER_SER_EMAIL)
.Map(dest => dest.Remark1, src => src.REMARK1)
.Map(dest => dest.CYCutoffTime, src => src.CY_CUTOFF_TIME)
.Map(dest => dest.Status, src => src.STATUS)
.Map(dest => dest.FileMD5, src => src.FILE_MD5)
.Map(dest => dest.LastToBookingDate, src => src.LAST_TOBOOKING_DATE)
.Map(dest => dest.FromEmail, src => src.FROM_EMAIL)
.Map(dest => dest.RecvEmail, src => src.RECV_EMAIL)
.Map(dest => dest.BookingOrderId, src => src.BOOKING_ORDER_ID)
.Map(dest => dest.CarrierId, src => src.CARRIERID)
.Map(dest => dest.LaneCode, src => src.LANECODE)
.Map(dest => dest.LaneName, src => src.LANENAME)
.Map(dest => dest.CarriageType, src => src.CARRIAGE_TYPE)
.Map(dest => dest.CarriageTypeName, src => src.CARRIAGE_TYPE_NAME)
.Map(dest => dest.BookingSlotType, src => src.BOOKING_SLOT_TYPE)
.Map(dest => dest.BookingSlotTypeName, src => src.BOOKING_SLOT_TYPE_NAME)
.Map(dest => dest.CtnStat, src => src.CTN_STAT)
.Map(dest => dest.WeekAt, src => src.WEEK_AT)
.Map(dest => dest.DetensionFreeDays, src => src.DETENSION_FREE_DAYS)
.Map(dest => dest.SICutDate, src => src.SI_CUT_DATE)
.Map(dest => dest.ManifestCutDate, src => src.MANIFEST_CUT_DATE)
.Map(dest => dest.MDGFCutDate, src => src.MDGF_CUT_DATE)
.Map(dest => dest.TransferPort1, src => src.TRANSFER_PORT_1)
.Map(dest => dest.TransferPort2, src => src.TRANSFER_PORT_2)
.Map(dest => dest.SecondVessel, src => src.SECOND_VESSEL)
.Map(dest => dest.SecondVoyno, src => src.SECOND_VOYNO)
.Map(dest => dest.SecondETD, src => src.SECOND_ETD)
.Map(dest => dest.SecondETA, src => src.SECOND_ETA)
.Map(dest => dest.BookingSlotId, src => src.BOOKING_SLOT_ID)
.Map(dest => dest.BookingConfirmDate, src => src.BOOKING_COMFIRM_DATE)
.Map(dest => dest.BatchNo, src => src.BATCH_NO);
}
// BC子任务箱信息转前端Dto TaskBCCTNInfo, TaskBCCTNInfoDto
{
TypeAdapterConfig<TaskBCCTNInfo, TaskBCCTNInfoDto>.NewConfig().TwoWays()
.Map(dest => dest.CtnCode, src => src.CTNCODE)
.Map(dest => dest.CtnALL, src => src.CTNALL)
.Map(dest => dest.CTNNUM, src => src.CTNNUM)
.Map(dest => dest.PKGS, src => src.PKGS)
.Map(dest => dest.CBM, src => src.CBM)
.Map(dest => dest.KGS, src => src.KGS)
.Map(dest => dest.TareWeight, src => src.TAREWEIGHT)
.Map(dest => dest.IODGT, src => src.IODGT)
.Map(dest => dest.SpecialLoadingRequire, src => src.SPECIAL_LOADING_REQUIRE)
.Map(dest => dest.TakeCTNYard, src => src.TAKE_CTN_YARD)
.Map(dest => dest.TakeCTNTime, src => src.TAKE_CTN_TIME)
.Map(dest => dest.ReturnCTNYard, src => src.RETURN_CTN_YARD);
}
// 任务台文件信息转前端Dto TaskFileInfo, TaskFileDto
{
TypeAdapterConfig<TaskFileInfo, TaskFileDto>.NewConfig().TwoWays()
.Map(dest => dest.FilePath, src => src.FILE_PATH)
.Map(dest => dest.FileType, src => src.FILE_TYPE)
.Map(dest => dest.FileName, src => src.FILE_NAME)
.Map(dest => dest.FileCategory, src => src.FILE_CATEGORY)
.Map(dest => dest.FileCategoryName, src => src.FILE_CATEGORY_NAME);
}
// BC子任务箱信息转Entity TaskManageOrderBCCTNInfo, TaskBCCTNInfo
{
TypeAdapterConfig<TaskManageOrderBCCTNInfo, TaskBCCTNInfo>.NewConfig().TwoWays()
.Map(dest => dest.CTNCODE, src => src.CtnCode)
.Map(dest => dest.CTNALL, src => src.CtnALL)
.Map(dest => dest.CTNNUM, src => src.CTNNUM)
.Map(dest => dest.PKGS, src => src.PKGS)
.Map(dest => dest.CBM, src => src.CBM)
.Map(dest => dest.KGS, src => src.KGS)
.Map(dest => dest.TAREWEIGHT, src => src.TareWeight)
.Map(dest => dest.IODGT, src => src.IODGT)
.Map(dest => dest.SPECIAL_LOADING_REQUIRE, src => src.SpecialLoadingRequire)
.Map(dest => dest.TAKE_CTN_YARD, src => src.TakeCTNYard)
.Map(dest => dest.TAKE_CTN_TIME, src => src.TakeCTNTime)
.Map(dest => dest.RETURN_CTN_YARD, src => src.ReturnCTNYard);
}
4 months ago
//
{
TypeAdapterConfig<TaskCutDateChangeDetailInfo, TaskCutDateChangeShowDto>.NewConfig().TwoWays()
.Map(dest => dest.MBLNo, src => src.MBL_NO)
.Map(dest => dest.Vessel, src => src.VESSEL)
.Map(dest => dest.VoyNo, src => src.VOYNO)
.Map(dest => dest.SICutDate, src => src.SI_CUTOFF)
.Map(dest => dest.SICutDateTxt, src => src.SI_CUTOFF_TXT)
.Map(dest => dest.CYOpenDate, src => src.CY_OPEN)
.Map(dest => dest.CYOpenDateTxt, src => src.CY_OPEN_TXT)
.Map(dest => dest.CYCutoffTime, src => src.CY_CUTOFF)
.Map(dest => dest.CYCutoffTimeTxt, src => src.CY_CUTOFF_TXT)
.Map(dest => dest.ManifestCutDate, src => src.MANIFEST_CUT)
.Map(dest => dest.ManifestCutDateTxt, src => src.MANIFEST_CUT_TXT)
.Map(dest => dest.MDGFCutDate, src => src.MDGF_CUT)
.Map(dest => dest.MDGFCutDateTxt, src => src.MDGF_CUT_TXT)
.Map(dest => dest.VGMCutoffTime, src => src.VGM_CUT)
.Map(dest => dest.VGMCutoffTimeTxt, src => src.VGM_CUT_TXT)
.Map(dest => dest.ClosingDate, src => src.CLOSING_DATE)
.Map(dest => dest.ClosingDateTxt, src => src.CLOSING_DATE_TXT)
.Map(dest => dest.ContaNo, src => src.CONTA_NO)
.Map(dest => dest.LoadPort, src => src.LOAD_PORT)
.Map(dest => dest.ETB, src => src.ETB)
.Map(dest => dest.ETD, src => src.ETD)
.Map(dest => dest.VoucherCutoffTime, src => src.VOUCHER_CUT_DATE);
}
//
{
TypeAdapterConfig<SeaExport, TaskBookingOrderDto>.NewConfig().TwoWays()
.Map(dest => dest.MasterBlNo, src => src.MBLNO)
.Map(dest => dest.HouseBlNo, src => src.HBLNO)
.Map(dest => dest.BookingNo, src => src.BookingNo)
.Map(dest => dest.ContrNo, src => src.ContractNo)
.Map(dest => dest.ServContrNo, src => src.ServiceContractNo)
.Map(dest => dest.ShipperId, src => src.ShipperId)
.Map(dest => dest.ConsigneeId, src => src.ConsigneeId)
.Map(dest => dest.NotifyPartyId, src => src.NotifyPartyId)
.Map(dest => dest.Shipper, src => src.Shipper)
.Map(dest => dest.Consignee, src => src.Consignee)
.Map(dest => dest.NotifyParty, src => src.NotifyParty)
.Map(dest => dest.NotifyPrt2, src => src.SecondNotifyParty)
.Map(dest => dest.YardId, src => src.YardId)
.Map(dest => dest.Yard, src => src.Yard)
.Map(dest => dest.VesselId, src => src.VesselId)
.Map(dest => dest.Vessel, src => src.Vessel)
.Map(dest => dest.Voyno, src => src.Voyno)
.Map(dest => dest.VoynoIn, src => src.InnerVoyno)
.Map(dest => dest.ETD, src => src.ETD)
.Map(dest => dest.ATD, src => src.ATD)
.Map(dest => dest.ETA, src => src.ETA)
//.Map(dest => dest.ClosingDate, src => src.ClosingDate.HasValue ? src.ClosingDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
//.Map(dest => dest.CloseDocDate, src => src.CloseDocDate.HasValue ? src.CloseDocDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
//.Map(dest => dest.CloseVGMDate, src => src.CloseVgmDate.HasValue ? src.CloseVgmDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
.Map(dest => dest.PlaceReceiptId, src => src.ReceiptPlaceId)
.Map(dest => dest.PlaceReceipt, src => src.ReceiptPlace)
.Map(dest => dest.PortLoadId, src => src.LoadPortId)
.Map(dest => dest.PortLoad, src => src.LoadPort)
.Map(dest => dest.PortDischargeId, src => src.DischargePortId)
.Map(dest => dest.PortDischarge, src => src.DischargePort)
.Map(dest => dest.PlaceDeliveryId, src => src.DeliveryPlaceId)
.Map(dest => dest.PlaceDelivery, src => src.DeliveryPlace)
.Map(dest => dest.DestinationId, src => src.DestinationId)
.Map(dest => dest.Destination, src => src.Destination)
.Map(dest => dest.NoBill, src => src.NoBill)
.Map(dest => dest.CopyNoBill, src => src.CopyNoBill)
.Map(dest => dest.IssueType, src => src.IssueType)
//.Map(dest => dest.IssueDate, src => src.IssueDate.HasValue ? src.IssueDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
.Map(dest => dest.IssuePlaceId, src => src.IssuePlaceId)
.Map(dest => dest.IssuePlace, src => src.IssuePlace)
.Map(dest => dest.Blfrt, src => src.MBLFrt)
.Map(dest => dest.PrepardAt, src => src.PrepareAt)
.Map(dest => dest.PayableAt, src => src.PayableAt)
.Map(dest => dest.Service, src => src.Service)
.Map(dest => dest.Marks, src => src.Marks)
.Map(dest => dest.HsCode, src => src.HSCode)
.Map(dest => dest.GoodsDescription, src => src.Description)
.Map(dest => dest.PKGs, src => src.PKGS)
.Map(dest => dest.KindPKGs, src => src.KindPkgs)
.Map(dest => dest.KGs, src => src.KGS)
.Map(dest => dest.CBM, src => src.CBM)
.Map(dest => dest.TotalNO, src => src.TotalNo)
.Map(dest => dest.CntrTotal, src => src.CntrTotal)
.Map(dest => dest.CarrierId, src => src.CarrierId)
.Map(dest => dest.Carrier, src => src.Carrier)
.Map(dest => dest.CargoId, src => src.CargoId)
.Map(dest => dest.DClass, src => src.DangerClass)
.Map(dest => dest.DUnno, src => src.DangerNo)
.Map(dest => dest.DPage, src => src.DangerPage)
.Map(dest => dest.DLabel, src => src.DangerLabel)
.Map(dest => dest.DLinkMan, src => src.LinkMan)
.Map(dest => dest.TempSet, src => src.TemperatureSet)
.Map(dest => dest.Reeferf, src => src.ReeferQuantity)
.Map(dest => dest.Humidity, src => src.Humidity)
.Map(dest => dest.TempMin, src => src.TemperatureMin)
.Map(dest => dest.TempMax, src => src.TemperatureMax)
.Map(dest => dest.IsContaSOC, src => src.IsContainerSoc)
.Map(dest => dest.SORemark, src => src.BookingRemark)
.Map(dest => dest.SIRemark, src => src.CloseDocRemark)
.Map(dest => dest.YardRemark, src => src.YardRemark)
.Map(dest => dest.ConsigneeName, src => src.Consignee)
.Map(dest => dest.NotifyPartyName, src => src.NotifyParty)
.Map(dest => dest.CustomsER, src => src.Customser)
.Map(dest => dest.TruckER, src => src.Trucker)
.Map(dest => dest.AgentId, src => src.AgentId)
.Map(dest => dest.ForwarderId, src => src.ForwarderId)
.Map(dest => dest.ShipAgencyId, src => src.ShipAgencyId)
.Map(dest => dest.CustomsERId, src => src.CustomserId)
.Map(dest => dest.TruckERId, src => src.TruckerId)
.Map(dest => dest.AgentName, src => src.Agent)
.Map(dest => dest.PrePardAtId, src => src.PrepareAtId)
.Map(dest => dest.PayableAtId, src => src.PayableAtId)
.Map(dest => dest.CustNo, src => src.CustomerNo)
.Map(dest => dest.TransportId, src => src.TransPortId)
.Map(dest => dest.Transport, src => src.TransPort)
.Map(dest => dest.YardContractTel, src => src.YardTel)
.Map(dest => dest.YardContractEmail, src => src.YardATTN)
.Map(dest => dest.LaneCode, src => src.LaneId)
.Map(dest => dest.LaneName, src => src.Lane);
}
//
{
TypeAdapterConfig<OpCtn, TaskBookingOrderContaDto>.NewConfig().TwoWays()
.Map(dest => dest.ContaType, src => src.CtnCode)
.Map(dest => dest.ContaTypeName, src => src.CtnAll)
.Map(dest => dest.TEU, src => src.TEU)
.Map(dest => dest.ContaNo, src => src.CntrNo)
.Map(dest => dest.SealNo, src => src.SealNo)
.Map(dest => dest.PKGs, src => src.PKGS)
.Map(dest => dest.KindPKGs, src => src.KindPkgs)
.Map(dest => dest.KGs, src => src.KGS)
.Map(dest => dest.CBM, src => src.CBM)
.Map(dest => dest.TareWeight, src => src.TareWeight)
.Map(dest => dest.ContaStatus, src => src.CtnStatus)
.Map(dest => dest.WeighType, src => src.WeightType)
.Map(dest => dest.WeighKGs, src => src.WeightKGS)
.Map(dest => dest.WeighAttn, src => src.WeightATTN)
//.Map(dest => dest.VGMConnCom, src => src.VGMCONNCOM)
.Map(dest => dest.WeighTel, src => src.WeightTel)
.Map(dest => dest.WeighDate, src => src.WeightDate)
.Map(dest => dest.VGMAddr, src => src.VGMAddr)
.Map(dest => dest.VGMEmail, src => src.VGMEmail);
//.Map(dest => dest.Remark, src => src.REMARK);
}
//
{
TypeAdapterConfig<OpCtnDetail, TaskBookingOrderCargoDto>.NewConfig().TwoWays()
.Map(dest => dest.PKGs, src => src.PKGS)
.Map(dest => dest.KindPKGs, src => src.KindPkgs)
.Map(dest => dest.KGs, src => src.KGS)
.Map(dest => dest.CBM, src => src.CBM)
.Map(dest => dest.HSCode, src => src.HSCode)
.Map(dest => dest.Marks, src => src.Marks)
.Map(dest => dest.Description, src => src.Description);
//.Map(dest => dest.Remark, src => src.REMARK);
}
}
}
}