仓库获取的优化

This commit is contained in:
tongfei
2023-11-22 09:34:02 +08:00
parent fb67d6e8e2
commit b1c557c876
7 changed files with 17 additions and 10 deletions

View File

@@ -65,6 +65,8 @@ namespace WMS.Web.Repositories
var query = _context.BackRecordDetails
.GroupJoin(_context.BackRecord, detail => detail.Fid, order => order.Id, (detail, orders) => new { detail, orders })
.SelectMany(x => x.orders.DefaultIfEmpty(), (p, order) => new { p.detail, order })
.GroupJoin(_context.Box, p => p.detail.BoxId, ts => ts.Id, (p, ts) => new { p.detail, p.order, ts })
.SelectMany(x => x.ts.DefaultIfEmpty(), (p, box) => new { p.detail, p.order,box })
.Where(adv => 1 == 1);
if (dto.SubStockId.HasValue)
@@ -81,7 +83,7 @@ namespace WMS.Web.Repositories
Id = s.order.Id,
DetailsId = s.detail.Id,
BillNo=s.order.BillNo,
BoxBillNo ="",
BoxBillNo = s.box.BoxBillNo,
Type = s.order.Type.GetRemark(),
Creator = _singleDataService.GetSingleData(SingleAction.Staffs, _loginRepositories.CompanyId, s.order.CreatorId),
CreateTime =s.order.CreateTime,
@@ -89,7 +91,7 @@ namespace WMS.Web.Repositories
MaterialNumber = _erpBasicDataExtendService.GetMaterialNumber(materials, s.detail.MaterialId),
Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, s.detail.MaterialId),
Qty = s.detail.Qty,
SubStock = "",
SubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, s.detail.SubStockId),
SerialNumbers = JsonConvert.SerializeObject(s.detail.SerialNumbers),
}).OrderByDescending(x => x.Id).Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();