From e2fb456bc3b58ad7219ee50d840a3520b82ac373 Mon Sep 17 00:00:00 2001 From: hjhan Date: Thu, 16 Jul 2026 20:07:50 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=B9=B3=E4=BB=93(InitUnwind=20L267)?= =?UTF-8?q?=E7=A1=AC=E7=BC=96=E7=A0=81=201=E8=80=8C=E4=B8=8D=E6=98=AF?= =?UTF-8?q?=E5=89=A9=E4=BD=99=E5=B9=B3=E4=BB=93=E6=AF=94=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YLErpDAL/Modules/SwapModule/SwapDealService.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/YLErpDAL/Modules/SwapModule/SwapDealService.cs b/YLErpDAL/Modules/SwapModule/SwapDealService.cs index 246142bd..f27ec368 100644 --- a/YLErpDAL/Modules/SwapModule/SwapDealService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapDealService.cs @@ -264,7 +264,12 @@ namespace YLErp.Modules.SwapModule unwindData.PositionQty = position != null ? position.PosiQuantity : Convert.ToDecimal(td.TradeAmount); unwindData.AnnualDays = tradeExtend == null ? 365 : tradeExtend.ExtendObj.AnnualDays; unwindData.CloseMethod = (int)CloseMethodEnum.全部平仓; - unwindData.ClosePercent = 1; + // 占期初(original)语义(A):默认"平掉剩余全部持仓" = 剩余名义本金/期初名义本金。 + // 未平仓时 PosiNotionalValue==NotionalValue → 1(平100%);部分平仓后自动变为剩余比例(如已平10%则默认90%)。 + // 与互换/提前终止 InitIncome(L447) 保持一致。 + unwindData.ClosePercent = unwindData.NotionalValue > 0 + ? unwindData.PosiNotionalValue / unwindData.NotionalValue + : 1; unwindData.CloseNotionalValue = unwindData.PosiNotionalValue; unwindData.CloseQty = unwindData.PositionQty; if (position != null)