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>
|
||||||
/// 序列号
|
/// 序列号
|
||||||
/// </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>
|
||||||
|
|||||||
@@ -100,6 +100,11 @@ namespace WMS.Web.Domain.Values.Single
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[EnumRemark("菜单")]
|
[EnumRemark("菜单")]
|
||||||
Menus = 18,
|
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)
|
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 = "",
|
SrcSubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, s.changeBox.SrcSubStockId),
|
||||||
DestSubStock = "",
|
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 = "",
|
SrcSubStock = _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, s.moveBox.SrcSubStockId),
|
||||||
Specifications = "",
|
Specifications = "",
|
||||||
DestSubStock = "",
|
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();
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ namespace WMS.Web.Repositories
|
|||||||
SourceBillNo=s.detail.SourceBillNo,
|
SourceBillNo=s.detail.SourceBillNo,
|
||||||
SaleBillNo = s.detail.SaleBillNo,
|
SaleBillNo = s.detail.SaleBillNo,
|
||||||
DeliveryOrg = "",
|
DeliveryOrg = "",
|
||||||
ReceiptCustomer = "",
|
ReceiptCustomer = _singleDataService.GetSingleData(SingleAction.Customers, _loginRepositories.CompanyId, s.detail.ReceiptCustomerId),
|
||||||
MaterialName = "",
|
MaterialName = "",
|
||||||
MaterialNumber = "",
|
MaterialNumber = "",
|
||||||
Specifications = "",
|
Specifications = "",
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ namespace WMS.Web.Repositories
|
|||||||
SourceBillNo = s.detail.SourceBillNo,
|
SourceBillNo = s.detail.SourceBillNo,
|
||||||
SaleBillNo = s.detail.SaleBillNo,
|
SaleBillNo = s.detail.SaleBillNo,
|
||||||
DeliveryOrg = "",
|
DeliveryOrg = "",
|
||||||
ReceiptCustomer = "",
|
ReceiptCustomer = _singleDataService.GetSingleData(SingleAction.Customers, _loginRepositories.CompanyId, s.detail.ReceiptCustomerId),
|
||||||
MaterialName = "",
|
MaterialName = "",
|
||||||
MaterialNumber = "",
|
MaterialNumber = "",
|
||||||
Specifications = ""
|
Specifications = ""
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ namespace WMS.Web.Repositories
|
|||||||
BillNo = s.order.BillNo,
|
BillNo = s.order.BillNo,
|
||||||
Unit = _singleDataService.GetSingleData(SingleAction.Units, _loginRepositories.CompanyId, s.detail.UnitId),
|
Unit = _singleDataService.GetSingleData(SingleAction.Units, _loginRepositories.CompanyId, s.detail.UnitId),
|
||||||
Stock = _singleDataService.GetSingleData(SingleAction.Stocks, _loginRepositories.CompanyId, s.detail.StockId),
|
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,
|
BeforeQty = s.detail.BeforeQty,
|
||||||
AfterQty = s.detail.AfterQty,
|
AfterQty = s.detail.AfterQty,
|
||||||
FinalQty = s.detail.FinalQty,
|
FinalQty = s.detail.FinalQty,
|
||||||
|
|||||||
Reference in New Issue
Block a user