尹峰
|
68b21f2c98
|
feat: ai code review fix
|
2026-08-06 13:09:27 +08:00 |
|
ruisu
|
c77d44b54a
|
feat:支持变量的表达式具体业务值报警。优化性能
|
2026-07-28 16:45:32 +08:00 |
|
ruisu
|
3ec484c2ec
|
Merge branch 'feature/p132_74-risk-engine' of https://gitee.glmszq.com/gsty/onederiv/trs into feature/p132_74-risk-engine
|
2026-07-02 16:56:20 +08:00 |
|
ruisu
|
917eacc7b7
|
feat:增加内存刷新接口,优化rule日志记录,不再使用EXception。非ACTIVE的rule不再编译。
|
2026-07-02 16:46:28 +08:00 |
|
尹峰
|
10b08f8f21
|
优化字段类型
|
2026-06-29 18:34:46 +08:00 |
|
ruisu
|
7747d26ed0
|
支持从数据库读取rule与application,进行匹配校验,以及拼接返回值
|
2026-06-25 17:25:47 +08:00 |
|
ruisu
|
fb9c7430e9
|
Merge branch 'feature/p132_74-risk-engine' of https://gitee.glmszq.com/gsty/onederiv/trs into feature/p132_74-risk-engine
|
2026-06-24 15:44:07 +08:00 |
|
ruisu
|
1fa7a8b79c
|
将Application与编译独立,跑通基础链路
|
2026-06-24 15:05:24 +08:00 |
|
尹峰
|
28ed20e527
|
feat: 规则双模式公式表达式(RuleExpr)& 字段精简重构
- 新增 RuleExpr 字段,支持结构化拼接和自由文本两种模式,二选一互斥
- 删除 RuleCode/FormulaText/ApplicationCode/SourceExpression/IsImplemented/VariableCode/TargetCode
- 重命名 FormulaJson→ConditionJson, FormulaExpr→RuleExpr, ImplementationScript→VariableExpr, RuleDescription→RuleText
- RuleId(bigint)→RuleIds(varchar) 多规则支持
- FormulaCondition: variableCode(string)→variableId(long), thresholdVariableCode→thresholdVariableId
- 新增 44 条变量池 seed 数据
- 设计文档同步更新
|
2026-06-24 09:44:13 +08:00 |
|
 陈斐andClaude
|
3e357312c2
|
feat: 风控引擎核心重构 - 表达式树编译 + Roslyn Scripting + 规则模型合并
本次提交实现风控引擎从占位代码到可运行版本的核心升级:
【模型合并】
- RiskRule.cs:删除 RiskRuleApplication,将策略/时点/范围合并到 RiskRule
- 新增 FormulaJson 字段,用于 Roslyn 脚本解析
- 新增 CompiledScript 运行时字段(预编译委托,不持久化)
【规则编译器 - RuleCompiler.cs】
- ParseFormulaJson:解析 FormulaJson 条件列表
- BuildScriptCode:生成 Roslyn C# 脚本代码
- CompileScript:用 Roslyn 编译为 Func<RiskContext, bool> 委托
- 支持多条件 AND(逗号分隔自动拆分)
- 变量类型映射:YLErp.DBModels.trade 等
【EvaluateRisk 升级】
- LoadRules → 筛选 TriggerPoint → 执行 CompiledScript → 按策略聚合
- 异常处理:返回 NeedApproval(审批类,可审批通过)
- 示例规则:名义本金>1亿 且 保证金比例>50% → 禁止
【项目依赖】
- 新增 Microsoft.CodeAnalysis.CSharp (4.12.0)
- 升级 System.Text.Encoding.CodePages 6.0.0 → 7.0.0
【验证】
- 簿记交易确认(BOOK_CONFIRM)已接入 QuotaMonitorService
- 编译通过,运行验证通过
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-22 19:31:20 +08:00 |
|