修复bug
This commit is contained in:
@@ -209,11 +209,13 @@ namespace WMS.Web.Repositories
|
||||
|
||||
var res = await _context.OutStock
|
||||
.Include(s => s.Details).ThenInclude(s => s.ErpDetails)
|
||||
.Include(s => s.Details).ThenInclude(s => s.BoxsDetails)
|
||||
.Where(f => list.Contains(f.Id)).ToListAsync();
|
||||
|
||||
_mapper.ToMapList(entitys, res);
|
||||
_mapper.ToMapList(entitys.SelectMany(s => s.Details).ToList(), res.SelectMany(s => s.Details).ToList());
|
||||
_mapper.ToMapList(entitys.SelectMany(s => s.Details).SelectMany(s => s.ErpDetails).ToList(), res.SelectMany(s => s.Details).SelectMany(s => s.ErpDetails).ToList());
|
||||
_mapper.ToMapList(entitys.SelectMany(s => s.Details).SelectMany(s => s.BoxsDetails).ToList(), res.SelectMany(s => s.Details).SelectMany(s => s.BoxsDetails).ToList());
|
||||
await _context.SaveChangesAsync();
|
||||
if (_transaction != null)
|
||||
_transaction.Commit();
|
||||
@@ -235,8 +237,8 @@ namespace WMS.Web.Repositories
|
||||
public async Task<List<OutStock>> GetEntityList(List<int> ids)
|
||||
{
|
||||
var res = await _context.OutStock
|
||||
.Include(s => s.Details)
|
||||
.ThenInclude(s => s.ErpDetails)
|
||||
.Include(s => s.Details).ThenInclude(s => s.ErpDetails)
|
||||
.Include(s => s.Details).ThenInclude(s => s.BoxsDetails)
|
||||
.Where(f => ids.Contains(f.Id))
|
||||
.ToListAsync();
|
||||
|
||||
@@ -258,12 +260,14 @@ namespace WMS.Web.Repositories
|
||||
{
|
||||
var res = await _context.OutStock
|
||||
.Include(s => s.Details).ThenInclude(s => s.ErpDetails)
|
||||
.Include(s => s.Details).ThenInclude(s => s.BoxsDetails)
|
||||
.FirstOrDefaultAsync(f => f.Id == entity.Id);
|
||||
if (res == null) return null;
|
||||
|
||||
_mapper.Map(entity, res);
|
||||
_mapper.ToMapList(entity.Details, res.Details);
|
||||
_mapper.ToMapList(entity.Details.SelectMany(s => s.ErpDetails).ToList(), res.Details.SelectMany(s => s.ErpDetails).ToList());
|
||||
_mapper.ToMapList(entity.Details.SelectMany(s => s.BoxsDetails).ToList(), res.Details.SelectMany(s => s.BoxsDetails).ToList());
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
if (_transaction != null)
|
||||
@@ -287,6 +291,7 @@ namespace WMS.Web.Repositories
|
||||
{
|
||||
var res = await _context.OutStock
|
||||
.Include(s => s.Details).ThenInclude(s => s.ErpDetails)
|
||||
.Include(s => s.Details).ThenInclude(s => s.BoxsDetails)
|
||||
.FirstOrDefaultAsync(f => taskId == f.TaskId);
|
||||
|
||||
return res.Clone();
|
||||
|
||||
Reference in New Issue
Block a user