From b0cdf0bcbc7fca51e2257fc0b4ab9279d32f9eee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8D=E9=94=90?= <1565842059@qq.com> Date: Tue, 11 Aug 2026 12:33:34 +0800 Subject: [PATCH] =?UTF-8?q?style(SwapModule):=20=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 SwapDealService.cs 中标准化了多行参数的缩进和换行 - 修复了 SwapTradeBaseService.cs 中的条件运算符周围的空格 - 统一了方法调用中参数的排列格式 - 改进了代码的可读性和一致性 - 遵循了团队的代码风格规范 --- YLErpDAL/Modules/SwapModule/SwapDealService.cs | 14 ++++++++++---- .../Modules/SwapModule/SwapTradeBaseService.cs | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/YLErpDAL/Modules/SwapModule/SwapDealService.cs b/YLErpDAL/Modules/SwapModule/SwapDealService.cs index c9605a21..5598d46b 100644 --- a/YLErpDAL/Modules/SwapModule/SwapDealService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapDealService.cs @@ -862,7 +862,9 @@ namespace YLErp.Modules.SwapModule var consumedInterest = position.InterestType == (int)InterestTypeEnum.复利 ? GetConsumedInterest(td.id, position.id, endDate) : 0m; - interests.Add(CalcUnwindInterest(td, valueDate, endDate, positionClone, rate, floatRate, posiPrincipal, closePrincipal, newClosePercent, annualDays, preEodPosition, eventType, add, swap, orginPv, calcFirst, calcLast||newCalcLast, consumedInterest)); + interests.Add(CalcUnwindInterest(td, valueDate, endDate, positionClone, rate, floatRate, posiPrincipal, + closePrincipal, newClosePercent, annualDays, preEodPosition, eventType, add, swap, orginPv, calcFirst, + calcLast||newCalcLast, consumedInterest)); } } //当日有平仓或互换记录时,避免重复结算 @@ -1132,11 +1134,13 @@ namespace YLErp.Modules.SwapModule preEod.ValueDate = td.StartDate.Value; if (calcFirst) { - preEod.ValueDate= preEod.ValueDate.AddDays(-1); + preEod.ValueDate = preEod.ValueDate.AddDays(-1); } } - return InitSwapDealInterest(td, valueDate, endDate, rate, position, add, swap, posiPrincipal, closePrincipal, closePercent, annualDays, eventType, preEod, false, orginPv, calcFirst, calcLast, consumedInterest); + return InitSwapDealInterest(td, valueDate, endDate, rate, position, add, swap, posiPrincipal, + closePrincipal, closePercent, annualDays, eventType, preEod, false, + orginPv, calcFirst, calcLast, consumedInterest); } /// /// 初始化利息腿信息 @@ -1324,7 +1328,9 @@ namespace YLErp.Modules.SwapModule /// 是否年化 /// 年化天数 /// - public void CalcDailyCompoundInterest(DateTime endDate, swap_position position, decimal principal, swap_flow_event flowEvent, int annualDays, bool needPrice, decimal floateRate, decimal closePercent, decimal orginPv, bool calcFirst, bool calcLast, ref decimal InterestAmount, ref decimal TdInterestAmount, decimal consumedInterest = 0m, decimal resetCarryInterest = 0m) + public void CalcDailyCompoundInterest(DateTime endDate, swap_position position, decimal principal, swap_flow_event flowEvent, + int annualDays, bool needPrice, decimal floateRate, decimal closePercent, decimal orginPv, bool calcFirst, bool calcLast, + ref decimal InterestAmount, ref decimal TdInterestAmount, decimal consumedInterest = 0m, decimal resetCarryInterest = 0m) { var startDate = position.PosiStartDate; decimal interestProfitSum = 0; diff --git a/YLErpDAL/Modules/SwapModule/SwapTradeBaseService.cs b/YLErpDAL/Modules/SwapModule/SwapTradeBaseService.cs index bfc2e45d..8f2d3ed4 100644 --- a/YLErpDAL/Modules/SwapModule/SwapTradeBaseService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapTradeBaseService.cs @@ -369,7 +369,7 @@ namespace YLErp.Modules.SwapModule { interestStart = td.StartDate.Value; var exerciseDate = td.ExerciseDate.Value; - interestEnd = valueDate> exerciseDate? exerciseDate : valueDate; + interestEnd = valueDate > exerciseDate ? exerciseDate : valueDate; bool calcFirst = true; bool calcLast = true;