同步-优化

This commit is contained in:
tongfei
2023-12-26 11:39:39 +08:00
parent 44971d1507
commit 420d365928
5 changed files with 13 additions and 2 deletions

View File

@@ -175,14 +175,16 @@ namespace WMS.Web.Repositories
try
{
var model = await _context.Instock
.AsNoTracking()
.Include(s => s.Details)
.Include(s=>s.ErpDetails)
.FirstOrDefaultAsync(f => f.Id == entity.Id);
if (model == null)
return null;
_mapper.Map(entity, model);
//子集单独映射
_mapper.ToMapList(entity.Details, model.Details);
//子集单独映射
_mapper.ToMapList(entity.ErpDetails, model.ErpDetails);
await _context.SaveChangesAsync();
if (_transaction != null)
_transaction.Commit();
@@ -246,7 +248,7 @@ namespace WMS.Web.Repositories
.Where(f => ids.Contains(f.Id))
.ToListAsync();
return res;
return res.Clone();
}
/// <summary>