diff --git a/src/WMS.Web.Repositories/BackRecordRepositories.cs b/src/WMS.Web.Repositories/BackRecordRepositories.cs index 2d1d0465..bcc7e588 100644 --- a/src/WMS.Web.Repositories/BackRecordRepositories.cs +++ b/src/WMS.Web.Repositories/BackRecordRepositories.cs @@ -9,6 +9,8 @@ using System.Text; using System.Threading.Tasks; using WMS.Web.Core; using WMS.Web.Core.Dto; +using WMS.Web.Core.Dto.Erp; +using WMS.Web.Core.Dto.Erp.Org; using WMS.Web.Core.Internal.Results; using WMS.Web.Domain.Entitys; using WMS.Web.Domain.Infrastructure; @@ -60,16 +62,16 @@ namespace WMS.Web.Repositories public async Task<(List list,int total)> GetPagedList(BackRecordQueryRequest dto) { //1.获取物料集合和组织集合和供应商的集合 + var materials = new List(); var materials_result = await _erpService.BillQueryForMaterial(); - if (!materials_result.IsSuccess) - return (new List(), 0); - var materials = materials_result.Data.ToList(); + if (materials_result.IsSuccess) + materials = materials_result.Data.ToList(); //组织集合 + var orgs = new List(); var orgs_result = await _erpService.BillQueryForOrg(); - if (!orgs_result.IsSuccess) - return (new List(), 0); - var orgs = orgs_result.Data.ToList(); + if (orgs_result.IsSuccess) + orgs = orgs_result.Data.ToList(); List ids = new List(); if (!string.IsNullOrEmpty(dto.Creator)) diff --git a/src/WMS.Web.Repositories/BoxInventoryRepositories.cs b/src/WMS.Web.Repositories/BoxInventoryRepositories.cs index f2e8a1c7..04e5b45d 100644 --- a/src/WMS.Web.Repositories/BoxInventoryRepositories.cs +++ b/src/WMS.Web.Repositories/BoxInventoryRepositories.cs @@ -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 list, int total)> GetPagedList(BoxInventoryQueryRequest dto) { //1.获取物料集合和组织集合 + var materials = new List(); var materials_result = await _erpService.BillQueryForMaterial(); - if (!materials_result.IsSuccess) - return (new List(), 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(); var orgs_result = await _erpService.BillQueryForOrg(); - if (!orgs_result.IsSuccess) - return (new List(), 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 GetInfoBy(string boxBillNo) { //1.获取物料集合和组织集合 + var materials = new List(); 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(); diff --git a/src/WMS.Web.Repositories/InStockRepositories.cs b/src/WMS.Web.Repositories/InStockRepositories.cs index 5cced9a0..00484b55 100644 --- a/src/WMS.Web.Repositories/InStockRepositories.cs +++ b/src/WMS.Web.Repositories/InStockRepositories.cs @@ -8,6 +8,9 @@ using System.Text; using System.Threading.Tasks; using WMS.Web.Core; using WMS.Web.Core.Dto; +using WMS.Web.Core.Dto.Erp; +using WMS.Web.Core.Dto.Erp.Org; +using WMS.Web.Core.Dto.Erp.Supplier; using WMS.Web.Core.Dto.InStock; using WMS.Web.Core.Help; using WMS.Web.Core.Internal.Results; @@ -217,22 +220,24 @@ namespace WMS.Web.Repositories public async Task<(List list, int total)> GetPagedList(InStockQueryRequest dto) { //1.获取物料集合和组织集合和供应商的集合 + var materials = new List(); var materials_result = await _erpService.BillQueryForMaterial(); - if (!materials_result.IsSuccess) - return (new List(), 0); - var materials = materials_result.Data.ToList(); + if (materials_result.IsSuccess) + materials = materials_result.Data.ToList(); //组织集合 + var orgs = new List(); var orgs_result = await _erpService.BillQueryForOrg(); - if (!orgs_result.IsSuccess) - return (new List(), 0); - var orgs = orgs_result.Data.ToList(); + if (orgs_result.IsSuccess) + orgs = orgs_result.Data.ToList(); + //供应商集合 + var suppliers = new List(); var suppliers_result = await _erpService.BillQueryForSupplier(); - if (!suppliers_result.IsSuccess) - return (new List(), 0); - var suppliers = suppliers_result.Data.ToList(); + if (suppliers_result.IsSuccess) + suppliers = suppliers_result.Data.ToList(); + //物料集合;模糊查询后的物料集合 if (!string.IsNullOrEmpty(dto.MaterialNumber)) diff --git a/src/WMS.Web.Repositories/InStockTaskRepositories.cs b/src/WMS.Web.Repositories/InStockTaskRepositories.cs index 63559136..c7db20a8 100644 --- a/src/WMS.Web.Repositories/InStockTaskRepositories.cs +++ b/src/WMS.Web.Repositories/InStockTaskRepositories.cs @@ -9,6 +9,8 @@ using System.Threading.Tasks; using WMS.Web.Core; using WMS.Web.Core.Dto; using WMS.Web.Core.Dto.Erp; +using WMS.Web.Core.Dto.Erp.Org; +using WMS.Web.Core.Dto.Erp.Supplier; using WMS.Web.Core.Dto.InStockTask; using WMS.Web.Core.Help; using WMS.Web.Core.Internal.Results; @@ -427,22 +429,24 @@ namespace WMS.Web.Repositories /// public async Task<(List list, int total)> GetPagedList(InStockTaskQueryRequest dto) { - //1.获取物料集合和组织集合 + //1.获取物料集合和组织集合和供应商的集合 + var materials = new List(); var materials_result = await _erpService.BillQueryForMaterial(); - if (!materials_result.IsSuccess) - return (new List(), 0); - var materials = materials_result.Data.ToList(); + if (materials_result.IsSuccess) + materials = materials_result.Data.ToList(); + //组织集合 + var orgs = new List(); var orgs_result = await _erpService.BillQueryForOrg(); - if (!orgs_result.IsSuccess) - return (new List(), 0); - var orgs = orgs_result.Data.ToList(); + if (orgs_result.IsSuccess) + orgs = orgs_result.Data.ToList(); + //供应商集合 + var suppliers = new List(); var suppliers_result = await _erpService.BillQueryForSupplier(); - if (!suppliers_result.IsSuccess) - return (new List(), 0); - var suppliers = suppliers_result.Data.ToList(); + if (suppliers_result.IsSuccess) + suppliers = suppliers_result.Data.ToList(); List ids_Receiver = new List(); List ids_Operator = new List(); diff --git a/src/WMS.Web.Repositories/InventoryDetailsRepositories.cs b/src/WMS.Web.Repositories/InventoryDetailsRepositories.cs index 14346580..16103a3a 100644 --- a/src/WMS.Web.Repositories/InventoryDetailsRepositories.cs +++ b/src/WMS.Web.Repositories/InventoryDetailsRepositories.cs @@ -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; @@ -54,22 +56,21 @@ namespace WMS.Web.Repositories public async Task<(List list,int total)> GetPagedList(InventoryDetailsQueryRequest dto) { //1.获取物料集合和组织集合 + var materials = new List(); var materials_result = await _erpService.BillQueryForMaterial(); - if (!materials_result.IsSuccess) - return (new List(), 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(); var orgs_result = await _erpService.BillQueryForOrg(); - if (!orgs_result.IsSuccess) - return (new List(), 0); - var orgs = orgs_result.Data.ToList(); + if (orgs_result.IsSuccess) + orgs = orgs_result.Data.ToList(); - // var query = _context.InventoryDetails .Where(adv => 1 == 1); diff --git a/src/WMS.Web.Repositories/InventoryInOutDetailsRepositories.cs b/src/WMS.Web.Repositories/InventoryInOutDetailsRepositories.cs index b9290995..cac6f488 100644 --- a/src/WMS.Web.Repositories/InventoryInOutDetailsRepositories.cs +++ b/src/WMS.Web.Repositories/InventoryInOutDetailsRepositories.cs @@ -7,6 +7,8 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using WMS.Web.Core; +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,16 +57,16 @@ namespace WMS.Web.Repositories public async Task<(List list, int total)> GetPagedList(InventoryInOutDetailsQueryRequest dto) { //1.获取物料集合和组织集合 + var materials = new List(); var materials_result = await _erpService.BillQueryForMaterial(); - if (!materials_result.IsSuccess) - return (new List(), 0); - var materials = materials_result.Data.ToList(); + if (materials_result.IsSuccess) + materials = materials_result.Data.ToList(); //组织集合 + var orgs = new List(); var orgs_result = await _erpService.BillQueryForOrg(); - if (!orgs_result.IsSuccess) - return (new List(), 0); - var orgs = orgs_result.Data.ToList(); + if (orgs_result.IsSuccess) + orgs = orgs_result.Data.ToList(); //物料集合;模糊查询后的物料集合 if (!string.IsNullOrEmpty(dto.MaterialNumber))