调整接口

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

@@ -119,7 +119,7 @@ namespace WMS.Web.Api.Controllers
//await _juShuiTanService.GetTest(); //await _juShuiTanService.GetTest();
string codes = "AD"; string codes = "AD";
var b = await _erpInventoryService.Get(codes); var b = await _erpInventoryService.GetInventory(codes);
//LingXingResponse<LingXingStockResponse> r = new LingXingResponse<LingXingStockResponse>(); //LingXingResponse<LingXingStockResponse> r = new LingXingResponse<LingXingStockResponse>();

View File

@@ -37,7 +37,7 @@
}, },
"ErpOptions": { "ErpOptions": {
"EndpointAddress": "http://erp.orico.com.cn/k3cloud/ERPGW.asmx", //原:119.23.206.129 "EndpointAddress": "http://erp.orico.com.cn/k3cloud/ERPGW.asmx", //原:119.23.206.129
"UserName": "mes", //测试账号密码 mes/A1B2C3Dh/ce20210909/666a6c4a522823 正式账号密码 orico/A123321./Orico "UserName": "mes", //测试账号密码 mes/A1B2C3Dh/ce20210909/666a6c4a522823 正式账号密码 orico/A123321./Orico/663a26829afbdd
"Password": "A1B2C3Dh.", "Password": "A1B2C3Dh.",
"ErpId": "ce20210909", "ErpId": "ce20210909",
"ZhangTaoId": "666a6c4a522823" "ZhangTaoId": "666a6c4a522823"

View File

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

View File

@@ -62,11 +62,20 @@ namespace WMS.Web.Domain.Services
w.ManagementSystem == 1 || w.ManagementSystem == 4).Select(s => (s.Code, s.ErpOrgCode)).ToList(); w.ManagementSystem == 1 || w.ManagementSystem == 4).Select(s => (s.Code, s.ErpOrgCode)).ToList();
if (codes.Count() <= 0) return Result.ReSuccess(); 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; 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>(); List<ProductInventory> inventoryList = new List<ProductInventory>();
foreach (var item in res.Data) foreach (var item in listOld)
{ {
var entity = new ProductInventory() var entity = new ProductInventory()
{ {

View File

@@ -42,7 +42,7 @@ namespace WMS.Web.Domain.Services.Public
var iResult = JObject.Parse(response)["LoginResultType"].Value<int>(); var iResult = JObject.Parse(response)["LoginResultType"].Value<int>();
return iResult == 1 ? true : false; 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>(); List<ErpInventoryDto> list = new List<ErpInventoryDto>();
HttpClientEx httpClient = new HttpClientEx(); HttpClientEx httpClient = new HttpClientEx();