代码回退

This commit is contained in:
吴方海
2026-05-11 18:38:58 +08:00
parent bdaab1dee9
commit bb95eb1396
+6 -16
View File
@@ -402,7 +402,6 @@ namespace YLErp.Modules.SwapModule
// 根据场景计算利息
if (settment)
{
calcLast = calcLast = td.trade_extend.ExtendObj.InterestCalcMode.EndsWith("1");//算尾
// 收盘归档场景,使用 CalcEodInterest
interests.Add(CalcEodInterest(td, valueDate, positionClone, rate, floatRate, closePrincipal, posiPrincipal, annualDays, calcFirst, calcLast, preEodPosition, eventType, add));
}
@@ -530,26 +529,17 @@ namespace YLErp.Modules.SwapModule
decimal tdInterestAmount = 0;
if (calcToday)
{
// 收盘自动互换场景,如果不算尾,当天是不产生利息的
if (calcLast == false && eventType == (int)SwapEventTypeEnum.)
if (position.InterestType == (int)InterestTypeEnum.)
{
interestAmount= preEod.InterestProfitSum;
tdInterestAmount = 0;
// 复利计算
CalcDailyCompoundInterestByEod(preEod, valueDate, td.StartDate.Value, position, closePrincipal, posiPrincipal, interest, annualDays, false, eodFloatRate, 1m, posiPrincipal, ref interestAmount, ref tdInterestAmount);
}
else
{
if (position.InterestType == (int)InterestTypeEnum.)
{
// 复利计算
CalcDailyCompoundInterestByEod(preEod, valueDate, td.StartDate.Value, position, closePrincipal, posiPrincipal, interest, annualDays, false, eodFloatRate, 1m, posiPrincipal, ref interestAmount, ref tdInterestAmount);
}
else
{
// 单利计算
CalcDailySimpleInterestByEod(preEod, valueDate, td.StartDate.Value, position, closePrincipal, posiPrincipal, interest, annualDays, false, eodFloatRate, 1m, posiPrincipal, ref interestAmount, ref tdInterestAmount);
}
// 单利计算
CalcDailySimpleInterestByEod(preEod, valueDate, td.StartDate.Value, position, closePrincipal, posiPrincipal, interest, annualDays, false, eodFloatRate, 1m, posiPrincipal, ref interestAmount, ref tdInterestAmount);
}
}
// 四舍五入并赋值
interest.InterestAmount = Math.Round(interestAmount, ConsGlobal.PriceRound, MidpointRounding.AwayFromZero);