列表填充数据
This commit is contained in:
@@ -28,7 +28,7 @@ namespace WMS.Web.Core.Dto.ChangeBoxRecord
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 序列号
|
/// 序列号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string SerialNumber { get; set; }
|
public string SerialNumbers { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 原箱子
|
/// 原箱子
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ namespace WMS.Web.Core.Dto.MoveBoxRecord
|
|||||||
public class MoveBoxRecordQueryInfoResponse
|
public class MoveBoxRecordQueryInfoResponse
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 物料规格型号
|
/// 规格型号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Specifications { get; set; }
|
public string Specifications { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ namespace WMS.Web.Domain.Entitys
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 序列号
|
/// 序列号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Column("SerialNumber")]
|
[Column("SerialNumbers")]
|
||||||
public string SerialNumber { get; set; }
|
public string SerialNumbers { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 原箱子ID
|
/// 原箱子ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -77,13 +77,17 @@ namespace WMS.Web.Repositories
|
|||||||
public async Task<(List<ChangeBoxRecordQueryInfoResponse> list, int total)> GetListAsync(ChangeBoxRecordQueryRequest dto)
|
public async Task<(List<ChangeBoxRecordQueryInfoResponse> list, int total)> GetListAsync(ChangeBoxRecordQueryRequest dto)
|
||||||
{
|
{
|
||||||
var query = _context.ChangeBoxRecord
|
var query = _context.ChangeBoxRecord
|
||||||
.OrderByDescending(o => o.Id)
|
.GroupJoin(_context.Box, changeBox => changeBox.SrcBoxId, srcBox => srcBox.Id, (changeBox, srcBox) => new { changeBox, srcBox })
|
||||||
|
.SelectMany(x => x.srcBox.DefaultIfEmpty(), (d, srcBox) => new { d.changeBox, srcBox })
|
||||||
|
.GroupJoin(_context.Box, d => d.changeBox.DestBoxId, destBox => destBox.Id, (d, destBox) => new { d.changeBox, d.srcBox, destBox })
|
||||||
|
.SelectMany(x => x.destBox.DefaultIfEmpty(), (d, destBox) => new { d.changeBox,d.srcBox, destBox })
|
||||||
|
.OrderByDescending(o => o.changeBox.Id)
|
||||||
.Where(adv => 1 == 1);
|
.Where(adv => 1 == 1);
|
||||||
|
|
||||||
if (dto.CreateBeginDate != null)
|
if (dto.CreateBeginDate != null)
|
||||||
query = query.Where(w => w.CreateTime >= dto.CreateBeginDate);
|
query = query.Where(w => w.changeBox.CreateTime >= dto.CreateBeginDate);
|
||||||
if (dto.CreateEndDate != null)
|
if (dto.CreateEndDate != null)
|
||||||
query = query.Where(w => w.CreateTime <= dto.CreateEndDate);
|
query = query.Where(w => w.changeBox.CreateTime <= dto.CreateEndDate);
|
||||||
//组装
|
//组装
|
||||||
int total = await query.CountAsync();
|
int total = await query.CountAsync();
|
||||||
var list = await query.Select(s => new ChangeBoxRecordQueryInfoResponse()
|
var list = await query.Select(s => new ChangeBoxRecordQueryInfoResponse()
|
||||||
@@ -92,14 +96,14 @@ namespace WMS.Web.Repositories
|
|||||||
MaterialName = "",
|
MaterialName = "",
|
||||||
MaterialNumber = "",
|
MaterialNumber = "",
|
||||||
Specifications = "",
|
Specifications = "",
|
||||||
Stock = _singleDataService.GetSingleData(SingleAction.Stocks, _loginRepositories.CompanyId, s.StockId),
|
Stock = _singleDataService.GetSingleData(SingleAction.Stocks, _loginRepositories.CompanyId, s.changeBox.StockId),
|
||||||
SerialNumber = "",
|
SerialNumbers = s.changeBox.SerialNumbers,
|
||||||
SrcBox = "",
|
SrcBox = s.srcBox.BoxBillNo,
|
||||||
DestBox = "",
|
DestBox = s.destBox.BoxBillNo,
|
||||||
SrcSubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, s.SrcSubStockId),
|
SrcSubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, s.changeBox.SrcSubStockId),
|
||||||
DestSubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, s.DestSubStockId),
|
DestSubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, s.changeBox.DestSubStockId),
|
||||||
Creator = _singleDataService.GetSingleData(SingleAction.Staffs, _loginRepositories.CompanyId, s.CreatorId),
|
Creator = _singleDataService.GetSingleData(SingleAction.Staffs, _loginRepositories.CompanyId, s.changeBox.CreatorId),
|
||||||
CreateTime =s.CreateTime.DateToStringSeconds()
|
CreateTime =s.changeBox.CreateTime.DateToStringSeconds()
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}).Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();
|
}).Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();
|
||||||
|
|||||||
@@ -77,26 +77,28 @@ namespace WMS.Web.Repositories
|
|||||||
public async Task<(List<MoveBoxRecordQueryInfoResponse> list, int total)> GetListAsync(MoveBoxRecordQueryRequest dto)
|
public async Task<(List<MoveBoxRecordQueryInfoResponse> list, int total)> GetListAsync(MoveBoxRecordQueryRequest dto)
|
||||||
{
|
{
|
||||||
var query = _context.MoveBoxRecord
|
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);
|
.Where(adv => 1 == 1);
|
||||||
|
|
||||||
if (dto.CreateBeginDate != null)
|
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)
|
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();
|
int total = await query.CountAsync();
|
||||||
var list = await query.Select(s => new MoveBoxRecordQueryInfoResponse()
|
var list = await query.Select(s => new MoveBoxRecordQueryInfoResponse()
|
||||||
{
|
{
|
||||||
#region dto组装
|
#region dto组装
|
||||||
Box = "",
|
Box = s.box.BoxBillNo,
|
||||||
SrcSubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, s.SrcSubStockId),
|
SrcSubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, s.moveBox.SrcSubStockId),
|
||||||
Specifications = "",
|
Specifications = "",
|
||||||
DestSubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, s.DestSubStockId),
|
DestSubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, s.moveBox.DestSubStockId),
|
||||||
Qty = s.Qty,
|
Qty = s.moveBox.Qty,
|
||||||
Type = s.Type.GetRemark(),
|
Type = s.moveBox.Type.GetRemark(),
|
||||||
Creator = _singleDataService.GetSingleData(SingleAction.Staffs, _loginRepositories.CompanyId, s.CreatorId),
|
Creator = _singleDataService.GetSingleData(SingleAction.Staffs, _loginRepositories.CompanyId, s.moveBox.CreatorId),
|
||||||
CreateTime = s.CreateTime.DateToStringSeconds()
|
CreateTime = s.moveBox.CreateTime.DateToStringSeconds()
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}).Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();
|
}).Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();
|
||||||
|
|||||||
Reference in New Issue
Block a user