From b0b04dbdeaf364c16fa4abfc1eeccaf8e4e5c168 Mon Sep 17 00:00:00 2001 From: tengyufan <1532636164@qq.com> Date: Thu, 6 Aug 2026 11:29:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BA=A4=E6=98=93?= =?UTF-8?q?=E5=AE=A1=E6=89=B9=E6=9C=9F=E5=88=9D=E6=A0=87=E7=9A=84=E4=BB=B7?= =?UTF-8?q?=E6=A0=BC=E5=8F=96=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YLErpDAL/Modules/TradeModule/TradeBLL.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/YLErpDAL/Modules/TradeModule/TradeBLL.cs b/YLErpDAL/Modules/TradeModule/TradeBLL.cs index 2efe1960..62e42170 100644 --- a/YLErpDAL/Modules/TradeModule/TradeBLL.cs +++ b/YLErpDAL/Modules/TradeModule/TradeBLL.cs @@ -276,10 +276,10 @@ namespace YLErp.BLL } var swapPositions = db.Set() .Where(sp => swapTradeIds.Contains(sp.SwapTradeId) && sp.IsInitial && sp.UnderlyingCode != null) - .Select(sp => new { sp.SwapTradeId, sp.PosiNetPrice, sp.UnderlyingCode }) + .Select(sp => new { sp.SwapTradeId, sp.PosiGrossPrice, sp.UnderlyingCode }) .ToList(); var logger = LogFactory.GetLogger(); - var posDict = swapPositions.GroupBy(sp => sp.SwapTradeId).ToDictionary(g => g.Key, g => g.First().PosiNetPrice); + var posDict = swapPositions.GroupBy(sp => sp.SwapTradeId).ToDictionary(g => g.Key, g => g.First().PosiGrossPrice); var umProvider = DataCacheProvider.GetUnderlyingDataSource(); // 需求②:平仓/行权/互换交易,审批角色应取 CloseProcess 流程的节点角色,而非 TradeProcess var closeProcessRoles = db.approvalprocess @@ -312,14 +312,14 @@ namespace YLErp.BLL tradeLinq.TradeSinglePrice = option.OpenCommission; } - // --- 新增逻辑:针对收益互换类型,用 swap_position.PosiNetPrice 覆盖展示用的期初标的价格 --- + // --- 针对收益互换类型,用 swap_position.PosiGrossPrice 覆盖展示用的期初标的价格 --- try { - if (tradeLinq.TradeType == "收益互换" && posDict.TryGetValue(tradeLinq.id, out var netPrice) && netPrice > 0) + if (tradeLinq.TradeType == "收益互换" && posDict.TryGetValue(tradeLinq.id, out var grossPrice) && grossPrice > 0) { - // 将期初价格覆盖为互换持仓的 PosiNetPrice(仅使用 PosiDirection != 0 的期初持仓) - logger.Info($"tradeOpeningProcessQuery.DAL override: tradeId={tradeLinq.id} beforeInitialSpot={tradeLinq.InitialSpotPrice} dbPosi={netPrice}"); - tradeLinq.InitialSpotPrice = Convert.ToDouble(netPrice); + // 将期初价格覆盖为互换持仓的 PosiGrossPrice(仅使用 PosiDirection != 0 的期初持仓) + logger.Info($"tradeOpeningProcessQuery.DAL override: tradeId={tradeLinq.id} beforeInitialSpot={tradeLinq.InitialSpotPrice} dbPosi={grossPrice}"); + tradeLinq.InitialSpotPrice = Convert.ToDouble(grossPrice); } } catch (Exception ex)