调整下列表显示

This commit is contained in:
tongfei
2023-12-18 14:30:34 +08:00
parent dba406e0e0
commit fbcb24c8c5
6 changed files with 65 additions and 48 deletions

View File

@@ -6,6 +6,8 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WMS.Web.Core.Dto.Erp;
using WMS.Web.Core.Dto.Erp.Org;
using WMS.Web.Core.Dto.Inventory;
using WMS.Web.Core.Internal.Results;
using WMS.Web.Domain.Entitys;
@@ -55,20 +57,20 @@ namespace WMS.Web.Repositories
public async Task<(List<BoxInventoryQueryResponse> list, int total)> GetPagedList(BoxInventoryQueryRequest dto)
{
//1.获取物料集合和组织集合
var materials = new List<ErpMaterialDto>();
var materials_result = await _erpService.BillQueryForMaterial();
if (!materials_result.IsSuccess)
return (new List<BoxInventoryQueryResponse>(), 0);
var materials = materials_result.Data.ToList();
if (materials_result.IsSuccess)
materials = materials_result.Data.ToList();
//物料集合;模糊查询后的物料集合
if (!string.IsNullOrEmpty(dto.MaterialNumber))
materials = materials.Where(w => w.MaterialNumber.Contains(dto.MaterialNumber)).ToList();
//组织集合
var orgs = new List<ErpOrgDto>();
var orgs_result = await _erpService.BillQueryForOrg();
if (!orgs_result.IsSuccess)
return (new List<BoxInventoryQueryResponse>(), 0);
var orgs = orgs_result.Data.ToList();
if (orgs_result.IsSuccess)
orgs = orgs_result.Data.ToList();
var query = _context.BoxInventoryDetails
.GroupJoin(_context.BoxInventory, detail => detail.Fid, order => order.Id, (detail, orders) => new { detail, orders })
@@ -123,12 +125,13 @@ namespace WMS.Web.Repositories
public async Task<BoxInventoryResponse> GetInfoBy(string boxBillNo)
{
//1.获取物料集合和组织集合
var materials = new List<ErpMaterialDto>();
var materials_result = await _erpService.BillQueryForMaterial();
if (!materials_result.IsSuccess)
return null;
var materials = materials_result.Data.ToList();
if (materials_result.IsSuccess)
materials = materials_result.Data.ToList();
var entity=await _context.BoxInventory.Include(x=>x.Details)
var entity =await _context.BoxInventory.Include(x=>x.Details)
.GroupJoin(_context.Box, t => t.BoxId, box => box.Id, (boxinvent, ts) => new { boxinvent, ts })
.SelectMany(x => x.ts.DefaultIfEmpty(), (p, box) => new { p.boxinvent, box })
.Where(x => 1 == 1 && x.box.BoxBillNo==boxBillNo).Select(x=>x.boxinvent).FirstOrDefaultAsync();