revert: 撤销单利consumedInterest扣除(双重扣减导致1天利息变0)

单利起点InterestProfitSum已含历史累计(eod快照),
再减consumedInterest会双重扣减。复利起点是0(从头算),
减consumedInterest正确。两者计算结构不同不能套用。

正确方向:让InterestProfitSum在互换结清后归零(eod层方案B),
而非在计算时减consumedInterest。待重新设计单利修复方案。

测试还原为红灯(Assert redCount>0),注释更新说明正确方向。
This commit is contained in:
hjhan
2026-07-01 13:38:24 +08:00
parent 83f44124c6
commit f7d23dc132
2 changed files with 12 additions and 13 deletions
@@ -267,17 +267,18 @@ namespace YLErp.Modules.SwapModule
if (redCount > 0)
{
Console.WriteLine($" ⚠ 单利路径仍存在偏大:{redCount} 条单利腿默认值含历史已结利息。");
Console.WriteLine($" 根因:CalcDailySimpleInterest 未加 consumedInterest 扣除。");
Console.WriteLine($" 根因:CalcDailySimpleInterest 起点InterestProfitSum在互换后未归零。");
Console.WriteLine($" 注意:不能简单减consumedInterest(会双重扣减,导致应为1天利息变0)。");
Console.WriteLine($" 正确方案:让InterestProfitSum在互换结清后归零(eod层方案B)。");
}
else
{
Console.WriteLine($" 单利路径已修复:默认值正确扣除历史已结利息,无偏大。");
Console.WriteLine($" 单利路径未检测到偏大。");
}
// 绿灯断言(修复后):单利路径不应再存在偏大
Assert.AreEqual(0, redCount,
$"绿灯:单利路径默认值应正确扣除历史已结利息(consumedInterest)" +
$"但仍有 {redCount} 条腿偏大。");
// 灯断言:单利路径存在偏大(待正确修复方案)
Assert.IsTrue(redCount > 0,
"红灯:单利路径应存在默认值偏大。待正确修复(InterestProfitSum归零)后反转。");
}
finally
{