列表填充数据
This commit is contained in:
@@ -77,26 +77,28 @@ namespace WMS.Web.Repositories
|
||||
public async Task<(List<MoveBoxRecordQueryInfoResponse> list, int total)> GetListAsync(MoveBoxRecordQueryRequest dto)
|
||||
{
|
||||
var query = _context.MoveBoxRecord
|
||||
.OrderByDescending(o => o.Id)
|
||||
.GroupJoin(_context.Box, moveBox => moveBox.BoxId, box => box.Id, (moveBox, box) => new { moveBox, box })
|
||||
.SelectMany(x => x.box.DefaultIfEmpty(), (d, box) => new { d.moveBox, box })
|
||||
.OrderByDescending(o => o.moveBox.Id)
|
||||
.Where(adv => 1 == 1);
|
||||
|
||||
if (dto.CreateBeginDate != null)
|
||||
query = query.Where(w => w.CreateTime >= dto.CreateBeginDate);
|
||||
query = query.Where(w => w.moveBox.CreateTime >= dto.CreateBeginDate);
|
||||
if (dto.CreateEndDate != null)
|
||||
query = query.Where(w => w.CreateTime <= dto.CreateEndDate);
|
||||
query = query.Where(w => w.moveBox.CreateTime <= dto.CreateEndDate);
|
||||
//组装
|
||||
int total = await query.CountAsync();
|
||||
var list = await query.Select(s => new MoveBoxRecordQueryInfoResponse()
|
||||
{
|
||||
#region dto组装
|
||||
Box = "",
|
||||
SrcSubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, s.SrcSubStockId),
|
||||
Box = s.box.BoxBillNo,
|
||||
SrcSubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, s.moveBox.SrcSubStockId),
|
||||
Specifications = "",
|
||||
DestSubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, s.DestSubStockId),
|
||||
Qty = s.Qty,
|
||||
Type = s.Type.GetRemark(),
|
||||
Creator = _singleDataService.GetSingleData(SingleAction.Staffs, _loginRepositories.CompanyId, s.CreatorId),
|
||||
CreateTime = s.CreateTime.DateToStringSeconds()
|
||||
DestSubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, s.moveBox.DestSubStockId),
|
||||
Qty = s.moveBox.Qty,
|
||||
Type = s.moveBox.Type.GetRemark(),
|
||||
Creator = _singleDataService.GetSingleData(SingleAction.Staffs, _loginRepositories.CompanyId, s.moveBox.CreatorId),
|
||||
CreateTime = s.moveBox.CreateTime.DateToStringSeconds()
|
||||
#endregion
|
||||
|
||||
}).Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();
|
||||
|
||||
Reference in New Issue
Block a user