修复bug
This commit is contained in:
@@ -1657,11 +1657,11 @@
|
|||||||
解绑
|
解绑
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</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>
|
||||||
出库
|
出库
|
||||||
</summary>
|
</summary>
|
||||||
<param name="salBillNos">出库单号</param>
|
<param name="outStock">出库单</param>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:WMS.Web.Domain.Entitys.SerialNumbers.InStock(System.String,WMS.Web.Domain.Values.InstockType)">
|
<member name="M:WMS.Web.Domain.Entitys.SerialNumbers.InStock(System.String,WMS.Web.Domain.Values.InstockType)">
|
||||||
<summary>
|
<summary>
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ namespace WMS.Web.Domain.Mappers
|
|||||||
CreateMap<OutStock, OutStock>()
|
CreateMap<OutStock, OutStock>()
|
||||||
.ForMember(x => x.Details, opt => opt.Ignore());
|
.ForMember(x => x.Details, opt => opt.Ignore());
|
||||||
CreateMap<OutStockDetails, OutStockDetails>()
|
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>();
|
CreateMap<OutStockErpDetails, OutStockErpDetails>();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -209,11 +209,13 @@ namespace WMS.Web.Repositories
|
|||||||
|
|
||||||
var res = await _context.OutStock
|
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 => list.Contains(f.Id)).ToListAsync();
|
.Where(f => list.Contains(f.Id)).ToListAsync();
|
||||||
|
|
||||||
_mapper.ToMapList(entitys, res);
|
_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).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.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();
|
await _context.SaveChangesAsync();
|
||||||
if (_transaction != null)
|
if (_transaction != null)
|
||||||
_transaction.Commit();
|
_transaction.Commit();
|
||||||
@@ -235,8 +237,8 @@ namespace WMS.Web.Repositories
|
|||||||
public async Task<List<OutStock>> GetEntityList(List<int> ids)
|
public async Task<List<OutStock>> GetEntityList(List<int> ids)
|
||||||
{
|
{
|
||||||
var res = await _context.OutStock
|
var res = await _context.OutStock
|
||||||
.Include(s => s.Details)
|
.Include(s => s.Details).ThenInclude(s => s.ErpDetails)
|
||||||
.ThenInclude(s => s.ErpDetails)
|
.Include(s => s.Details).ThenInclude(s => s.BoxsDetails)
|
||||||
.Where(f => ids.Contains(f.Id))
|
.Where(f => ids.Contains(f.Id))
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
@@ -258,12 +260,14 @@ namespace WMS.Web.Repositories
|
|||||||
{
|
{
|
||||||
var res = await _context.OutStock
|
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)
|
||||||
.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);
|
_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.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();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
if (_transaction != null)
|
if (_transaction != null)
|
||||||
@@ -287,6 +291,7 @@ namespace WMS.Web.Repositories
|
|||||||
{
|
{
|
||||||
var res = await _context.OutStock
|
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)
|
||||||
.FirstOrDefaultAsync(f => taskId == f.TaskId);
|
.FirstOrDefaultAsync(f => taskId == f.TaskId);
|
||||||
|
|
||||||
return res.Clone();
|
return res.Clone();
|
||||||
|
|||||||
Reference in New Issue
Block a user