diff --git a/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs b/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs index 6865b195..38004aa4 100644 --- a/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapEodPositionService.cs @@ -2611,18 +2611,13 @@ namespace YLErp.Modules.SwapModule } /// - /// 计算预付金利息。先按收取为正、支付为负转换为我方视角, - /// 再按日终本金绝对值加权平均;本金合计为零时返回零。 + /// 计算预付金利息金额。InterestIncomeSum 已是各腿利息金额, + /// 按收取为正、支付为负直接轧差求和,不做本金加权。 /// private static decimal CalculateWeightedMarginInterest(IEnumerable margins) { - var marginList = margins.ToList(); - var totalWeight = marginList.Sum(x => Math.Abs(x.InterestPrincipalFix)); - return totalWeight == 0 - ? 0 - : marginList.Sum(x => x.InterestIncomeSum - * (x.InterestDirection == (int)SwapDirectionEnum.收取 ? 1 : -1) - * Math.Abs(x.InterestPrincipalFix)) / totalWeight; + return margins.Sum(x => + x.InterestIncomeSum * (x.InterestDirection == (int)SwapDirectionEnum.收取 ? 1 : -1)); } /// /// 将数据库中以公司/交易簿记方向保存的日终字段转换为客户视角。