Merge branch 'master' of https://codeup.aliyun.com/62ce7bca487c500c27f70a79/OPS/WMS-Api
This commit is contained in:
@@ -13,12 +13,16 @@ namespace WMS.Web.Domain.Mappers
|
|||||||
{
|
{
|
||||||
public OutStockMapper()
|
public OutStockMapper()
|
||||||
{
|
{
|
||||||
CreateMap<OutStockTask, OutStockTask>();
|
CreateMap<OutStockTask, OutStockTask>()
|
||||||
CreateMap<OutStockTaskDetails, OutStockTaskDetails>();
|
.ForMember(x => x.Details, opt => opt.Ignore());
|
||||||
|
CreateMap<OutStockTaskDetails, OutStockTaskDetails>()
|
||||||
|
.ForMember(x => x.ErpDetails, opt => opt.Ignore());
|
||||||
CreateMap<OutStockTaskErpDetails, OutStockTaskErpDetails>();
|
CreateMap<OutStockTaskErpDetails, OutStockTaskErpDetails>();
|
||||||
|
|
||||||
CreateMap<OutStock, OutStock>();
|
CreateMap<OutStock, OutStock>()
|
||||||
CreateMap<OutStockDetails, OutStockDetails>();
|
.ForMember(x => x.Details, opt => opt.Ignore());
|
||||||
|
CreateMap<OutStockDetails, OutStockDetails>()
|
||||||
|
.ForMember(x => x.ErpDetails, opt => opt.Ignore());
|
||||||
CreateMap<OutStockErpDetails, OutStockErpDetails>();
|
CreateMap<OutStockErpDetails, OutStockErpDetails>();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,9 @@ namespace WMS.Web.Domain.Mappers
|
|||||||
{
|
{
|
||||||
public TakeStockMapper()
|
public TakeStockMapper()
|
||||||
{
|
{
|
||||||
CreateMap<TakeStock, TakeStock>();
|
CreateMap<TakeStock, TakeStock>()
|
||||||
|
.ForMember(x => x.Details, opt => opt.Ignore());
|
||||||
|
CreateMap<TakeStockDetails, TakeStockDetails>();
|
||||||
|
|
||||||
CreateMap<SaveTakeStockRequest, TakeStockDetails>()
|
CreateMap<SaveTakeStockRequest, TakeStockDetails>()
|
||||||
.ForMember(x => x.FinalQty, ops => ops.MapFrom(x => Math.Abs(x.AfterQty - x.BeforeQty)))
|
.ForMember(x => x.FinalQty, ops => ops.MapFrom(x => Math.Abs(x.AfterQty - x.BeforeQty)))
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ using WMS.Web.Core.Help;
|
|||||||
using WMS.Web.Domain.Entitys;
|
using WMS.Web.Domain.Entitys;
|
||||||
using WMS.Web.Domain.Infrastructure;
|
using WMS.Web.Domain.Infrastructure;
|
||||||
using WMS.Web.Domain.IService.Public;
|
using WMS.Web.Domain.IService.Public;
|
||||||
|
using WMS.Web.Domain.Mappers;
|
||||||
using WMS.Web.Domain.Values;
|
using WMS.Web.Domain.Values;
|
||||||
using WMS.Web.Domain.Values.Single;
|
using WMS.Web.Domain.Values.Single;
|
||||||
using WMS.Web.Repositories.Configuration;
|
using WMS.Web.Repositories.Configuration;
|
||||||
@@ -126,11 +127,12 @@ namespace WMS.Web.Repositories
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var res = await _context.TakeStock
|
var res = await _context.TakeStock.Include(x=>x.Details)
|
||||||
.FirstOrDefaultAsync(f => f.Id == entity.Id);
|
.FirstOrDefaultAsync(f => f.Id == entity.Id);
|
||||||
if (res == null) return null;
|
if (res == null) return null;
|
||||||
|
|
||||||
_mapper.Map(entity, res);
|
_mapper.Map(entity, res);
|
||||||
|
_mapper.ToMapList(entity.Details, res.Details);
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
if (_transaction != null)
|
if (_transaction != null)
|
||||||
@@ -148,7 +150,7 @@ namespace WMS.Web.Repositories
|
|||||||
|
|
||||||
public async Task<List<TakeStock>> GetEntityList(List<int> ids)
|
public async Task<List<TakeStock>> GetEntityList(List<int> ids)
|
||||||
{
|
{
|
||||||
var res = await _context.TakeStock
|
var res = await _context.TakeStock.Include(x=>x.Details)
|
||||||
.Where(f => ids.Contains(f.Id))
|
.Where(f => ids.Contains(f.Id))
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user