58 lines
2.1 KiB
C#
58 lines
2.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using YLErp.Helpers;
|
|
using YLErp.Modules.SwapModule.Dto;
|
|
|
|
namespace YLErp.Modules.SwapModule
|
|
{
|
|
public class RiskCacheService
|
|
{
|
|
public RiskCacheService() { }
|
|
|
|
/// <summary>
|
|
/// 刷新风控缓存
|
|
/// </summary>
|
|
/// <param name="clientUmsDic"></param>
|
|
public void refreshRiskCache(Dictionary<long, List<string>> clientUmsDic)
|
|
{
|
|
if (clientUmsDic == null || clientUmsDic.Count == 0)
|
|
{
|
|
return;
|
|
}
|
|
Task.Run(() => {
|
|
try
|
|
{
|
|
//发送http请求
|
|
var baseUrl = Environment.GetEnvironmentVariable("BondOmsInterface_BaseUrl");
|
|
|
|
if (!string.IsNullOrEmpty(baseUrl))
|
|
{
|
|
var httpHelper = new HttpHelper(baseUrl, null);
|
|
var url = $"{baseUrl}/riskJob/refreshClientRiskCache";
|
|
foreach (var item in clientUmsDic)
|
|
{
|
|
var clientId = item.Key;
|
|
var underlyingCodes = item.Value;
|
|
//请求参数
|
|
RefreshFrozenCashCacheReq req = new RefreshFrozenCashCacheReq(clientId, underlyingCodes);
|
|
// http 请求 Web项目接口
|
|
var result = httpHelper.PostRequestNoAuth<RefreshFrozenCashCacheReq, RefreshFrozenCashCacheResp>(url, req).Result;
|
|
if (result != null && !result.success)
|
|
{
|
|
LogFactory.GetLogger("刷新风控缓存").Info("刷新风控缓存:" + result.message);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogFactory.GetLogger("刷新风控缓存").Error("刷新风控缓存:" + ex.Message);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|