From 089db91b9ae0a79cedd164da8814b970a0cee825 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=96=B9=E6=B5=B7?= Date: Mon, 16 Jun 2025 09:50:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=93=E7=AE=97=E6=8A=A5=E5=91=8A=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=B9=B3=E4=BB=93=E5=90=8D=E4=B9=89=E6=9C=AC=E9=87=91?= =?UTF-8?q?=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Abstracts/ITradeDocGeneratorContext.cs | 6 ++++++ .../DocumentGenerator/TradeSettleBillGenerator.cs | 10 ++++++++++ .../DocGenerateModule/ConfirmationGenerateContext.cs | 5 +++++ 3 files changed, 21 insertions(+) diff --git a/Framework/YLErp.Core/Plugins/TradeDocGenerator/Abstracts/ITradeDocGeneratorContext.cs b/Framework/YLErp.Core/Plugins/TradeDocGenerator/Abstracts/ITradeDocGeneratorContext.cs index c7f4ed7f..76e98cf8 100644 --- a/Framework/YLErp.Core/Plugins/TradeDocGenerator/Abstracts/ITradeDocGeneratorContext.cs +++ b/Framework/YLErp.Core/Plugins/TradeDocGenerator/Abstracts/ITradeDocGeneratorContext.cs @@ -465,5 +465,11 @@ namespace YLErp.Plugins.TradeDocGenerator.Abstracts /// /// List GetSwapFlowDeals(int tradeId); + /// + /// 根据事件id 获取事件数据 + /// + /// + /// + swap_event GetEvent(long eventId); } } diff --git a/Plugins/YLErp.Plugins.ZheShang/DocumentGenerator/TradeSettleBillGenerator.cs b/Plugins/YLErp.Plugins.ZheShang/DocumentGenerator/TradeSettleBillGenerator.cs index 0536d73d..3c775432 100644 --- a/Plugins/YLErp.Plugins.ZheShang/DocumentGenerator/TradeSettleBillGenerator.cs +++ b/Plugins/YLErp.Plugins.ZheShang/DocumentGenerator/TradeSettleBillGenerator.cs @@ -69,6 +69,16 @@ namespace YLErp.Plugins.ShanXi.DocumentGenerator decimal interestRate = unwindFlowEvents.Where(x => ConsTrade.InterestModels.Contains(x.InterestMode)).Sum(s => s.InterestRate); row.InterestRate = interestRate.ToString("0.00%"); var PosiNotionalValue = flowEventGroup.Quantity * flowEventGroup.ContractSize* posi.PosiGrossPrice; + if (flowEventGroup.EventId.HasValue) + { + var swapEvent = Context.GetEvent(flowEventGroup.EventId.Value); + if (swapEvent!=null) + { + swapEvent.unwindData=JsonHelper.Deserialize(swapEvent.EventData); + PosiNotionalValue = swapEvent.unwindData.CloseNotionalValue; + } + } + row.Quantity= flowEventGroup.Quantity.ToString("0.00"); row.PosiNotionalValue = PosiNotionalValue.ToString("0.00"); row.PosiNetPrice = (posi.PosiGrossPrice * 100).ToString("0.00000000"); diff --git a/YLErpDAL/Modules/TradeModule/DocGenerateModule/ConfirmationGenerateContext.cs b/YLErpDAL/Modules/TradeModule/DocGenerateModule/ConfirmationGenerateContext.cs index 6eb5d1f2..94bf85f4 100644 --- a/YLErpDAL/Modules/TradeModule/DocGenerateModule/ConfirmationGenerateContext.cs +++ b/YLErpDAL/Modules/TradeModule/DocGenerateModule/ConfirmationGenerateContext.cs @@ -2847,5 +2847,10 @@ namespace YLErp.Modules.TradeModule.DocGenerateModule { return DbContext.swap_flow_deal.Where(x => x.SwapTradeId == tradeId).AsNoTracking().ToList(); } + + public swap_event GetEvent(long eventId) + { + return DbContext.swap_event.FirstOrDefault(x => x.id == eventId); + } } } \ No newline at end of file