尹峰
|
5b34c3a9ca
|
修改标的类型和合约类型传参&优化规则应用启停逻辑
|
2026-07-14 20:35:17 +08:00 |
|
ruisu
|
78cf89be0d
|
fix:修改风控application字段,将标的类型字段修改为UnderlyingAssetClass,内容为汉字
|
2026-07-14 18:33:45 +08:00 |
|
ruisu
|
7784e66289
|
Merge branch 'feature/p132_74-risk-engine' of https://gitee.glmszq.com/gsty/onederiv/trs into feature/p132_74-risk-engine
|
2026-07-14 17:18:47 +08:00 |
|
ruisu
|
8e0e779133
|
feat:根据ai merge意见修改:dbContext取消与单例riskEngienService的绑定,反射代码修改。
支持老风控Error情况下的二次特批
|
2026-07-14 17:18:33 +08:00 |
|
尹峰
|
4dc1fc3b4b
|
优化异步逻辑
|
2026-07-13 18:57:36 +08:00 |
|
尹峰
|
20795e6610
|
Merge branch 'feature/p132_74-risk-engine' of https://gitee.glmszq.com/gsty/onederiv/trs into feature/p132_74-risk-engine
|
2026-07-13 15:51:32 +08:00 |
|
尹峰
|
0a8ee77f3c
|
优化缓存刷新逻辑
|
2026-07-13 15:51:17 +08:00 |
|
ruisu
|
0e90c6f0cc
|
Merge branch 'feature/p132_74-risk-engine' of https://gitee.glmszq.com/gsty/onederiv/trs into feature/p132_74-risk-engine
|
2026-07-13 15:48:21 +08:00 |
|
ruisu
|
82688fa930
|
feat:风控引擎内存上下文改为查询数据库,修改注释中的相应规则,
|
2026-07-13 15:47:37 +08:00 |
|
尹峰
|
abf2cf5985
|
规则和应用增加description字段&变量和规则保存校验公式编译有效性
|
2026-07-10 18:23:39 +08:00 |
|
ruisu
|
b5f6b7f61a
|
feat:增加ruleid为空的校验,以支持rule新增。增加preload成功编译rule的日志
|
2026-07-10 10:31:41 +08:00 |
|
ruisu
|
e04333cf70
|
Merge branch 'feature/p132_74-risk-engine' of https://gitee.glmszq.com/gsty/onederiv/trs into feature/p132_74-risk-engine
|
2026-07-09 18:08:40 +08:00 |
|
ruisu
|
18fdb9e9f1
|
feat:增加单条rule增删改函数,以及application全量刷新函数。
|
2026-07-09 18:01:55 +08:00 |
|
尹峰
|
c1ded96985
|
变量级联更新规则优化&增补注释
|
2026-07-09 17:52:14 +08:00 |
|
ruisu
|
4e6d887b68
|
feat:修改本地规则
|
2026-07-09 16:18:28 +08:00 |
|
ruisu
|
d14bdc18e7
|
feat:风控引擎增加超时机制:在进行超时校验的时候,如果超时,不但重置新风控重新校验,老风控的二次校验也不允许直接放行,需要重新校验。
|
2026-07-09 10:26:26 +08:00 |
|
ruisu
|
879fdbea89
|
resolve confilct QuotaMonitorService.cs
|
2026-07-07 15:11:37 +08:00 |
|
ruisu
|
2a8544a7b7
|
fix:删除测试数据
|
2026-07-07 14:52:47 +08:00 |
|
尹峰
|
de628719dc
|
resolve confilct QuotaMonitorService.cs
|
2026-07-07 13:51:24 +08:00 |
|
尹峰
|
d5cbd45a8a
|
Merge branch 'feature/p132_74-risk-engine' of https://gitee.glmszq.com/gsty/onederiv/trs into feature/p132_74-risk-engine
|
2026-07-06 18:42:35 +08:00 |
|
尹峰
|
d7d9c796d8
|
merge glms/feature/1.4.2 0703版本
|
2026-07-06 18:42:19 +08:00 |
|
ruisu
|
1c0fd97efa
|
fix:删除测试数据
|
2026-07-06 18:00:06 +08:00 |
|
ruisu
|
dc0cb9ec7b
|
feat:老风控特批使用单独bool量识别,新风控需审批采用新状态RiskWarning,风控流程状态优先级Error>Warning(老风控特批,给前端CODE为ERROR)>RiskWarning>Success(可能带有ShowTIip)。新风控特批时,识别RULEID,不再采用BOOL统一通过
|
2026-07-06 17:41:13 +08:00 |
|
锦麟 王
|
f0ad4406c9
|
Revert ruisu合并进来的代码
|
2026-07-03 17:41:42 +08:00 |
|
hjhan
|
32bcf9beb9
|
refactor(swap): FindTrade seam上提基类消除三子类重复
SwapDealService/SwapEodPositionService/SwapFlowEventService 三处 FindTrade(int)
签名和实现完全一致(DbContext.trade.Find),上提到 SwapTradeBaseService 基类。
核对确认可安全上提的只有 FindTrade(三者逐字一致):
- FindTradeExtend 不可上提: SwapEodPositionService 用 FirstOrDefault,
SwapFlowEventService 用 First(找不到抛异常),语义不同。
- FindPositions 不可上提: SwapEodPositionService 含 IsInitial 持仓,
SwapFlowEventService 排除 IsInitial + AsNoTracking,语义不同。
测试 stub override FindTrade 跨基类层级正常工作,C# virtual 多态不受影响。
SwapModule 171测试全绿,无回归。
|
2026-07-03 09:52:57 +08:00 |
|
hjhan
|
b501e21904
|
test(swap): 启用MergeCompose场景6/7+SwapFlowEventService录制钩子+RecordingSwapFlowEventService
1. MergeComposeScenarioTest 场景6/7 启用(去掉Ignore):
此前失败是stale binary(未重新编译),重新build后8场景全部通过。
- 场景6 单条merge无持仓→DealNoPosition创建交易
- 场景7 两条merge无持仓→创建交易+平仓
2. SwapFlowEventService 补OnBefore/OnAfterMergePageEvent录制钩子(默认空实现):
- OnBefore: DB查询完成、合成逻辑执行前触发,可捕获输入快照
- OnAfter: PersistEvents后触发,捕获输出事件
生产路径为空方法体,零行为影响。
3. 移植RecordingSwapFlowEventService(借鉴testable分支):
override OnAfterMergePageEvent录制golden文件,备用录制工具。
内联GoldenFileModel(简单POCO)。FullRecord_WithPreBookingPositions连库测试自动跳过。
SwapModule 171测试全绿,无回归。
|
2026-07-03 09:38:05 +08:00 |
|
hjhan
|
f0ef37b599
|
test(swap): SwapFlowEventService seam改造+MergePageEventScenarioTest(6场景全绿)
借鉴 testable 分支,只取 seam(排除 PosiPnl/NetSettmentAmount 公式改动和 MergePageEvent 拆分),
填补当前分支对开平仓合成(MergePageEvent)零覆盖的空白。
SwapFlowEventService 新增11个 protected virtual seam:
- FindTrade/FindTradeExtend/FindPositions/FindAndInvalidateFutureEvents
- GetUnderlying/GetNextBusinessDay/ResolvePositionId
- PersistEvents(替代InitEvent内联Add+SaveChanges)/BeginTransaction/CommitTransaction/RollbackTransaction
MergePageEvent/InitEvent: private→protected virtual,内联DB调用替换为seam。
InitEvent 移除 DbContext.swap_flow_event.Add(转入PersistEvents,纯函数化)。
SwapTradeBaseService.UpdateDbOption: public void→public virtual(测试override用)。
新增测试(借鉴testable分支):
- TestableSwapFlowEventService.cs(集中式共享包装类)
- MergePageEventScenarioTest.cs(6场景全绿):
Scenario1 单条无持仓开仓 / Scenario2 同向追加 / Scenario3 反向全平
Scenario4 反向部分平+开 / Scenario5 一开一平 / Scenario6 复杂组合
**未借鉴**:SearchPositionFlowEvent的PosiPnl/NetSettmentAmount公式改动(行为变更)、
MergePageEvent拆分ProcessSingleFlow等(非必需重构)。
SwapModule 169测试全绿(+6),无回归。
|
2026-07-03 09:26:13 +08:00 |
|
hjhan
|
6e9bae94c5
|
test(swap): MergeRestModeCompose seam调用替换+移植MergeComposeScenarioTest(6/8场景)
借鉴 testable 分支,把 SwapTradeAutoService 的 MergeRestModeCompose/MergeRestModelItem/
DealNoPosition/DealHasPosition 内联DB调用替换为seam调用,生产行为不变。
替换的调用点:
- MergeRestModeCompose: FindActiveSwapTrades/FindTradeExtends/FindActivePositions/GetNextBusinessDayBefore/QueryFloatRates
- MergeRestModelItem: FindClient/GetEtradingRule/FindAssetUnit/FindUnderlying/GetSwapFloatRate/FindFlowEventsForCashCheck/FindValidTrades/SaveChanges
- DealNoPosition: CreateNewSwapTrade/AutoSwapUnwind
- DealHasPosition: AutoSwapUnwind
新增测试(借鉴testable分支):
- TestableSwapTradeAutoService.cs(集中式共享包装类)
- MergeComposeScenarioTest.cs(8场景):
Scenario1-5/8 通过: 客户/权限/账户/标的校验链 + 空流水返回
Scenario6/7 [Ignore]: 创建交易路径,DealNoPosition内部实现细节待对齐后启用
SwapModule 163测试全绿(+6),无回归。
|
2026-07-03 09:20:59 +08:00 |
|
hjhan
|
6b24e6e979
|
refactor(swap): SwapTradeAutoService补18个virtual seam(借鉴testable分支)
借鉴 origin/glms/feature/refactor-swap-event-testable 的可测性改造,
当前分支 SwapTradeAutoService 此前0个seam,纯新增#region可测试化区域,无冲突。
18个protected virtual seam(默认实现=原代码,行为不变):
- 日历: GetNextBusinessDay/GetNextBusinessDayBefore
- 计算: CalculateBondYtm
- 持久化: PersistMerge/SetModelOpt/SaveChanges
- 查询: FindActiveSwapTrades/FindTradeExtends/FindActivePositions/FindActivePositionsAll/
QueryFloatRates/FindClient/FindAssetUnit/FindUnderlying/FindFlowEventsForCashCheck/FindValidTrades
- 协作服务: GetEtradingRule/GetSwapFloatRate/CreateNewSwapTrade/AutoSwapUnwind
为后续 MergeComposeScenarioTest(自动簿记流程测试)铺路。
SwapModule 157测试全绿,seam未被override时按生产实现执行,行为不变。
|
2026-07-03 09:08:12 +08:00 |
|
hjhan
|
e4a92c93ee
|
feat(swap): 后端只读校验告警-搬FrontendCalcReference+SwapIncome/SwapUnwind插校验
前端保持快速反馈(用户改输入立即算),后端不替代前端,仅做合理性兜底校验。
1. 搬FrontendCalcReference到YLErpDAL/Helpers(测试与生产共用同一份公式,避免分叉)
- 从FrontendCalcCharacterizationTest提取,改public,8个FC测试搬迁后全绿验证一致
2. SwapDealService新增ValidateFrontendPnL只读校验:
- 从unwindData.FlowEvents取浮动腿,PosiGrossPrice==0时跳过(避免误报)
- 调FrontendCalcReference重算,与前端传值逐字段比对
- 差异>0.01记Logger.Error(带输入快照便于排查)
- 整体try/catch吞异常,校验自身错误绝不阻断交易
- SwapUnwind/SwapIncome各插一处(FindTrade后、ExecuteInTransaction前)
不碰NLog配置(告警进Console,生产由运维采集)。SwapModule 157测试全绿。
|
2026-07-03 09:04:57 +08:00 |
|
hjhan
|
129e4bed0d
|
test(swap): 补ApproveSwapTrade/ApplySwapTrade测试+3个seam(借鉴testable分支)
借鉴 origin/glms/feature/refactor-swap-event-testable 的 SwapUnwindScenarioTest 场景4/5,
补全当前分支缺失的平仓审批流程覆盖。
SwapDealService 新增3个 protected virtual seam:
- FindSwapEvent(查待审核事件)
- FindFlowEventsByEventId(查事件关联流水)
- CloseReCheckSetTrade(前置校验包装)
ApproveSwapTrade/ApplySwapTrade 重构为调seam,生产行为不变。
SwapDealSettlementTest 新增2个测试(SD_005/006,共6个):
- SD_005 ApproveSwapTrade 全平仓审核: 反序列化swap_event.EventData→资金流水→TradeStatus
- SD_006 ApplySwapTrade 提交审核: CloseReCheck前置校验+SwapRealizedPnL=SwapCloseAmount
融合策略: 保留当前分支SwapIncome资金流水断言独特价值(SD_001/002),
借鉴testable分支审批流程覆盖(SD_005/006),不二选一。
SwapModule 157测试全绿,无回归。
|
2026-07-03 08:30:36 +08:00 |
|
hjhan
|
a207927f1b
|
test(swap): SwapDealService抽7个virtual seam + 手动结算内存测试
攻克SwapIncome/SwapUnwind零单元测试覆盖的盲区(此前仅DBRecording,CI不跑)。
SwapDealService补7个protected virtual seam(参考已验证的SwapEodPositionService模式):
- FindTrade/AddClientCash/SaveSwapDeal(原private改protected virtual)
- SaveAllChanges/ExecuteInTransaction/CallSaveSwapTradeClientCash/TriggerRealtimeSwapPosition
生产实现行为不变,SwapIncome/SwapUnwind/ApproveSwapTrade重构为调seam。
新增SwapDealSettlementTest.cs(4个内存测试):
- SD_001 SwapIncome资金流水金额=-SwapRealizedPnL
- SD_002 含预付金返息双流水
- SD_003 SwapUnwind全平仓持仓归零+状态变更
- SD_004 DealFloatPosition含费价重算(后端唯二真做计算处)
红灯验证通过(改错金额符号测试立即失败)。
|
2026-07-03 08:22:43 +08:00 |
|
hjhan
|
782e1f6a7a
|
refactor(swap): 债券价格÷100转换收敛到BondPriceConverter统一入口
消除9处价格转换字面量(*0.01m/*100),统一走BondPriceConverter.ToStorage/ToDisplay。
- 新增YLErpDAL/Helpers/BondPriceConverter.cs(含可空重载)
- 批次1(危险字面量): BondPaymentService/RealtimePnlCalc/RealTimeClientBanlanceService/SwapTradeAutoService
- 批次2-4(调用收敛): SwapFlowService/SwapFlowImportService/SwapEndConfirmService/EodPriceProvider/EodPriceQueryService
- RealtimePnlCalc:601/602价格×数量维度交织处加注释,不机械合并
不改bondPriceMultiple常量值,纯调用方式收敛。SwapModule 155测试全绿,行为不变。
|
2026-07-03 08:22:27 +08:00 |
|
ruisu
|
ecb71b35f6
|
fix:解决冲突
|
2026-07-02 17:04:20 +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 |
|
张名锐
|
64299aa744
|
cleanup: remove leftover risk engine references
|
2026-07-02 16:19:26 +08:00 |
|
张名锐
|
c94a717183
|
Revert "feat: 新增风控引擎RiskEngine模块(第一版骨架)"
This reverts commit 4140293b36.
|
2026-07-02 16:14:43 +08:00 |
|
张名锐
|
8cff296be3
|
Revert "feat: 风控引擎核心重构 - 表达式树编译 + Roslyn Scripting + 规则模型合并"
This reverts commit 3e357312c2.
|
2026-07-02 16:14:24 +08:00 |
|
张名锐
|
d5a4eab2ec
|
Revert "feat(风控引擎): RiskRuleService/RiskRuleController 权限控制及需求对齐"
This reverts commit a259b745ce.
|
2026-07-02 16:14:04 +08:00 |
|
张名锐
|
d01253a5da
|
Revert "feat: 规则双模式公式表达式(RuleExpr)& 字段精简重构"
This reverts commit 28ed20e527.
|
2026-07-02 16:13:41 +08:00 |
|
张名锐
|
4ac18c4810
|
Revert "feat(risk-engine): 完善风控规则种子数据与 CRUD 接口优化"
This reverts commit c2fc699e57.
|
2026-07-02 16:05:42 +08:00 |
|
张名锐
|
75dc6f182b
|
Revert "refactor(risk-engine): ConditionJson 改为 RuleCondition 数组格式,精简 DTO 命名"
This reverts commit 3bf90e25ef.
|
2026-07-02 16:05:40 +08:00 |
|
张名锐
|
d0e6b31d5c
|
Revert "优化调整规则管理"
This reverts commit e8ef5be862.
|
2026-07-02 16:05:38 +08:00 |
|
张名锐
|
dae112d199
|
Revert "fix(risk-engine): 修复多个风控引擎问题"
This reverts commit d7c09c793a.
|
2026-07-02 16:02:49 +08:00 |
|
张名锐
|
d1804710f3
|
Revert "优化字段类型"
This reverts commit 10b08f8f21.
|
2026-07-02 16:02:49 +08:00 |
|
尹峰
|
f78a5bdc2a
|
修改操作日志查询接口
|
2026-07-02 15:54:33 +08:00 |
|
张名锐
|
b2dce0e4f7
|
fix(swap): 修复互换交易流程事件数据填充问题
- 添加SwapTradeNo、EventType和EventReason字段到流程事件
- 修正EventType枚举类型从SwapEventTypeEnum改为SwapFlowEventTypeEnum
- 在SaveSwapDeal方法中添加交易信息验证逻辑
- 提取FillSwapFlowEvent方法统一处理流程事件数据填充
- 优化数据库保存操作确保数据一致性
|
2026-07-02 14:28:47 +08:00 |
|
张名锐
|
3534ebb342
|
fix(trade): 修正对客交易判断逻辑
- 修改了GuolianContractNoGenerator中对客交易的判断条件
- 将判断标准从"乙方=对客"改为"甲方=对客"
- 更新了相关注释以反映新的业务规则
|
2026-07-02 14:07:19 +08:00 |
|
锦麟 王
|
365711b5ff
|
自动互换分红时,期末结算全价使用PosiGrossPrice
|
2026-07-02 13:02:14 +08:00 |
|