Merge branch 'master' of https://codeup.aliyun.com/62ce7bca487c500c27f70a79/OPS/WMS-Api
This commit is contained in:
@@ -28,7 +28,7 @@ namespace WMS.Web.Core.Dto.ChangeBoxRecord
|
||||
/// <summary>
|
||||
/// 序列号
|
||||
/// </summary>
|
||||
public string SerialNumber { get; set; }
|
||||
public string SerialNumbers { get; set; }
|
||||
/// <summary>
|
||||
/// 原箱子
|
||||
/// </summary>
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace WMS.Web.Core.Dto.MoveBoxRecord
|
||||
public class MoveBoxRecordQueryInfoResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 物料规格型号
|
||||
/// 规格型号
|
||||
/// </summary>
|
||||
public string Specifications { get; set; }
|
||||
/// <summary>
|
||||
|
||||
@@ -32,8 +32,8 @@ namespace WMS.Web.Domain.Entitys
|
||||
/// <summary>
|
||||
/// 序列号
|
||||
/// </summary>
|
||||
[Column("SerialNumber")]
|
||||
public string SerialNumber { get; set; }
|
||||
[Column("SerialNumbers")]
|
||||
public string SerialNumbers { get; set; }
|
||||
/// <summary>
|
||||
/// 原箱子ID
|
||||
/// </summary>
|
||||
|
||||
@@ -100,6 +100,11 @@ namespace WMS.Web.Domain.Values.Single
|
||||
/// </summary>
|
||||
[EnumRemark("菜单")]
|
||||
Menus = 18,
|
||||
/// <summary>
|
||||
/// 仓位集合
|
||||
/// </summary>
|
||||
[EnumRemark("仓位")]
|
||||
SubStocks = 19,
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,13 +77,17 @@ namespace WMS.Web.Repositories
|
||||
public async Task<(List<ChangeBoxRecordQueryInfoResponse> list, int total)> GetListAsync(ChangeBoxRecordQueryRequest dto)
|
||||
{
|
||||
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);
|
||||
|
||||
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)
|
||||
query = query.Where(w => w.CreateTime <= dto.CreateEndDate);
|
||||
query = query.Where(w => w.changeBox.CreateTime <= dto.CreateEndDate);
|
||||
//组装
|
||||
int total = await query.CountAsync();
|
||||
var list = await query.Select(s => new ChangeBoxRecordQueryInfoResponse()
|
||||
@@ -92,14 +96,14 @@ namespace WMS.Web.Repositories
|
||||
MaterialName = "",
|
||||
MaterialNumber = "",
|
||||
Specifications = "",
|
||||
Stock = _singleDataService.GetSingleData(SingleAction.Stocks, _loginRepositories.CompanyId, s.StockId),
|
||||
SerialNumber = "",
|
||||
SrcBox = "",
|
||||
DestBox = "",
|
||||
SrcSubStock = "",
|
||||
DestSubStock = "",
|
||||
Creator = _singleDataService.GetSingleData(SingleAction.Staffs, _loginRepositories.CompanyId, s.CreatorId),
|
||||
CreateTime =s.CreateTime.DateToStringSeconds()
|
||||
Stock = _singleDataService.GetSingleData(SingleAction.Stocks, _loginRepositories.CompanyId, s.changeBox.StockId),
|
||||
SerialNumbers = s.changeBox.SerialNumbers,
|
||||
SrcBox = s.srcBox.BoxBillNo,
|
||||
DestBox = s.destBox.BoxBillNo,
|
||||
SrcSubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, s.changeBox.SrcSubStockId),
|
||||
DestSubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, s.changeBox.DestSubStockId),
|
||||
Creator = _singleDataService.GetSingleData(SingleAction.Staffs, _loginRepositories.CompanyId, s.changeBox.CreatorId),
|
||||
CreateTime =s.changeBox.CreateTime.DateToStringSeconds()
|
||||
#endregion
|
||||
|
||||
}).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)
|
||||
{
|
||||
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 = "",
|
||||
Box = s.box.BoxBillNo,
|
||||
SrcSubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, s.moveBox.SrcSubStockId),
|
||||
Specifications = "",
|
||||
DestSubStock = "",
|
||||
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();
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace WMS.Web.Repositories
|
||||
SourceBillNo=s.detail.SourceBillNo,
|
||||
SaleBillNo = s.detail.SaleBillNo,
|
||||
DeliveryOrg = "",
|
||||
ReceiptCustomer = "",
|
||||
ReceiptCustomer = _singleDataService.GetSingleData(SingleAction.Customers, _loginRepositories.CompanyId, s.detail.ReceiptCustomerId),
|
||||
MaterialName = "",
|
||||
MaterialNumber = "",
|
||||
Specifications = "",
|
||||
|
||||
@@ -186,7 +186,7 @@ namespace WMS.Web.Repositories
|
||||
SourceBillNo = s.detail.SourceBillNo,
|
||||
SaleBillNo = s.detail.SaleBillNo,
|
||||
DeliveryOrg = "",
|
||||
ReceiptCustomer = "",
|
||||
ReceiptCustomer = _singleDataService.GetSingleData(SingleAction.Customers, _loginRepositories.CompanyId, s.detail.ReceiptCustomerId),
|
||||
MaterialName = "",
|
||||
MaterialNumber = "",
|
||||
Specifications = ""
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace WMS.Web.Repositories
|
||||
BillNo = s.order.BillNo,
|
||||
Unit = _singleDataService.GetSingleData(SingleAction.Units, _loginRepositories.CompanyId, s.detail.UnitId),
|
||||
Stock = _singleDataService.GetSingleData(SingleAction.Stocks, _loginRepositories.CompanyId, s.detail.StockId),
|
||||
SubStock = "",
|
||||
SubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, s.detail.SubStockId),
|
||||
BeforeQty = s.detail.BeforeQty,
|
||||
AfterQty = s.detail.AfterQty,
|
||||
FinalQty = s.detail.FinalQty,
|
||||
|
||||
Reference in New Issue
Block a user