From bb95eb1396bcf7c69c08ccd8fdecb9ea73bff286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=96=B9=E6=B5=B7?= Date: Mon, 11 May 2026 18:38:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/SwapModule/SwapDealService.cs | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/YLErpDAL/Modules/SwapModule/SwapDealService.cs b/YLErpDAL/Modules/SwapModule/SwapDealService.cs index c60eccf5..43d0eef3 100644 --- a/YLErpDAL/Modules/SwapModule/SwapDealService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapDealService.cs @@ -402,7 +402,6 @@ namespace YLErp.Modules.SwapModule // 根据场景计算利息 if (settment) { - calcLast = calcLast = td.trade_extend.ExtendObj.InterestCalcMode.EndsWith("1");//算尾 // 收盘归档场景,使用 CalcEodInterest interests.Add(CalcEodInterest(td, valueDate, positionClone, rate, floatRate, closePrincipal, posiPrincipal, annualDays, calcFirst, calcLast, preEodPosition, eventType, add)); } @@ -530,26 +529,17 @@ namespace YLErp.Modules.SwapModule decimal tdInterestAmount = 0; if (calcToday) { - // 收盘自动互换场景,如果不算尾,当天是不产生利息的 - if (calcLast == false && eventType == (int)SwapEventTypeEnum.自动互换) + if (position.InterestType == (int)InterestTypeEnum.复利) { - interestAmount= preEod.InterestProfitSum; - tdInterestAmount = 0; + // 复利计算 + CalcDailyCompoundInterestByEod(preEod, valueDate, td.StartDate.Value, position, closePrincipal, posiPrincipal, interest, annualDays, false, eodFloatRate, 1m, posiPrincipal, ref interestAmount, ref tdInterestAmount); } else { - if (position.InterestType == (int)InterestTypeEnum.复利) - { - // 复利计算 - CalcDailyCompoundInterestByEod(preEod, valueDate, td.StartDate.Value, position, closePrincipal, posiPrincipal, interest, annualDays, false, eodFloatRate, 1m, posiPrincipal, ref interestAmount, ref tdInterestAmount); - } - else - { - // 单利计算 - CalcDailySimpleInterestByEod(preEod, valueDate, td.StartDate.Value, position, closePrincipal, posiPrincipal, interest, annualDays, false, eodFloatRate, 1m, posiPrincipal, ref interestAmount, ref tdInterestAmount); - } + // 单利计算 + CalcDailySimpleInterestByEod(preEod, valueDate, td.StartDate.Value, position, closePrincipal, posiPrincipal, interest, annualDays, false, eodFloatRate, 1m, posiPrincipal, ref interestAmount, ref tdInterestAmount); } - + } // 四舍五入并赋值 interest.InterestAmount = Math.Round(interestAmount, ConsGlobal.PriceRound, MidpointRounding.AwayFromZero);