From 002488bb7175299669f7265452dc07fe13f51e98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=96=B9=E6=B5=B7?= Date: Fri, 13 Jun 2025 14:59:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=B3=E4=BB=93=E5=90=8D=E4=B9=89=E6=9C=AC?= =?UTF-8?q?=E9=87=91=E4=B8=8E=E5=89=A9=E4=BD=99=E5=90=8D=E4=B9=89=E6=9C=AC?= =?UTF-8?q?=E9=87=91=E5=85=AC=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YLErpDAL/Modules/SwapModule/SwapDealService.cs | 4 ++-- YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs | 2 +- YLErpWeb/wwwroot/Scripts/app/swaptrade/unwindSwapTrade.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/YLErpDAL/Modules/SwapModule/SwapDealService.cs b/YLErpDAL/Modules/SwapModule/SwapDealService.cs index 2b09bb65..62cc823e 100644 --- a/YLErpDAL/Modules/SwapModule/SwapDealService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapDealService.cs @@ -850,7 +850,7 @@ namespace YLErp.Modules.SwapModule unwindData.CloseMethod = unwindQty == unwindData.PositionQty ? (int)CloseMethodEnum.全部平仓 : (int)CloseMethodEnum.部分平仓; unwindData.ClosePercent = unwindData.PositionQty == 0 ? 0 : unwindPercent; unwindData.CloseNotionalValue = position == null ? 0 : unwindQty * position.PosiGrossPrice * position.ContractSize; - unwindData.CloseNotionalValue = unwindData.CloseNotionalValue > unwindData.PosiNotionalValue? unwindData.PosiNotionalValue: unwindData.CloseNotionalValue; + unwindData.CloseNotionalValue = unwindPercent >= 1? unwindData.PosiNotionalValue: unwindData.CloseNotionalValue; unwindData.CloseQty = unwindQty; if (position != null) { @@ -1371,7 +1371,7 @@ namespace YLErp.Modules.SwapModule if (!string.IsNullOrEmpty(position.UnderlyingCode)) { position.PosiQuantity -= unwindData.CloseQty; - position.PosiNotionalValue = position.PosiGrossPrice * position.PosiQuantity * position.ContractSize; + position.PosiNotionalValue = unwindData.PosiNotionalValue- unwindData.CloseNotionalValue; position.PosiTradingFee -= position.PosiTradingFee * unwindData.ClosePercent; position.PosiTradingFeePending -= position.PosiTradingFeePending * unwindData.ClosePercent; } diff --git a/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs b/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs index faf75da7..2c6fd384 100644 --- a/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs @@ -1294,7 +1294,7 @@ namespace YLErp.Modules.SwapModule curretEod.PosiNetFeePrice = (eod.PosiNetFeePrice * eod.PosiQuantity + openFlowEvents.Sum(a => a.Quantity * a.TradingAmountNetFeeAvg)) / (eod.PosiQuantity + openQty); curretEod.PosiNetFeePrice = Math.Round(curretEod.PosiNetFeePrice ?? 0, 10, MidpointRounding.AwayFromZero); } - curretEod.PosiNotionalValue = curretEod.PosiGrossPrice * curretEod.PosiQuantity * curretEod.ContractSize; + curretEod.PosiNotionalValue = eod.PosiNotionalValue+ openFlowEvents.Sum(s=>s.TradingAmount)- unwindFlowEvents.Sum(s=>s.TradingAmount); curretEod.TdPosiDividend = unwindEvents.Sum(x => x.DividendIn) * directionRatio; curretEod.TdCloseFee = unwindEvents.Sum(x => x.TradingFee); curretEod.TdCloseQty = unwindQty; diff --git a/YLErpWeb/wwwroot/Scripts/app/swaptrade/unwindSwapTrade.js b/YLErpWeb/wwwroot/Scripts/app/swaptrade/unwindSwapTrade.js index e7aa1633..88df9333 100644 --- a/YLErpWeb/wwwroot/Scripts/app/swaptrade/unwindSwapTrade.js +++ b/YLErpWeb/wwwroot/Scripts/app/swaptrade/unwindSwapTrade.js @@ -222,7 +222,7 @@ const vue = new Vue({ thisObj.deal.SwapRealizedPnL = pnl; thisObj.deal.SwapMarginRebatePnl = 0; thisObj.deal.SwapMarginAmount = 0; - thisObj.floatPosition.TradingAmount = parseFloat(thisObj.floatPosition.TradingAmountAvg) * parseFloat(thisObj.deal.CloseNotionalValue) * 0.01; + thisObj.floatPosition.TradingAmount = parseFloat(thisObj.deal.CloseNotionalValue); thisObj.floatPosition.CloseFee = TradingFee; if (thisObj.deal.CloseQty == 0) { thisObj.floatPosition.TradingAmountFeeAvg = 0;