修复bug

This commit is contained in:
18942506660
2024-05-29 12:00:32 +08:00
parent 8fa307bd8a
commit f459f4e8aa
2 changed files with 6 additions and 3 deletions

View File

@@ -124,7 +124,7 @@ namespace WMS.Web.Domain.Infrastructure
/// <returns></returns> /// <returns></returns>
Task<bool> UpdateRange(List<InStockDetails> entitys, bool isTransaction = true); Task<bool> UpdateRange(List<InStockDetails> entitys, bool isTransaction = true);
/// <summary> /// <summary>
/// 获取-已入库的箱 /// 获取-非采购上将已入库的箱
/// </summary> /// </summary>
/// <param name="boxIds"></param> /// <param name="boxIds"></param>
/// <returns></returns> /// <returns></returns>

View File

@@ -488,13 +488,16 @@ namespace WMS.Web.Repositories
} }
} }
/// <summary> /// <summary>
/// 获取已入库的箱 /// 获取非采购上将已入库的箱
/// </summary> /// </summary>
/// <param name="boxIds"></param> /// <param name="boxIds"></param>
/// <returns></returns> /// <returns></returns>
public async Task<List<int>> GetInstockBoxIds(List<int> boxIds) public async Task<List<int>> GetInstockBoxIds(List<int> boxIds)
{ {
return await _context.InStockDetails.Where(x => boxIds.Contains(x.BoxId)).Select(s => s.BoxId).ToListAsync(); return await _context.InStockDetails
.GroupJoin(_context.Instock, detail => detail.Fid, order => order.Id, (detail, orders) => new { detail, orders })
.SelectMany(x => x.orders.DefaultIfEmpty(), (p, order) => new { p.detail, order })
.Where(x => boxIds.Contains(x.detail.BoxId) && x.order.Type != InstockType.Purchase).Select(s => s.detail.BoxId).ToListAsync();
} }
} }
} }