From adb1b90c03b12fba560fff36ad3a0bd7bf3f7c5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8D=E9=94=90?= <1565842059@qq.com> Date: Mon, 10 Aug 2026 13:17:12 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(swap):=20=E4=BF=AE=E5=A4=8D=E9=A2=84?= =?UTF-8?q?=E4=BB=98=E6=9C=AC=E9=87=91=E9=83=A8=E5=88=86=E5=B9=B3=E4=BB=93?= =?UTF-8?q?=E5=90=8E=E7=9A=84=E5=89=A9=E4=BD=99=E6=9C=AC=E9=87=91=E8=AE=A1?= =?UTF-8?q?=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改InterestPrincipalFix字段从PrepayFix调整为PrepayRemaining - 添加注释说明GetUnwindInterests方法会用实时腿覆盖初始腿本金 - 确保部分平仓后剩余60%本金的正确计算逻辑 --- .../Modules/SwapModule/PrepaidPrincipalCloseTraceTest.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UnitTestProject/Modules/SwapModule/PrepaidPrincipalCloseTraceTest.cs b/UnitTestProject/Modules/SwapModule/PrepaidPrincipalCloseTraceTest.cs index c47296e3..45e60bef 100644 --- a/UnitTestProject/Modules/SwapModule/PrepaidPrincipalCloseTraceTest.cs +++ b/UnitTestProject/Modules/SwapModule/PrepaidPrincipalCloseTraceTest.cs @@ -71,7 +71,8 @@ namespace YLErp.Modules.SwapModule id = 1001, SwapTradeId = 1, PositionType = (int)PositionTypeFlag.Unknown, InterestDirection = (int)SwapDirectionEnum.收取, InterestMode = (int)InterestModeEnum.初始预付金, - InterestRateDefault = Rate, InterestPrincipalFix = PrepayFix, + // GetUnwindInterests 会用实时腿覆盖初始腿本金;部分平仓后这里应为剩余 60%。 + InterestRateDefault = Rate, InterestPrincipalFix = PrepayRemaining, PosiStartDate = Start, PosiMatuirityDate = new DateTime(2027, 7, 28), IsInitial = true, Invalid = false, InterestType = (int)InterestTypeEnum.单利, IsAnnualized = true, interest_rest_days = 1, From 1d954621c1deb44f31ffbdf3f0ba237fcb09ad88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8D=E9=94=90?= <1565842059@qq.com> Date: Mon, 10 Aug 2026 10:32:41 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(bond):=20=E4=BF=AE=E5=A4=8D=E5=80=BA?= =?UTF-8?q?=E5=88=B8=E8=AE=A1=E7=AE=97=E4=B8=AD=E7=9A=84=E4=BB=B7=E6=A0=BC?= =?UTF-8?q?=E5=80=8D=E6=95=B0=E5=BA=94=E7=94=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在BondCalcHelper调用中添加了bondShowPriceMultiple倍数转换 - 确保deal_full_price_avg在传递给债券计算器之前进行正确的价格倍数调整 - 保持原有的空值检查逻辑以确保计算安全性 --- YLErpDAL/BLL/EodSettlement/RealtimePnlCalc.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/YLErpDAL/BLL/EodSettlement/RealtimePnlCalc.cs b/YLErpDAL/BLL/EodSettlement/RealtimePnlCalc.cs index 54e9a178..d8347cbc 100644 --- a/YLErpDAL/BLL/EodSettlement/RealtimePnlCalc.cs +++ b/YLErpDAL/BLL/EodSettlement/RealtimePnlCalc.cs @@ -745,7 +745,7 @@ namespace YLErp.BLL.Eod #region 新互换实时持仓私有方法 private static void BondCalcApi(ClientPosition clientPosition) { - var resp = BondCalcHepler.BondCalc(clientPosition.security_id, clientPosition.deal_full_price_avg ?? 0, "DP"); + var resp = BondCalcHepler.BondCalc(clientPosition.security_id, clientPosition.deal_full_price_avg * ConsGlobal.bondShowPriceMultiple ?? 0, "DP"); if (resp != null) { clientPosition.deal_yield_avg = resp.ytm * ConsGlobal.bondPriceMultiple;