调整接口
This commit is contained in:
Binary file not shown.
@@ -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>();
|
||||||
|
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace WMS.Web.Domain.Services
|
|||||||
ILingXingService lingXingService,
|
ILingXingService lingXingService,
|
||||||
IBasicsRepositories basicsRepositories,
|
IBasicsRepositories basicsRepositories,
|
||||||
IBasicsRepositories transactionRepositories,
|
IBasicsRepositories transactionRepositories,
|
||||||
IJuShuiTanService juShuiTanService,
|
IJuShuiTanService juShuiTanService,
|
||||||
IErpInventoryService erpInventoryService)
|
IErpInventoryService erpInventoryService)
|
||||||
{
|
{
|
||||||
_erpService = erpService;
|
_erpService = erpService;
|
||||||
@@ -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()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user