增加获取erp仓库接口
This commit is contained in:
@@ -178,5 +178,45 @@ namespace WMS.Web.Domain.Services.Public
|
||||
return ResultList<ErpOrgDto>.ReFailure("错误", 10002);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取使用组织
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<ResultList<ErpStockDto>> BillQueryForStock()
|
||||
{
|
||||
try
|
||||
{
|
||||
var token_result = await this.Init();
|
||||
if (!token_result.IsSuccess)
|
||||
return ResultList<ErpStockDto>.ReFailure(token_result);
|
||||
var query = new ErpBillQueryDto(token_result.Data);
|
||||
var param = new ErpBillQueryParamDto(FormIdParam.BD_STOCK.ToString());
|
||||
param.FieldKeys = "FStockId,FName,FNumber,FUseOrgId";
|
||||
param.FilterString = "";//FOrgID=100008
|
||||
query.Data = JsonConvert.SerializeObject(param);
|
||||
var json = JsonConvert.SerializeObject(query);
|
||||
|
||||
var result_json = await _client.ExecuteBillQueryAsync(json);
|
||||
var result = JsonConvert.DeserializeObject<List<List<string>>>(result_json);
|
||||
|
||||
var list = new List<ErpStockDto>();
|
||||
foreach (var item in result)
|
||||
{
|
||||
var lis = new ErpStockDto();
|
||||
lis.Id = int.Parse(item[0]);
|
||||
lis.Name = item[1];
|
||||
lis.Code = item[2];
|
||||
lis.OrgCode = item[3];
|
||||
list.Add(lis);
|
||||
|
||||
}
|
||||
return ResultList<ErpStockDto>.ReSuccess(list);
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return ResultList<ErpStockDto>.ReFailure("错误", 10002);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user