箱库存

This commit is contained in:
tongfei
2023-11-23 13:46:14 +08:00
parent 0f9df885b2
commit 8afbfb97d4
3 changed files with 28 additions and 24 deletions

View File

@@ -114,12 +114,25 @@ namespace WMS.Web.Repositories
.SelectMany(x => x.ts.DefaultIfEmpty(), (p, box) => new { p.boxinvent, box })
.Where(x => 1 == 1 && x.box.BoxBillNo==boxBillNo).Select(x=>x.boxinvent).FirstOrDefaultAsync();
var response = _mapper.Map<BoxInventoryResponse>(entity);
if (response != null)
{
var serialNumbs = await _context.SerialNumbers.Where(x => x.BoxId == response.BoxId).ToListAsync();
response.Stock = _singleDataService.GetSingleData(SingleAction.StocksJoinOrgCode, _loginRepositories.CompanyId, response.StockCode + response.OrgCode);
response.SubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, response.SubStockId);
response.Details = _mapper.Map<List<BoxInventoryDetailsResponse>>(entity.Details);
if (response.Details != null && response.Details.Count != 0)
{
response.Details.ForEach(x =>
{
x.SerialNumbers = serialNumbs.Where(x => x.MaterialId == x.MaterialId).Select(x=>x.SerialNumber).ToList();
});
}
response.TotalCount = response.Details.Count();
}