From 63bfc8ca8f58aea8f56fab174f081c874e48ec58 Mon Sep 17 00:00:00 2001 From: hjhan Date: Wed, 12 Aug 2026 05:36:02 +0800 Subject: [PATCH] =?UTF-8?q?refactor(interest):=20SwapDealService=20?= =?UTF-8?q?=E6=8E=A5=E5=85=A5=20FundingLegRate=20=E5=B7=A5=E5=8E=82?= =?UTF-8?q?=E5=B9=B6=E5=A4=8D=E7=94=A8=20FundingLegPrecision?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 取率处改用 Fixed/Floating 工厂;InterestCalculationPrecision 引用 SwapInterest.FundingLegPrecision,消除重复常量定义。 --- YLErpDAL/Modules/SwapModule/SwapDealService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/YLErpDAL/Modules/SwapModule/SwapDealService.cs b/YLErpDAL/Modules/SwapModule/SwapDealService.cs index ecb68d59..818d1d3c 100644 --- a/YLErpDAL/Modules/SwapModule/SwapDealService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapDealService.cs @@ -114,8 +114,8 @@ namespace YLErp.Modules.SwapModule return unwindData.ClosePercent == 1 || (remainingNotional == 0 && remainingQuantity == 0); } - // 待实现利息会进入 decimal(30,12) 日终快照 - private const int InterestCalculationPrecision = 12; + // 待实现利息会进入 decimal(30,12) 日终快照;精度常量统一引用 SwapInterest.FundingLegPrecision,消除重复定义。 + private const int InterestCalculationPrecision = SwapInterest.FundingLegPrecision; /// /// 手工平仓、手工互换及收益结算的利息事件按金额两位落库。 @@ -1583,8 +1583,8 @@ namespace YLErp.Modules.SwapModule // 利率构成按腿型封装:固定腿 → FixedRate;浮动腿 → Spread + IndexFixing(沿用旧实现 InterestRate+浮动利率 的口径)。 var isFixedLeg = string.IsNullOrEmpty(position.FloatRateUnderlyingCode); var legRate = isFixedLeg - ? new FundingLegRate(fixedRate: flowEvent.InterestRate) - : new FundingLegRate(spread: flowEvent.InterestRate, indexFixing: effectiveFloat); + ? FundingLegRate.Fixed(flowEvent.InterestRate) + : FundingLegRate.Floating(flowEvent.InterestRate, effectiveFloat); var accrualPolicy = new AccrualPolicy( convention: AccrualBoundary.Both, isCompound: false,