diff --git a/Framework/YLErp.Core/DBModels/EodSwapPositionResponse.cs b/Framework/YLErp.Core/DBModels/EodSwapPositionResponse.cs index dfb643cd..18533989 100644 --- a/Framework/YLErp.Core/DBModels/EodSwapPositionResponse.cs +++ b/Framework/YLErp.Core/DBModels/EodSwapPositionResponse.cs @@ -37,7 +37,7 @@ namespace YLErp.DBModels /// public decimal PeriodAmount { get; set; } - public decimal InitYtm { get; set; } + public decimal? InitYtm { get; set; } /// /// 期限 /// diff --git a/Framework/YLErp.Core/DBModels/SwapFlowEvent.cs b/Framework/YLErp.Core/DBModels/SwapFlowEvent.cs index 305568af..c4c9e6df 100644 --- a/Framework/YLErp.Core/DBModels/SwapFlowEvent.cs +++ b/Framework/YLErp.Core/DBModels/SwapFlowEvent.cs @@ -388,7 +388,7 @@ namespace YLErp.DBModels /// 成交收益率 /// [NotMapped] - public decimal InitYtm { get; set; } + public decimal? InitYtm { get; set; } } } diff --git a/Framework/YLErp.Core/DBModels/SwapPosition.cs b/Framework/YLErp.Core/DBModels/SwapPosition.cs index f9e1a8a8..bcc18c36 100644 --- a/Framework/YLErp.Core/DBModels/SwapPosition.cs +++ b/Framework/YLErp.Core/DBModels/SwapPosition.cs @@ -232,7 +232,7 @@ namespace YLErp.DBModels /// /// 期初收益率 /// - public decimal InitYtm { get; set; } + public decimal? InitYtm { get; set; } /// /// 是否无效 /// diff --git a/YLErpDAL/Model/ClientSwapPositionRequest.cs b/YLErpDAL/Model/ClientSwapPositionRequest.cs index 77c98722..c4883a06 100644 --- a/YLErpDAL/Model/ClientSwapPositionRequest.cs +++ b/YLErpDAL/Model/ClientSwapPositionRequest.cs @@ -45,7 +45,7 @@ namespace YLErp.Model /// public decimal TradingFee { get; set; } - public decimal InitYtm { get; set; } + public decimal? InitYtm { get; set; } /// /// 净额结算金额 互换持仓价值+待返还的预付金本金 diff --git a/YLErpDAL/Model/SwapFlowEventExportModel.cs b/YLErpDAL/Model/SwapFlowEventExportModel.cs index 901ff943..d710bf22 100644 --- a/YLErpDAL/Model/SwapFlowEventExportModel.cs +++ b/YLErpDAL/Model/SwapFlowEventExportModel.cs @@ -98,5 +98,7 @@ namespace YLErp.Model public string DividendIn { get; set; } public string OptLog { get; set; } + + public decimal? InitYtm { get; set; } } } diff --git a/YLErpDAL/Model/Trade.cs b/YLErpDAL/Model/Trade.cs index d0ae332e..98e5ada5 100644 --- a/YLErpDAL/Model/Trade.cs +++ b/YLErpDAL/Model/Trade.cs @@ -336,7 +336,7 @@ namespace YLErp.DBModels public double DividendRatio { get; internal set; } [DisplayName("簿记后生成的成交收益率")] - public decimal InitYtm { get; set; } + public decimal? InitYtm { get; set; } public string GetDataTraceKeyInfo() { diff --git a/YLErpDAL/Modules/SwapModule/SwapFlowEventService.cs b/YLErpDAL/Modules/SwapModule/SwapFlowEventService.cs index ceba0abc..3bad869c 100644 --- a/YLErpDAL/Modules/SwapModule/SwapFlowEventService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapFlowEventService.cs @@ -502,7 +502,7 @@ namespace YLErp.Modules.SwapModule var tds= retListResult.rows.Select(x => x.FlowEvent.SwapTradeId).Distinct().ToList(); var posiList = DbContext.swap_position.Where(s => !s.Invalid && s.IsInitial && tds.Contains(s.SwapTradeId) && !string.IsNullOrEmpty(s.FloatRateUnderlyingCode)).ToList(); // 查询成交收益率 - Dictionary ytmMap = DbContext.trade.AsNoTracking().Where(p => tds.Contains(p.id)).ToList().ToDictionary(t => t.id, t => t.InitYtm); + Dictionary ytmMap = DbContext.trade.AsNoTracking().Where(p => tds.Contains(p.id)).ToList().ToDictionary(t => t.id, t => t.InitYtm); foreach (var item in retListResult.rows) { item.FlowEvent.DividendPending = -item.FlowEvent.DividendPending; diff --git a/YLErpDAL/Modules/SwapModule/SwapFlowService.cs b/YLErpDAL/Modules/SwapModule/SwapFlowService.cs index 3657f104..24ed1178 100644 --- a/YLErpDAL/Modules/SwapModule/SwapFlowService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapFlowService.cs @@ -282,7 +282,7 @@ namespace YLErp.Modules.SwapModule } var retListResult = eventQuery.ToSearchList(req); List extendList = null; - Dictionary ytmMap = new Dictionary(); + Dictionary ytmMap = new Dictionary(); if (retListResult != null && retListResult.rows != null && retListResult.rows.Any()) { var tradeIds = retListResult.rows.Where(p => p.PayDate == null || p.EventType != (int)SwapEventTypeEnum.平仓).Select(p => p.SwapTradeId).Distinct().ToList(); @@ -381,6 +381,7 @@ namespace YLErp.Modules.SwapModule exportModel.MarkClosePnl = item.MarkClosePnl.OtcFormatMoney(false, 4); exportModel.DividendIn = item.DividendIn.OtcFormatMoney(false, 4); exportModel.OptLog = item.OptLog; + exportModel.InitYtm = item.InitYtm; list.Add(exportModel); } var tplFilePath = OtcAppContext.MapPath("/App_Docs"); diff --git a/YLErpDAL/Modules/SwapModule/SwapTradeService.cs b/YLErpDAL/Modules/SwapModule/SwapTradeService.cs index b04c8b49..962cec7a 100644 --- a/YLErpDAL/Modules/SwapModule/SwapTradeService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapTradeService.cs @@ -386,7 +386,7 @@ namespace YLErp.Modules.SwapModule OptId = UserInfo.UserId, OptName = UserInfo.UserName, UnderlyingInstrumentType = underlying.UnderlyingInstrumentType, - InitYtm = flowMerge.InitYtm ?? 0 + InitYtm = flowMerge.InitYtm }; td.swap_positions.Add(floatPosition); swap_position interestPosition = new swap_position() @@ -579,7 +579,7 @@ namespace YLErp.Modules.SwapModule dbTrade.trade_extend = req.trade_extend; dbTrade.swap_positions = req.swap_positions; dbTrade.MetaDic = req.MetaDic; - dbTrade.InitYtm = req.swap_positions.FirstOrDefault(p => p.InitYtm > 0)?.InitYtm ?? 0m; + dbTrade.InitYtm = req.swap_positions.FirstOrDefault(p => p.InitYtm != null)?.InitYtm; InnerSaveTrade(false, dbTrade, changsStr, changeConfirmStatus); return dbTrade; diff --git a/YLErpWeb/App_Docs/导出模板/互换开平仓事件流水导出模板.xlsx b/YLErpWeb/App_Docs/导出模板/互换开平仓事件流水导出模板.xlsx index ea91fe5b..aacc08b6 100644 Binary files a/YLErpWeb/App_Docs/导出模板/互换开平仓事件流水导出模板.xlsx and b/YLErpWeb/App_Docs/导出模板/互换开平仓事件流水导出模板.xlsx differ diff --git a/YLErpWeb/wwwroot/Scripts/app/swaptrade/eventlist.js b/YLErpWeb/wwwroot/Scripts/app/swaptrade/eventlist.js index 1838596e..e9f8f6b7 100644 --- a/YLErpWeb/wwwroot/Scripts/app/swaptrade/eventlist.js +++ b/YLErpWeb/wwwroot/Scripts/app/swaptrade/eventlist.js @@ -194,9 +194,13 @@ var getColModelGrid = function () { label: '成交收益率', width: 90, align: 'center', - formatter: otcformat.trading.premiumRateP - }, - { + formatter: function (cellValue, options, rowObject) { + if (cellValue == null) { + return ""; + } + return otcformat.trading.premiumRateP(cellValue); + } + }, { name: 'TradingAmountNetFeeAvg', label: '成交净价(含费)', width: 90,