using Autofac.Builder;
|
using AutoMapper;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using WIDESEA_Common.OrderEnum;
|
using WIDESEA_Common.StockEnum;
|
using WIDESEA_Core.Helper;
|
using WIDESEA_DTO;
|
using WIDESEA_DTO.ERP;
|
using WIDESEA_DTO.Inbound;
|
using WIDESEA_DTO.MES;
|
using WIDESEA_DTO.Outbound;
|
using WIDESEA_DTO.System;
|
using WIDESEA_DTO.Task;
|
using WIDESEA_Model.Models;
|
|
namespace WIDESEA_WMSServer.Filter
|
{
|
public class CustomProfile : Profile
|
{
|
/// <summary>
|
/// 配置构造函数,用来创建关系映射
|
/// </summary>
|
public CustomProfile()
|
{
|
CreateMap<Sys_Menu, MenuDTO>();
|
CreateMap<InboundOrderDetailAddDTO, Dt_InboundOrderDetail>().ForMember(x => x.OrderDetailStatus, b => b.MapFrom(b => 0));
|
CreateMap<InboundOrderAddDTO, Dt_InboundOrder>();
|
|
CreateMap<Dt_StockInfoDetail, Dt_StockQuantityChangeRecord>().ForMember(x => x.SerilNumber, b => b.MapFrom(b => b.SerialNumber)).ForMember(x => x.StockDetailId, b => b.MapFrom(b => b.Id));
|
CreateMap<OutboundOrderDetailAddDTO, Dt_OutboundOrderDetail>().ForMember(x => x.OrderDetailStatus, b => b.MapFrom(b => 0));
|
CreateMap<OutboundOrderAddDTO, Dt_OutboundOrder>();
|
CreateMap<Dt_ReceiveOrderDetail, Dt_CheckOrder>().ForMember(a => a.ReceivedQuantity, b => b.MapFrom(x => x.ReceivedQuantity)).ForMember(a => a.MaterielCode, b => b.MapFrom(x => x.MaterielCode)).ForMember(a => a.CheckOrderStatus, b => b.MapFrom(x => CheckOrderStatusEnum.NotCheck.ObjToInt()));
|
|
CreateMap<Dt_Task, WMSTaskDTO>();
|
CreateMap<MESBagDetail, Dt_MesProInOrderDetail>().ForMember(x => x.OverInQuantity, b => b.MapFrom(b => 0));
|
CreateMap<ErpProOutOrderDetailds, Dt_ProOutOrderDetail>().ForMember(x => x.ProOrderDetailStatus, b => b.MapFrom(b => 0)).ForMember(x => x.OverQtyPcs, b => b.MapFrom(b => 0));
|
CreateMap<Dt_MesProInOrderDetail, Dt_ProStockInfoDetail>().ForMember(x => x.ProOutDetailStatus, b => b.MapFrom(b => StockStatusEmun.组盘暂存.ObjToInt())).ForMember(x => x.OutboundQuantity, b => b.MapFrom(b => 0)).ForMember(x => x.StockPcsQty, b => b.MapFrom(b => b.OKPCSQTY));
|
CreateMap<ErpProductWarehousingOrderDTO, Dt_ErpProInOrder>().ForMember(x => x.ProSaleOrderNo, b => b.MapFrom(b => b.SaleOrder)).ForMember(x => x.Remark, b => b.MapFrom(b => b.Note)).ForMember(x => x.UpperOrderNo, b => b.MapFrom(b => b.TransferNo)).ForMember(x => x.ProStockAttribute, b => b.MapFrom(b => ProStockAttributeEnum.成品.ObjToInt())).ForMember(x => x.ProInStatus, b => b.MapFrom(b => InOrderStatusEnum.未开始.ObjToInt()));
|
CreateMap<ErpProductTransferOrderDTO, Dt_ErpProTransferOrder>().ForMember(x => x.ProSaleOrderNo, b => b.MapFrom(b => b.SaleOrder)).ForMember(x => x.Remark, b => b.MapFrom(b => b.Note)).ForMember(x => x.UpperOrderNo, b => b.MapFrom(b => b.TransferNo)).ForMember(x => x.OrderType, b => b.MapFrom(b => ErpProOutTypeEnum.ProOutAllocat.ObjToInt())).ForMember(x => x.ProStockAttribute, b => b.MapFrom(b => ProStockAttributeEnum.研发.ObjToInt()));
|
}
|
}
|
}
|