箱库存查询
This commit is contained in:
@@ -101,8 +101,14 @@ namespace WMS.Web.Repositories
|
||||
/// </summary>
|
||||
/// <param name="boxBillNo"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<BoxInventoryDetailsDto>> GetListDetailsBy(string boxBillNo)
|
||||
public async Task<List<BoxInventoryDetailsResponse>> GetListDetailsBy(string boxBillNo)
|
||||
{
|
||||
//1.获取物料集合和组织集合
|
||||
var materials_result = await _erpService.BillQueryForMaterial();
|
||||
if (!materials_result.IsSuccess)
|
||||
return new List<BoxInventoryDetailsResponse>();
|
||||
var materials = materials_result.Data.ToList();
|
||||
|
||||
var query=_context.BoxInventoryDetails
|
||||
.GroupJoin(_context.BoxInventory, detail => detail.Fid, order => order.Id, (detail, orders) => new { detail, orders })
|
||||
.SelectMany(x => x.orders.DefaultIfEmpty(), (p, order) => new { p.detail, order })
|
||||
@@ -110,9 +116,16 @@ namespace WMS.Web.Repositories
|
||||
.SelectMany(x => x.ts.DefaultIfEmpty(), (p, box) => new { p.detail, p.order, box })
|
||||
.Where(x => 1 == 1 && x.box.BoxBillNo==boxBillNo);
|
||||
|
||||
var list = await query.Select(x => new BoxInventoryDetailsDto()
|
||||
var list = await query.Select(x => new BoxInventoryDetailsResponse()
|
||||
{
|
||||
DetailsId=x.detail.Id,
|
||||
MaterialName = _erpBasicDataExtendService.GetMaterialName(materials, x.detail.MaterialId),
|
||||
MaterialNumber = _erpBasicDataExtendService.GetMaterialNumber(materials, x.detail.MaterialId),
|
||||
Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, x.detail.MaterialId),
|
||||
StockCode =x.order.StockCode,
|
||||
Stock = _singleDataService.GetSingleData(SingleAction.Stocks, _loginRepositories.CompanyId, x.order.StockCode),
|
||||
SubStockId=x.order.SubStockId,
|
||||
SubStock= _singleDataService.GetSingleData(SingleAction.SubStocks, _loginRepositories.CompanyId, x.order.SubStockId),
|
||||
DetailsId =x.detail.Id,
|
||||
BoxId=x.box.Id,
|
||||
BoxInventoryId=x.order.Id,
|
||||
MaterialId=x.detail.MaterialId,
|
||||
|
||||
Reference in New Issue
Block a user