- 新增YLErpDAL/Modules/RiskEngine文件夹,与RiskModule平级隔离 - 新增核心模型: - RiskContext.cs:风控上下文(TradeId, TriggerPoint, DataMap) - RiskResult.cs:风控结果(Passed, Blocked, NeedApproval, Warnings, TriggeredRules) - 新增RiskEngineService: - Evaluate():1==1占位,验证服务可实例化 - EvaluateRisk(RiskContext, triggerPoint):核心风控检查入口 - 集成到现有流程: - QuotaMonitorService.QuotaCheck()末尾接入风控引擎 - 触发时点:BOOK_CONFIRM(簿记交易确认) - 按策略映射回QuotaTrialStatusEnum(Blocked→Error, NeedApproval→Warning) - 文件头包含完整技术方案与TODO清单 Co-Authored-By: Claude <noreply@anthropic.com>
26 lines
690 B
C#
26 lines
690 B
C#
using System.Collections.Generic;
|
|
|
|
namespace YLErp.Modules.RiskEngine
|
|
{
|
|
/// <summary>
|
|
/// 风控上下文:封装一次风控检查所需的全部数据上下文
|
|
/// </summary>
|
|
public class RiskContext
|
|
{
|
|
/// <summary>
|
|
/// 当前交易ID
|
|
/// </summary>
|
|
public int TradeId { get; set; }
|
|
|
|
/// <summary>
|
|
/// 当前触发时点
|
|
/// </summary>
|
|
public string TriggerPoint { get; set; }
|
|
|
|
/// <summary>
|
|
/// 数据字典:key=表名/前缀,value=对应数据对象
|
|
/// </summary>
|
|
public Dictionary<string, object> DataMap { get; set; } = new Dictionary<string, object>();
|
|
}
|
|
}
|