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