Browse Source

同上

dev_DY_CC
刘云峰 11 months ago
parent
commit
091eba0f0a
  1. 140
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SplitPackings/SplitPackingRecAutoMapperProfile.cs

140
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SplitPackings/SplitPackingRecAutoMapperProfile.cs

@ -9,15 +9,15 @@ public partial class BasedataApplicationAutoMapperProfile : Profile
{ {
private void SplitPackingRecAutoMapperProfile() private void SplitPackingRecAutoMapperProfile()
{ {
CreateMap<SplitPackingRec, SplitPackingRecDTO>() CreateMap<SplitPackingRec, SplitPackingRecDTO>();
.MapPurchaseInfo() //.MapPurchaseInfo()
.MapProductionInfo() //.MapProductionInfo()
.MapQualityInfo(); //.MapQualityInfo();
CreateMap<SplitPackingRecEditInput, SplitPackingRec>() CreateMap<SplitPackingRecEditInput, SplitPackingRec>()
.MapQualityInfoDto() //.MapQualityInfoDto()
.MapPurchaseInfoDto() //.MapPurchaseInfoDto()
.MapProductionInfoDto() //.MapProductionInfoDto()
.Ignore(t => t.FromTopPackingCode) .Ignore(t => t.FromTopPackingCode)
.Ignore(t => t.ToTopPackingCode) .Ignore(t => t.ToTopPackingCode)
.Ignore(t => t.LastModificationTime) .Ignore(t => t.LastModificationTime)
@ -30,71 +30,71 @@ public partial class BasedataApplicationAutoMapperProfile : Profile
} }
} }
public static class LabelCommonMapperExtensions //public static class LabelCommonMapperExtensions
{ //{
public static IMappingExpression<TSource, TDestination> MapPurchaseInfo<TSource, TDestination>( // public static IMappingExpression<TSource, TDestination> MapPurchaseInfo<TSource, TDestination>(
this IMappingExpression<TSource, TDestination> m) // this IMappingExpression<TSource, TDestination> m)
where TSource : IHasPurchaseInfo // where TSource : IHasPurchaseInfo
where TDestination : IHasPurchaseInfoDto // where TDestination : IHasPurchaseInfoDto
{ // {
return m // return m
.ForMember(dest => dest.SupplierCode, opts => opts.MapFrom(src => src.PurchaseInfo.SupplierCode)) // .ForMember(dest => dest.SupplierCode, opts => opts.MapFrom(src => src.PurchaseInfo.SupplierCode))
.ForMember(dest => dest.PoNumber, opts => opts.MapFrom(src => src.PurchaseInfo.PoNumber)) // .ForMember(dest => dest.PoNumber, opts => opts.MapFrom(src => src.PurchaseInfo.PoNumber))
.ForMember(dest => dest.RpNumber, opts => opts.MapFrom(src => src.PurchaseInfo.RpNumber)) // .ForMember(dest => dest.RpNumber, opts => opts.MapFrom(src => src.PurchaseInfo.RpNumber))
.ForMember(dest => dest.AsnNumber, opts => opts.MapFrom(src => src.PurchaseInfo.AsnNumber)) // .ForMember(dest => dest.AsnNumber, opts => opts.MapFrom(src => src.PurchaseInfo.AsnNumber))
; // ;
} // }
public static IMappingExpression<TSource, TDestination> MapProductionInfo<TSource, TDestination>( // public static IMappingExpression<TSource, TDestination> MapProductionInfo<TSource, TDestination>(
this IMappingExpression<TSource, TDestination> m) // this IMappingExpression<TSource, TDestination> m)
where TSource : IHasProductionInfo // where TSource : IHasProductionInfo
where TDestination : IHasProductionInfoDto // where TDestination : IHasProductionInfoDto
{ // {
return m // return m
.ForMember(dest => dest.ProdLine, opts => opts.MapFrom(src => src.ProductionInfo.ProdLine)) // .ForMember(dest => dest.ProdLine, opts => opts.MapFrom(src => src.ProductionInfo.ProdLine))
.ForMember(dest => dest.Team, opts => opts.MapFrom(src => src.ProductionInfo.Team)) // .ForMember(dest => dest.Team, opts => opts.MapFrom(src => src.ProductionInfo.Team))
.ForMember(dest => dest.Shift, opts => opts.MapFrom(src => src.ProductionInfo.Shift)) // .ForMember(dest => dest.Shift, opts => opts.MapFrom(src => src.ProductionInfo.Shift))
; // ;
} // }
public static IMappingExpression<TSource, TDestination> MapPurchaseInfoDto<TSource, TDestination>( // public static IMappingExpression<TSource, TDestination> MapPurchaseInfoDto<TSource, TDestination>(
this IMappingExpression<TSource, TDestination> m) // this IMappingExpression<TSource, TDestination> m)
where TSource : IHasPurchaseInfoDto // where TSource : IHasPurchaseInfoDto
where TDestination : IHasPurchaseInfo // where TDestination : IHasPurchaseInfo
{ // {
return m // return m
.ForMember(dest => dest.PurchaseInfo, opts => opts.MapFrom(src => new PurchaseInfo(src.SupplierCode, src.PoNumber, src.RpNumber, src.AsnNumber))) // .ForMember(dest => dest.PurchaseInfo, opts => opts.MapFrom(src => new PurchaseInfo(src.SupplierCode, src.PoNumber, src.RpNumber, src.AsnNumber)))
; // ;
} // }
public static IMappingExpression<TSource, TDestination> MapProductionInfoDto<TSource, TDestination>( // public static IMappingExpression<TSource, TDestination> MapProductionInfoDto<TSource, TDestination>(
this IMappingExpression<TSource, TDestination> m) // this IMappingExpression<TSource, TDestination> m)
where TSource : IHasProductionInfoDto // where TSource : IHasProductionInfoDto
where TDestination : IHasProductionInfo // where TDestination : IHasProductionInfo
{ // {
return m // return m
.ForMember(dest => dest.ProductionInfo, opts => opts.MapFrom(src => new ProductionInfo(src.ProdLine, src.Team, src.Shift))) // .ForMember(dest => dest.ProductionInfo, opts => opts.MapFrom(src => new ProductionInfo(src.ProdLine, src.Team, src.Shift)))
; // ;
} // }
public static IMappingExpression<TSource, TDestination> MapQualityInfo<TSource, TDestination>( // public static IMappingExpression<TSource, TDestination> MapQualityInfo<TSource, TDestination>(
this IMappingExpression<TSource, TDestination> m) // this IMappingExpression<TSource, TDestination> m)
where TSource : IHasQualityInfo // where TSource : IHasQualityInfo
where TDestination : IHasQualityInfoDto // where TDestination : IHasQualityInfoDto
{ // {
return m // return m
.ForMember(dest => dest.QLevel, opts => opts.MapFrom(src => src.QualityInfo.QLevel)) // .ForMember(dest => dest.QLevel, opts => opts.MapFrom(src => src.QualityInfo.QLevel))
.ForMember(dest => dest.QualityFile, opts => opts.MapFrom(src => src.QualityInfo.QualityFile)) // .ForMember(dest => dest.QualityFile, opts => opts.MapFrom(src => src.QualityInfo.QualityFile))
; // ;
} // }
public static IMappingExpression<TSource, TDestination> MapQualityInfoDto<TSource, TDestination>( // public static IMappingExpression<TSource, TDestination> MapQualityInfoDto<TSource, TDestination>(
this IMappingExpression<TSource, TDestination> m) // this IMappingExpression<TSource, TDestination> m)
where TSource : IHasQualityInfoDto // where TSource : IHasQualityInfoDto
where TDestination : IHasQualityInfo // where TDestination : IHasQualityInfo
{ // {
return m // return m
.ForMember(dest => dest.QualityInfo, opts => opts.MapFrom(src => new QualityInfo(src.QLevel, src.QualityFile))) // .ForMember(dest => dest.QualityInfo, opts => opts.MapFrom(src => new QualityInfo(src.QLevel, src.QualityFile)))
; // ;
} // }
} //}

Loading…
Cancel
Save