From 535497c68acbecbe1a25a7507b3334bd3c245555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=96=B9=E6=B5=B7?= Date: Thu, 4 Jun 2026 13:23:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=94=B6=E5=88=B0=E5=B9=B3=E4=BB=93?= =?UTF-8?q?=E6=88=96=E4=BA=92=E6=8D=A2=E5=88=A9=E6=81=AF=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/SwapModule/SwapDealService.cs | 32 +++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/YLErpDAL/Modules/SwapModule/SwapDealService.cs b/YLErpDAL/Modules/SwapModule/SwapDealService.cs index 3fd21bf8..fe89dd14 100644 --- a/YLErpDAL/Modules/SwapModule/SwapDealService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapDealService.cs @@ -413,20 +413,32 @@ namespace YLErp.Modules.SwapModule interests.Add(CalcUnwindInterest(td, valueDate, endDate, positionClone, rate, floatRate, posiPrincipal, closePrincipal, newClosePercent, annualDays, preEodPosition, eventType, add, swap, orginPv, calcFirst, calcLast||newCalcLast)); } } - //当日有平仓或互换记录时,需要把平仓或互换已经结算的利息从计算结果中扣除,避免重复计算 - //互换始终需要扣除;平仓仅不算尾时需要(算尾时利息已包含关闭日,无重叠) - if (closeList != null && closeList.Count > 0 - && (eventType == (int)SwapEventTypeEnum.自动互换 || (!calcLast && !newCalcLast))) + //当日有平仓或互换记录时,避免重复结算 + if (closeList != null && closeList.Count > 0) { foreach (var item in interests) { var closeEvent = closeList.Where(x => x.PositionId == item.PositionId); - var closePnl = closeEvent.Sum(s => s.InterestClosePnL); - var closeAmount = closeEvent.Sum(s => s.InterestAmount); - var closeTdAmount = closeEvent.Sum(s => s.TdInterestAmount); - item.InterestAmount = item.InterestAmount - closeAmount; - item.TdInterestAmount = item.TdInterestAmount - closeTdAmount; - item.InterestClosePnL = item.InterestClosePnL - closePnl; + if (eventType == (int)SwapEventTypeEnum.互换 || eventType == (int)SwapEventTypeEnum.自动互换) + { + // 互换:该仓位当天已有完成事件,直接归0 + if (closeEvent.Any()) + { + item.InterestAmount = 0; + item.TdInterestAmount = 0; + item.InterestClosePnL = 0; + } + } + else if (!calcLast && !newCalcLast) + { + // 平仓不算尾:扣除已结算的利息(算尾时利息已包含关闭日,无重叠) + var closePnl = closeEvent.Sum(s => s.InterestClosePnL); + var closeAmount = closeEvent.Sum(s => s.InterestAmount); + var closeTdAmount = closeEvent.Sum(s => s.TdInterestAmount); + item.InterestAmount = item.InterestAmount - closeAmount; + item.TdInterestAmount = item.TdInterestAmount - closeTdAmount; + item.InterestClosePnL = item.InterestClosePnL - closePnl; + } } } return interests; From dbd2c533a1a796f373e76716cf73f72e34fb38f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8D=E9=94=90?= <1565842059@qq.com> Date: Fri, 5 Jun 2026 13:57:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=E9=82=AE=E7=AE=B1=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=8F=91=E4=BB=B6=E4=BA=BA=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../clientbalance/TradeMarketDescSet.cshtml | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/YLErpWeb/Views/clientbalance/TradeMarketDescSet.cshtml b/YLErpWeb/Views/clientbalance/TradeMarketDescSet.cshtml index 48f33151..9bda37b7 100644 --- a/YLErpWeb/Views/clientbalance/TradeMarketDescSet.cshtml +++ b/YLErpWeb/Views/clientbalance/TradeMarketDescSet.cshtml @@ -100,17 +100,17 @@
@Html.MyAceDropdownInput2("setTemplate", "模板名:  ", YLErp.Web.Controllers.clientbalanceController.GetAllClientBalanceTemplate(), false, "", true, new { onchange = "changeTemplate()" })
-

发件人:

- + @*

发件人:

*@ + @* *@ @if (!PS.Config.Is申万) {