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;