修复bug
This commit is contained in:
@@ -1657,11 +1657,11 @@
|
||||
解绑
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.Entitys.SerialNumbers.OutStock(System.Collections.Generic.List{System.String},WMS.Web.Domain.Values.OutStockType,System.Int32)">
|
||||
<member name="M:WMS.Web.Domain.Entitys.SerialNumbers.OutStock(WMS.Web.Domain.Entitys.OutStock,System.Int32)">
|
||||
<summary>
|
||||
出库
|
||||
</summary>
|
||||
<param name="salBillNos">出库单号</param>
|
||||
<param name="outStock">出库单</param>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.Entitys.SerialNumbers.InStock(System.String,WMS.Web.Domain.Values.InstockType)">
|
||||
<summary>
|
||||
|
||||
@@ -22,7 +22,8 @@ namespace WMS.Web.Domain.Mappers
|
||||
CreateMap<OutStock, OutStock>()
|
||||
.ForMember(x => x.Details, opt => opt.Ignore());
|
||||
CreateMap<OutStockDetails, OutStockDetails>()
|
||||
.ForMember(x => x.ErpDetails, opt => opt.Ignore());
|
||||
.ForMember(x => x.ErpDetails, opt => opt.Ignore())
|
||||
.ForMember(x => x.BoxsDetails, opt => opt.Ignore());
|
||||
CreateMap<OutStockErpDetails, OutStockErpDetails>();
|
||||
|
||||
|
||||
|
||||
@@ -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