From 789c882448dffdca788ec000035ff95b41fe35a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=94=A6=E9=BA=9F=20=E7=8E=8B?= Date: Mon, 13 Apr 2026 14:55:57 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=94=B6=E7=9B=8A?= =?UTF-8?q?=E4=BA=92=E6=8D=A2=E6=96=B9=E5=90=91=E5=88=A4=E6=96=AD=E9=80=BB?= =?UTF-8?q?=E8=BE=91=EF=BC=8C=E7=A7=BB=E9=99=A4=E5=86=97=E4=BD=99=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TradeConfirmationGenerator.cs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/Plugins/YLErp.Plugins.GuoLian/DocumentGenerator/TradeConfirmationGenerator.cs b/Plugins/YLErp.Plugins.GuoLian/DocumentGenerator/TradeConfirmationGenerator.cs index 5fba935c..b31c7d7c 100644 --- a/Plugins/YLErp.Plugins.GuoLian/DocumentGenerator/TradeConfirmationGenerator.cs +++ b/Plugins/YLErp.Plugins.GuoLian/DocumentGenerator/TradeConfirmationGenerator.cs @@ -54,8 +54,11 @@ namespace YLErp.Plugins.GuoLian.DocumentGenerator var trade = Context.Trade; var underlying = Context.GetTradeUnderlying(); - // 判断看多/看空方向 - bool isLong = IsLongPosition(trade); + // 判断看多/看空方向(通过持仓方向判断:PositionType: 1=多头/看多,2=空头/看空) + var swapPosition = Context.GetSwapPositions(trade.id, true) + .Where(x => x.PositionType == (int)PositionTypeFlag.Long || x.PositionType == (int)PositionTypeFlag.Short) + .FirstOrDefault(); + bool isLong = swapPosition?.PositionType == (int)PositionTypeFlag.Long; // 判断标的类型(债券ETF vs 现券) bool isEtf = IsBondEtf(underlying?.UnderlyingCode ?? string.Empty); @@ -74,15 +77,6 @@ namespace YLErp.Plugins.GuoLian.DocumentGenerator return Path.Combine(GlobalConfig.PluginFolder, "App_Docs\\contract_template", templateName); } - /// - /// 判断是否为多头/看多方向 - /// - private bool IsLongPosition(OtcTradeBase trade) - { - // 通过BuySell判断:买入=看多,卖出=看空 - return trade.BuySell == "买入"; - } - /// /// 判断是否为债券ETF /// - .SH后缀且511开头 -> 债券ETF From 130cbedaba5203a5a4329f5fda77cc9541dbd09a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=94=A6=E9=BA=9F=20=E7=8E=8B?= Date: Mon, 13 Apr 2026 17:35:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E5=88=86=E9=9A=94=E7=AC=A6=E4=BB=A5=E6=8F=90=E5=8D=87=E8=B7=A8?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=85=BC=E5=AE=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DocumentGenerator/TradeConfirmationGenerator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/YLErp.Plugins.GuoLian/DocumentGenerator/TradeConfirmationGenerator.cs b/Plugins/YLErp.Plugins.GuoLian/DocumentGenerator/TradeConfirmationGenerator.cs index b31c7d7c..a91257e4 100644 --- a/Plugins/YLErp.Plugins.GuoLian/DocumentGenerator/TradeConfirmationGenerator.cs +++ b/Plugins/YLErp.Plugins.GuoLian/DocumentGenerator/TradeConfirmationGenerator.cs @@ -74,7 +74,7 @@ namespace YLErp.Plugins.GuoLian.DocumentGenerator else templateName = "国联民生-收益互换交易确认书-境内模板-【客户看空】-【债券ETF】-清洁版.docx"; - return Path.Combine(GlobalConfig.PluginFolder, "App_Docs\\contract_template", templateName); + return Path.Combine(GlobalConfig.PluginFolder, "App_Docs/contract_template", templateName); } ///