From d61ff742decbfdbbade51796d00e0bcb5319102d Mon Sep 17 00:00:00 2001 From: hjhan Date: Tue, 11 Aug 2026 11:18:56 +0800 Subject: [PATCH] =?UTF-8?q?refactor(return-leg):=20SwapDealService=20?= =?UTF-8?q?=E5=A2=9E=E5=80=BC=E7=A8=8E=E5=85=AC=E5=BC=8F=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E4=B8=BA=20DividendCalc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SwapDealService:1806 inline 的 dividendIn/(1+tax)*(1-tax) 替换为 DividendCalc.AfterTaxRaw(中间计算不四舍五入)。 全库 payment/(1+tax)*(1-tax) inline 公式: 5处(SwapEod 4 + SwapDeal 1) → 0。 全部收敛到 DividendCalc.AfterTax / AfterTaxRaw。 验证: 编译0错误, 全量507测试7失败(基线一致)。 --- YLErpDAL/Modules/SwapModule/SwapDealService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/YLErpDAL/Modules/SwapModule/SwapDealService.cs b/YLErpDAL/Modules/SwapModule/SwapDealService.cs index 152c0176..ba511cd9 100644 --- a/YLErpDAL/Modules/SwapModule/SwapDealService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapDealService.cs @@ -13,6 +13,7 @@ using YLErp.Modules.TradeModule; using YLErp.Modules.TradeModule.DealModule; using YLErp.Modules.SwapModule.FundingLegs; using YLErp.Modules.SwapModule.Margin; +using YLErp.Modules.SwapModule.ReturnLegs; using YLErp.QdpModule; namespace YLErp.Modules.SwapModule @@ -1803,7 +1804,7 @@ namespace YLErp.Modules.SwapModule var dividendIn = servie.CalcPayment(payments, unwindQty, shortRatio, directionRatio); var um = DataCacheProvider.GetUnderlyingDataSource().GetData(flowEvent.UnderlyingCode); decimal tax = um.ValueAddedTax ?? 0; - dividendIn = dividendIn / (1 + tax) * (1 - tax); + dividendIn = DividendCalc.AfterTaxRaw(dividendIn, tax); flowEvent.DividendIn = Math.Round(dividendIn, 2, MidpointRounding.AwayFromZero); }