feat:增加平仓所需风控上下文要素

This commit is contained in:
ruisu
2026-08-14 15:16:36 +08:00
parent 0722da1149
commit f2a1598d1d
4 changed files with 11 additions and 7 deletions
@@ -31,6 +31,8 @@ namespace YLErp.Modules.RiskEngine
/// </summary>
public DateTime? UnwindDate { get; set; }
public DateTime? PayDate { get; set; }
/// <summary>
/// 数据库上下文,供规则公式直接查询数据库
/// </summary>
@@ -402,6 +404,7 @@ namespace YLErp.Modules.RiskEngine
TradeId = ctx.TradeId,
TriggerPoint = ctx.TriggerPoint,
UnwindDate = ctx.UnwindDate,
PayDate = ctx.PayDate,
DbContext = ctx.DbContext
};
return runner(globals).GetAwaiter().GetResult();
@@ -22,6 +22,8 @@ namespace YLErp.Modules.RiskEngine
/// </summary>
public DateTime? UnwindDate { get; set; }
public DateTime? PayDate { get; set; }
/// <summary>
/// 数据库上下文,供规则公式直接查询数据库
/// </summary>
@@ -202,8 +202,7 @@ namespace YLErp.Modules.RiskEngine
"BOOK_CONFIRM",
"CLOSE_REVIEW",
"UPLOAD_CONFIRMATION",
"EVENT_TRIGGER",
"FUND_PAYMENT"
"EVENT_TRIGGER"
};
@@ -792,11 +791,10 @@ namespace YLErp.Modules.RiskEngine
private static readonly Dictionary<string, string> TriggerPointCnMap = new Dictionary<string, string>
{
["BOOK_CONFIRM"] = "交易录入确认",
["CLOSE_REVIEW"] = "平仓审核",
["BOOK_CONFIRM"] = "簿记交易确认",
["CLOSE_REVIEW"] = "平仓审核提交",
["UPLOAD_CONFIRMATION"] = "上传确认书",
["EVENT_TRIGGER"] = "事件触发",
["FUND_PAYMENT"] = "资金支付"
["EVENT_TRIGGER"] = "事件发生时"
};
/// <summary>
@@ -1918,7 +1918,8 @@ namespace YLErp.Modules.SwapModule
{
TradeId = unwindData.SwapTradeId,
TriggerPoint = triggerPoint,
UnwindDate = unwindData.UnwindDate
UnwindDate = unwindData.UnwindDate,
PayDate = unwindData.PayDate
};
return new RiskTrialService(this).CheckRisk(riskContext, closeTrialSource, confirmation);
}