From 3777022bac012aab7025cef7981e711aa88a0465 Mon Sep 17 00:00:00 2001 From: hjhan Date: Thu, 20 Aug 2026 12:59:12 +0800 Subject: [PATCH] =?UTF-8?q?fix(swap):=20EQD-6977=20closeList=20=E6=8E=92?= =?UTF-8?q?=E9=99=A4=E7=BD=9A=E6=81=AF=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GetUnwindInterests 的 closeList 查询加 IsPenaltyInterest!=1 过滤,使已落库罚息事件不进去重基数,避免当日二次部分平仓时正常利息被错误抵扣。DDL(stage1 Ver-5.7.0)须随发布。 --- YLErpDAL/Modules/SwapModule/SwapDealService.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/YLErpDAL/Modules/SwapModule/SwapDealService.cs b/YLErpDAL/Modules/SwapModule/SwapDealService.cs index 16e7ae35..98cde2db 100644 --- a/YLErpDAL/Modules/SwapModule/SwapDealService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapDealService.cs @@ -475,10 +475,11 @@ namespace YLErp.Modules.SwapModule var stockEqvNotional = realPostitions.Where(x => x.PosiDirection > 0).Sum(s => s.PosiNotionalValue); // 当前平仓前的实时剩余本金 var posiNotionalValue = stockEqvNotional * closePercent;// 本次平仓名义本金 var orginPv = ResolveUnwindPreviousNotional(lastEod, lastEodPositions, stockEqvNotional); // 上一日终的浮动端本金 - var closeList = DbContext.swap_flow_event.Where(x => x.SwapTradeId == tradeId - && x.UnwindDate == unwindDate - && eventTypes.Contains(x.EventType) - && x.DataState == (int)SwapFlowDateStateEnum.完成).ToList(); + var closeList = DbContext.swap_flow_event.Where(x => x.SwapTradeId == tradeId + && x.UnwindDate == unwindDate + && eventTypes.Contains(x.EventType) + && x.DataState == (int)SwapFlowDateStateEnum.完成 + && x.IsPenaltyInterest != 1).ToList(); bool tdClose = closeList.Count > 0; // 显式入口:平仓前剩余本金 + 实际平掉额 + B语义比例,盘中重放(语义见 InterestCalcRequest.IntradayUnwind) interests = GetIntradayUnwindInterests(InterestCalcRequest.IntradayUnwind(