using DS.WMS.Core.TaskPlat.Entity; using Mapster; using Microsoft.Extensions.DependencyInjection; namespace DS.WMS.Core.TaskPlat.Dtos.Mapper { /// /// 任务台用的Mapster自定义映射规则 /// public static class TaskPlatMapsterSetup { /// /// 添加映射规则 /// public static void AddTaskPlatMapsterSetup(this IServiceCollection services) { // 邮件接收BC创建BC子任务 TaskManageOrderBCInfo, TaskBCInfo { TypeAdapterConfig.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.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.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.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); } } } }