Merge branch 'feature/p132_74-risk-engine' of https://gitee.glmszq.com/gsty/onederiv/trs into feature/p132_74-risk-engine

This commit is contained in:
ruisu
2026-06-29 17:30:14 +08:00
10 changed files with 192 additions and 228 deletions
+53 -2
View File
@@ -1,4 +1,5 @@
using Qdp.Foundation.Utilities;
using YLErp.DBModels;
using YLErp.Modules.RiskEngine;
using YLErp.Modules.RiskEngine.Dto;
@@ -208,7 +209,7 @@ namespace YLErp.Web.Controllers
{
var service = new RiskRuleService(CurUser);
var result = service.GetRuleApplications(id);
return Json(new { success = true, data = result });
return Json(new { success = true, data = new { rows = result, total = result.Count, records = result.Count, page = 1 } });
}
catch (ServiceException ex)
{
@@ -221,6 +222,27 @@ namespace YLErp.Web.Controllers
}
}
[HttpGet("risk-rules/list")]
[MyAuthorize("风控规则查看")]
public JsonResult GetAllRiskRules()
{
try
{
var service = new RiskRuleService(CurUser);
var result = service.GetAllRuleList();
return Json(new { success = true, data = new { rows = result, total = result.Count, records = result.Count, page = 1 } });
}
catch (ServiceException ex)
{
return Json(new { success = false, message = ex.Message });
}
catch (Exception ex)
{
_logger.Error(ex, "查询规则下拉列表");
return Json(new { success = false, message = "系统异常,请联系管理员" });
}
}
#endregion
#region Application Management
@@ -468,7 +490,7 @@ namespace YLErp.Web.Controllers
{
var service = new RiskRuleService(CurUser);
var result = service.GetAllVariableList();
return Json(new { success = true, data = result });
return Json(new { success = true, data = new { rows = result, total = result.Count, records = result.Count, page = 1 } });
}
catch (ServiceException ex)
{
@@ -546,6 +568,35 @@ namespace YLErp.Web.Controllers
#endregion
#region Trade Types
[HttpGet("trade-types")]
[MyAuthorize("风控应用查看")]
public JsonResult GetTradeTypes()
{
try
{
var rows = ConsTrade.AllTradeTypes.Select(t => new { label = t, value = t }).ToList();
var total = rows.Count;
return Json(new {
success = true,
data = new {
page = 1,
records = total,
rows = rows,
total = total
}
});
}
catch (Exception ex)
{
_logger.Error(ex, "查询合约类型列表");
return Json(new { success = false, message = "系统异常,请联系管理员" });
}
}
#endregion
#region Audit Log
[HttpGet("risk-audit-logs")]