Commit Graph
2 Commits
Author SHA1 Message Date
hjhan 30ae93b8ca fix(interest): SwapDealIndexFixer 改用委托, 修复 CS0122 编译错误
问题: SwapDealIndexFixer(internal)访问 SwapDealService.TryGetFloatRate
(protected) 报 CS0122, 因非嵌套类无权访问 protected 成员。

修复: SwapDealIndexFixer 改为接受 Func<DateTime,string,(bool,double)> 委托,
SwapDealService.IndexFixer 属性传入 TryGetFloatRate 的包装。
- 无需访问 protected 成员
- SwapDealIndexFixer 保持独立文件(clean code)
- virtual 接缝仍保留(测试 override TryGetFloatRate 仍生效)

验证: YLErpDAL.csproj 编译 0 错误, 全量480测试7失败(基线一致,零回归),
CI_007/CI_008 通过。
2026-08-11 09:23:01 +08:00
hjhan 59c16aabc1 refactor(interest): SwapDealService 6处取价收敛到 IIndexFixer
修正上次尝试的失败: 静态 Fr007IndexFixer.Instance 绕过了
TryGetFloatRate(virtual)接缝, 导致测试 stub 失效(CI_007/CI_008失败)。

本次方案: 新增 SwapDealIndexFixer(实例级, 委托 TryGetFloatRate):
- SwapDealService.IndexFixer 属性 lazy 初始化, 包 SwapDealIndexFixer
- 6处 GetNonHolidayDefore+TryGetFloatRate 全部替换为 IndexFixerBase+IndexFixer
- TryGetFloatRate(protected virtual)保留不动, 测试 stub 机制完全不受影响

验证: CI_007/CI_008 从失败转为通过, 全量480测试7失败(与基线一致,零回归)。
SwapDealService 内 GetNonHolidayDefore 出现次数: 6 → 0(全部收敛到 IndexFixerBase)。
2026-08-11 09:17:42 +08:00