调整接口

This commit is contained in:
18942506660
2024-10-18 17:29:51 +08:00
parent 747257c7e7
commit 9ac131f286
6 changed files with 16 additions and 7 deletions

View File

@@ -9,6 +9,6 @@ namespace WMS.Web.Domain.IService.Public
{
public interface IErpInventoryService
{
Task<Result<List<ErpInventoryDto>>> Get(string stockCodes);
Task<Result<List<ErpInventoryDto>>> GetInventory(string stockCodes);
}
}

View File

@@ -36,7 +36,7 @@ namespace WMS.Web.Domain.Services
ILingXingService lingXingService,
IBasicsRepositories basicsRepositories,
IBasicsRepositories transactionRepositories,
IJuShuiTanService juShuiTanService,
IJuShuiTanService juShuiTanService,
IErpInventoryService erpInventoryService)
{
_erpService = erpService;
@@ -62,11 +62,20 @@ namespace WMS.Web.Domain.Services
w.ManagementSystem == 1 || w.ManagementSystem == 4).Select(s => (s.Code, s.ErpOrgCode)).ToList();
if (codes.Count() <= 0) return Result.ReSuccess();
var res = await _erpService.BillQueryForInventory(codes);
var str = string.Join(",", codes.Select(s => s.Code).ToList());
var res = await _erpInventoryService.GetInventory(str);
if (!res.IsSuccess) return res;
//过滤掉不符合要求的组织和仓库组合
List<ErpInventoryDto> listOld = new List<ErpInventoryDto>();
foreach (var item in codes)
{
var zList = res.Data.Where(w => w.OrgCode == item.ErpOrgCode && w.StockCode == item.Code).ToList();
listOld.AddRange(zList);
}
List<ProductInventory> inventoryList = new List<ProductInventory>();
foreach (var item in res.Data)
foreach (var item in listOld)
{
var entity = new ProductInventory()
{

View File

@@ -42,7 +42,7 @@ namespace WMS.Web.Domain.Services.Public
var iResult = JObject.Parse(response)["LoginResultType"].Value<int>();
return iResult == 1 ? true : false;
}
public async Task<Result<List<ErpInventoryDto>>> Get(string stockCodes)
public async Task<Result<List<ErpInventoryDto>>> GetInventory(string stockCodes)
{
List<ErpInventoryDto> list = new List<ErpInventoryDto>();
HttpClientEx httpClient = new HttpClientEx();