From 61f1c25c3ebfea1d537e183bbcbf82c9a13c56b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=96=B9=E6=B5=B7?= Date: Tue, 15 Apr 2025 09:29:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8D=E4=B9=89=E6=9C=AC=E9=87=91bug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs | 11 +---------- YLErpDAL/Modules/SwapModule/SwapFlowEventService.cs | 4 ++-- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs b/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs index 4068e2fc..251d1229 100644 --- a/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs @@ -140,15 +140,7 @@ namespace YLErp.Modules.SwapModule var longEventTypes = eventTyps; longEventTypes.Add((int)SwapFlowEventTypeEnum.开仓); var flowEvents = new List(); - Expression> eventExpression = x => x.SwapTradeId == td.id && x.DataState == (int)SwapFlowDateStateEnum.完成 && longEventTypes.Contains(x.EventType); - if (settleDate == td.TradeDate) - { - eventExpression = eventExpression.And(x => x.EventDate == settleDate); - } - else - { - eventExpression = eventExpression.And(x => x.UnwindDate == settleDate); - } + Expression> eventExpression = x => x.SwapTradeId == td.id && x.DataState == (int)SwapFlowDateStateEnum.完成 && longEventTypes.Contains(x.EventType)&& x.EventDate == settleDate; flowEvents = DbContext.swap_flow_event.Where(eventExpression).ToList(); var preDealDate = GetPreDealDate(td.id, settleDate, eventTyps);//上一次平仓/互换/自动互换处理日期 List autoInterests = new List();//自动互换利息腿信息 @@ -1360,7 +1352,6 @@ namespace YLErp.Modules.SwapModule } curretEod.TdCloseDividend = curretEod.TdPosiDividend; curretEod.UnderlyingMarketValue = curretEod.UnderlyingPrice * curretEod.PosiQuantity * curretEod.ContractSize * shortRatio; - curretEod.PosiNotionalValue = curretEod.PosiQuantity * curretEod.ContractSize; curretEod.PosiMtmPnL = (curretEod.UnderlyingPrice - curretEod.PosiGrossPrice) * curretEod.PosiQuantity * curretEod.ContractSize * shortRatio * directionRatio; curretEod.PosiDividendSum = curretEod.TdPosiDividend; curretEod.PosiProfitSum = curretEod.PosiMtmPnL + curretEod.PosiDividendSum + curretEod.VTradingFee; diff --git a/YLErpDAL/Modules/SwapModule/SwapFlowEventService.cs b/YLErpDAL/Modules/SwapModule/SwapFlowEventService.cs index 52ec00c8..276dc303 100644 --- a/YLErpDAL/Modules/SwapModule/SwapFlowEventService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapFlowEventService.cs @@ -371,8 +371,8 @@ namespace YLErp.Modules.SwapModule flow_Event.Quantity = position.PosiQuantity; flow_Event.PositionQty = flow_Event.Quantity; - flow_Event.TradingAmount = position.PosiQuantity * position.ContractSize; - flow_Event.TradingFee = position.PosiTradingFee * -1;//费用先按负数处理 + flow_Event.TradingAmount = position.PosiNotionalValue; + flow_Event.TradingFee = position.PosiTradingFee; flow_Event.MarkClosePnl = 0; flow_Event.CloseFee = 0;