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
4.1 KiB
C#

using Mapster;
using Myshipping.Application.Entity;
using StackExchange.Profiling.Internal;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
public class ParaDtoMapper : IRegister
{
public void Register(TypeAdapterConfig config)
{
config.ForType<ParaGoodsInfo, ParaGoodsDto>()
.Map(dest => dest.Id, src => src.Id)
.Map(dest => dest.GoodsCode, src => src.GOODS_CODE)
.Map(dest => dest.GoodsNameCN, src => src.GOODS_NAME_CN)
.Map(dest => dest.GoodsNameEN, src => src.GOODS_NAME_EN)
.Map(dest => dest.GoodsDesp, src => src.GOODS_DESP)
.Map(dest => dest.GoodsCategory, src => src.GOODS_CATEGORY)
.Map(dest => dest.GoodsCategoryName, src => src.GOODS_CATEGORY_NAME)
.Map(dest => dest.CreateUserId, src => src.CreatedUserId)
.Map(dest => dest.CreateUserName, src => src.CreatedUserName)
.Map(dest => dest.CreateTime, src => src.CreatedTime)
.Map(dest => dest.UpdateUserId, src => src.UpdatedUserId)
.Map(dest => dest.UpdateUserName, src => src.UpdatedUserName)
.Map(dest => dest.UpdateTime, src => src.UpdatedTime);
config.ForType<ParaGoodsDto, ParaGoodsInfo>()
.Map(dest => dest.Id, src => !string.IsNullOrWhiteSpace(src.Id) ? long.Parse(src.Id) : 0)
.Map(dest => dest.GOODS_CODE, src => src.GoodsCode)
.Map(dest => dest.GOODS_NAME_CN, src => src.GoodsNameCN)
.Map(dest => dest.GOODS_NAME_EN, src => src.GoodsNameEN)
.Map(dest => dest.GOODS_DESP, src => src.GoodsDesp)
.Map(dest => dest.GOODS_CATEGORY, src => src.GoodsCategory)
.Map(dest => dest.GOODS_CATEGORY_NAME, src => src.GoodsCategoryName);
config.ForType<ParaGoodsCategoryInfo, ParaGoodsCategoryDto>()
.Map(dest => dest.Id, src => src.Id)
.Map(dest => dest.GoodsCategory, src => src.GOODS_CATEGORY)
.Map(dest => dest.GoodsCategoryName, src => src.GOODS_CATEGORY_NAME)
.Map(dest => dest.CreateUserId, src => src.CreatedUserId)
.Map(dest => dest.CreateUserName, src => src.CreatedUserName)
.Map(dest => dest.CreateTime, src => src.CreatedTime)
.Map(dest => dest.UpdateUserId, src => src.UpdatedUserId)
.Map(dest => dest.UpdateUserName, src => src.UpdatedUserName)
.Map(dest => dest.UpdateTime, src => src.UpdatedTime);
config.ForType<ParaGoodsCategoryDto, ParaGoodsCategoryInfo>()
.Map(dest => dest.Id, src => !string.IsNullOrWhiteSpace(src.Id) ? long.Parse(src.Id) : 0)
.Map(dest => dest.GOODS_CATEGORY, src => src.GoodsCategory)
.Map(dest => dest.GOODS_CATEGORY_NAME, src => src.GoodsCategoryName);
config.ForType<ParaContractNoInfo, ParaContractNoDto>()
.Map(dest => dest.Id, src => src.Id)
.Map(dest => dest.ContractNo, src => src.CONTRACT_NO)
.Map(dest => dest.ContractName, src => src.CONTRACT_NAME)
.Map(dest => dest.ContractNote, src => src.CONTRACT_NOTE)
.Map(dest => dest.CreateUserId, src => src.CreatedUserId)
.Map(dest => dest.CreateUserName, src => src.CreatedUserName)
.Map(dest => dest.CreateTime, src => src.CreatedTime)
.Map(dest => dest.UpdateUserId, src => src.UpdatedUserId)
.Map(dest => dest.UpdateUserName, src => src.UpdatedUserName)
.Map(dest => dest.UpdateTime, src => src.UpdatedTime);
config.ForType<ParaContractNoDto, ParaContractNoInfo>()
.Map(dest => dest.Id, src => !string.IsNullOrWhiteSpace(src.Id) ? long.Parse(src.Id) : 0)
.Map(dest => dest.CONTRACT_NO, src => src.ContractNo)
.Map(dest => dest.CONTRACT_NAME, src => src.ContractName)
.Map(dest => dest.CONTRACT_NOTE, src => src.ContractNote);
}
}
}