hjhan
24266cfad4
fix(swap): 多次部分平仓预付金返还默认显示初始值(GLMS-20260701-0008)
根因: GetUnwindInterests 利息腿迭代源取 origPositions(IsInitial=1),
其预付金腿 InterestPrincipalFix 恒为初始值(99000); 而"当前剩余本金"(73260)
存于实时腿 realPositions(IsInitial=0)。CalcNotionalByMode 与 InitSwapDealInterest
均读 position.InterestPrincipalFix, 导致多次部分平仓后平仓页默认按初始本金计算
返还。首次平仓 orig==real 掩盖了 bug, 故此前"只修好一次部分平仓"。
修复: 抽纯函数 ResolveInterestLegPositions(orig, real)——迭代源仍用 origPositions
(保留 orig.id -> eod_swap_position.PositionId 的日终匹配, 全库 eod 均按 orig.id 归档,
换 realPositions 会破坏 preEod 匹配导致利息重算错误), 仅对预付金腿(初始5/追加6)
Clone 覆盖 InterestPrincipalFix 为实时腿剩余本金; real.PositionId == orig.id 精确
1:1 关联; orig==real 时返回原始腿本身不克隆。
测试: 新增 SwapUnwindPrepayOrigVsRealBugTdd(6 用例)直接单测该纯函数, 覆盖既有
19 个用例(均绕过 orig/real 选择)的盲区。dotnet test --filter SwapUnwindPrepay
25 passed(19+6) 失败 0。
2026-07-16 10:49:12 +08:00
..
2025-08-29 14:43:24 +08:00
2024-05-09 14:06:26 +08:00
2025-09-11 14:18:51 +08:00
2024-05-09 14:06:26 +08:00
2026-03-25 10:24:48 +08:00
2026-07-16 10:49:12 +08:00
2026-07-03 08:22:27 +08:00
2026-07-14 10:55:47 +08:00
2024-06-05 14:37:30 +08:00
2024-05-09 14:06:26 +08:00
2025-04-14 16:31:35 +08:00
2026-07-03 09:52:57 +08:00
2026-07-03 08:22:27 +08:00
2026-07-13 16:56:04 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2026-01-26 17:35:56 +08:00
2026-07-03 09:20:59 +08:00
2026-07-03 17:53:18 +08:00
2026-05-28 15:16:32 +08:00
2024-05-09 14:06:26 +08:00
2024-05-09 14:06:26 +08:00
2024-06-04 18:19:49 +08:00