From 776cc5d9c3beb82359d83e99fac344e3574e5468 Mon Sep 17 00:00:00 2001 From: hjhan Date: Thu, 12 Feb 2026 17:19:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(swap):=20=E4=BF=AE=E5=A4=8DSwapEodPositionS?= =?UTF-8?q?ervice=E4=BA=92=E6=8D=A2=E6=8C=81=E4=BB=93=E4=BB=B7=E5=80=BC?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E9=80=BB=E8=BE=91=20=E5=88=A9=E6=81=AF?= =?UTF-8?q?=E8=80=83=E8=99=91=E6=96=B9=E5=90=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除了未使用的命名空间引用 - 修正利息模式判断条件,将小于号改为大于号 - 更新持仓价值计算公式,对利息利润乘以比例系数 - 统一多处持仓价值计算逻辑的修改 --- .../SwapModule/SwapEodPositionService.cs | 33 +++---------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs b/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs index e5eb3ec2..8ec9b84d 100644 --- a/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs @@ -1,24 +1,6 @@ using BaseOUDAL; -using ClosedXML.Report.Utils; -using CsvHelper; -using DocumentFormat.OpenXml.Spreadsheet; -using MathNet.Numerics.LinearAlgebra.Factorization; -using MoreLinq; using Newtonsoft.Json; -using NPOI.POIFS.NIO; -using NPOI.SS.Formula.Functions; -using NPOI.SS.UserModel; -using Org.BouncyCastle.Asn1.Cmp; -using Org.BouncyCastle.Math.EC.Multiplier; -using Org.BouncyCastle.Ocsp; -using Qdp.Pricing.Library.Common.Products.Abs; -using System; -using System.Collections.Generic; -using System.Linq; using System.Linq.Expressions; -using System.Security.Cryptography.Xml; -using YLErp.BLL; -using YLErp.DBModels; using YLErp.DBModels.Consts; using YLErp.DBModels.Enums; using YLErp.Model; @@ -26,12 +8,7 @@ using YLErp.Model.Enum; using YLErp.Models; using YLErp.Modules.DataProviderModule; using YLErp.Modules.EodModule; -using YLErp.Modules.ReportModule; -using YLErp.Modules.TradeModule; using YLErp.QdpModule; -using static alglib; -using static YLErp.ConsGlobal; -using static YLErp.DBModels.ConsTrade; namespace YLErp.Modules.SwapModule { @@ -234,7 +211,7 @@ namespace YLErp.Modules.SwapModule var hasSwap = flowEvents.Any(x => x.EventType == (int)SwapEventTypeEnum.互换); foreach (var interest in interestList) { - if (interest.InterestMode == (int)InterestModeEnum.追加预付金 && interest.HappenDate < settleDate) + if (interest.InterestMode == (int)InterestModeEnum.追加预付金 && interest.HappenDate > settleDate) { continue; } @@ -651,7 +628,7 @@ namespace YLErp.Modules.SwapModule newEodPayPosition.InterestFeeSum = eodPayPosition.InterestFeeSum + newEodPayPosition.TdInterestFee - newEodPayPosition.TdCloseInterestFee; newEodPayPosition.InterestProfitSum = newEodPayPosition.InterestIncomeSum + newEodPayPosition.InterestFeeSum; //持仓价值 - newEodPayPosition.SwapPositionValue = newEodPayPosition.InterestProfitSum + newEodPayPosition.PosiProfitSum; + newEodPayPosition.SwapPositionValue = newEodPayPosition.InterestProfitSum * ratio + newEodPayPosition.PosiProfitSum; //累计已实现 newEodPayPosition.RealizedInterest = eodPayPosition.RealizedInterest + newEodPayPosition.TdCloseInterest * ratio; @@ -750,7 +727,7 @@ namespace YLErp.Modules.SwapModule newEodPayPosition.InterestFeeSum = eodPayPosition.InterestFeeSum + newEodPayPosition.TdInterestFee - newEodPayPosition.TdCloseInterestFee; newEodPayPosition.InterestProfitSum = newEodPayPosition.InterestIncomeSum + newEodPayPosition.InterestFeeSum; //持仓价值 - newEodPayPosition.SwapPositionValue = newEodPayPosition.InterestProfitSum + newEodPayPosition.PosiProfitSum; + newEodPayPosition.SwapPositionValue = newEodPayPosition.InterestProfitSum * ratio + newEodPayPosition.PosiProfitSum; //累计已实现 newEodPayPosition.RealizedInterest = eodPayPosition.RealizedInterest + newEodPayPosition.TdCloseInterest * ratio; @@ -873,7 +850,7 @@ namespace YLErp.Modules.SwapModule newEodPayPosition.InterestFeeSum = eodPayPosition.InterestFeeSum + newEodPayPosition.TdInterestFee - newEodPayPosition.TdCloseInterestFee; newEodPayPosition.InterestProfitSum = newEodPayPosition.InterestIncomeSum + newEodPayPosition.InterestFeeSum; //持仓价值 - newEodPayPosition.SwapPositionValue = newEodPayPosition.InterestProfitSum + newEodPayPosition.PosiProfitSum; + newEodPayPosition.SwapPositionValue = newEodPayPosition.InterestProfitSum * ratio + newEodPayPosition.PosiProfitSum; //累计已实现 newEodPayPosition.RealizedInterest = eodPayPosition.RealizedInterest + newEodPayPosition.TdCloseInterest; @@ -990,7 +967,7 @@ namespace YLErp.Modules.SwapModule newEodPayPosition.InterestFeeSum = eodPayPosition.InterestFeeSum + newEodPayPosition.TdInterestFee - newEodPayPosition.TdCloseInterestFee; newEodPayPosition.InterestProfitSum = newEodPayPosition.InterestIncomeSum + newEodPayPosition.InterestFeeSum; //持仓价值 - newEodPayPosition.SwapPositionValue = newEodPayPosition.InterestProfitSum + newEodPayPosition.PosiProfitSum; + newEodPayPosition.SwapPositionValue = newEodPayPosition.InterestProfitSum * ratio + newEodPayPosition.PosiProfitSum; //累计已实现 newEodPayPosition.RealizedInterest = eodPayPosition.RealizedInterest + newEodPayPosition.TdCloseInterest * ratio;