erp
This commit is contained in:
@@ -178,6 +178,8 @@ namespace WMS.Web.Domain.Services.Public
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<ResultList<ErpMaterialDto>> BillQueryForMaterial()
|
||||
{
|
||||
try
|
||||
{
|
||||
//1.获取缓存中的物料数据;
|
||||
var cache_key = "erp_materials_list";
|
||||
@@ -248,6 +250,13 @@ namespace WMS.Web.Domain.Services.Public
|
||||
{
|
||||
return ResultList<ErpMaterialDto>.ReSuccess(materials);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
return ResultList<ErpMaterialDto>.ReFailure(ResultCodes.ErpMaterialError);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -259,7 +268,7 @@ namespace WMS.Web.Domain.Services.Public
|
||||
{
|
||||
try
|
||||
{
|
||||
//1.获取缓存中的物料数据;
|
||||
//1.获取缓存中的组织数据;
|
||||
var cache_key = "erp_org_list";
|
||||
var orgs = _memoryCache.Get<List<ErpOrgDto>>(cache_key);
|
||||
if (orgs == null || orgs.Count == 0)
|
||||
@@ -270,7 +279,7 @@ namespace WMS.Web.Domain.Services.Public
|
||||
if (!token_result.IsSuccess)
|
||||
return ResultList<ErpOrgDto>.ReFailure(token_result);
|
||||
|
||||
//3.获取金蝶物料:拼接参数和条件
|
||||
//3.获取金蝶组织:拼接参数和条件
|
||||
var query = new ErpBillQueryDto(token_result.Data);
|
||||
var param = new ErpBillQueryParamDto(FormIdParam.ORG_Organizations.ToString());
|
||||
param.FieldKeys = "FOrgID,FNumber,FName";
|
||||
@@ -302,7 +311,7 @@ namespace WMS.Web.Domain.Services.Public
|
||||
list.Add(lis);
|
||||
|
||||
}
|
||||
//5.物料集合进行缓存
|
||||
//5.组织集合进行缓存
|
||||
_memoryCache.Set(cache_key, list, new MemoryCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.FromHours(12)));
|
||||
_logger.LogInformation($"组织拉取-总条数:{list.Count}");
|
||||
return ResultList<ErpOrgDto>.ReSuccess(list);
|
||||
|
||||
@@ -37,7 +37,8 @@ namespace WMS.Web.Domain.Values
|
||||
|
||||
public static ValueTuple<int, string> ErpOrgError = (80004, "获取Erp相关组织数据失败,请稍候再试!");
|
||||
public static ValueTuple<int, string> ErpSupplierError = (80005, "获取Erp相关供应商数据失败,请稍候再试!");
|
||||
public static ValueTuple<int, string> ErpStockError = (80005, "获取Erp相关仓库数据失败,请稍候再试!");
|
||||
public static ValueTuple<int, string> ErpStockError = (80006, "获取Erp相关仓库数据失败,请稍候再试!");
|
||||
public static ValueTuple<int, string> ErpMaterialError = (80007, "获取Erp相关物料数据失败,请稍候再试!");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user