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

32 lines
1.1 KiB

2 years ago
using AutoMapper;
using Volo.Abp.AutoMapper;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Basedata.Domain;
namespace Win_in.Sfs.Basedata.Application;
public partial class BasedataApplicationAutoMapperProfile : Profile
{
private void BomAutoMapperProfile()
{
CreateMap<Bom, BomDTO>()
.Ignore(t => t.ComponentDTOs)
.ForMember(x => x.ComponentQty, y => y.MapFrom(d => d.ComponentQty))
.ForMember(x => x.ComponentUom, y => y.MapFrom(d => d.ComponentUom))
//.Ignore(x => x.PerQty) 为何么要忽略啊,回冲需要 刘恩亮 20220503
.ReverseMap();
CreateMap<BomImportInput, Bom>()
.ForMember(x => x.ComponentQty, y => y.MapFrom(d => d.ComponentQty))
.ForMember(x => x.ComponentUom, y => y.MapFrom(d => d.ComponentUom))
.ForMember(x => x.Layer, y => y.MapFrom(d => 1))
.Ignore(x => x.TenantId)
.IgnoreAuditedObjectProperties()
.Ignore(x => x.ConcurrencyStamp)
.Ignore(x => x.ExtraProperties)
// .Ignore(x => x.Remark)
;
}
}