style(SwapModule): 格式化代码
- 在 SwapDealService.cs 中标准化了多行参数的缩进和换行 - 修复了 SwapTradeBaseService.cs 中的条件运算符周围的空格 - 统一了方法调用中参数的排列格式 - 改进了代码的可读性和一致性 - 遵循了团队的代码风格规范
This commit is contained in:
@@ -862,7 +862,9 @@ namespace YLErp.Modules.SwapModule
|
||||
var consumedInterest = position.InterestType == (int)InterestTypeEnum.复利
|
||||
? GetConsumedInterest(td.id, position.id, endDate)
|
||||
: 0m;
|
||||
interests.Add(CalcUnwindInterest(td, valueDate, endDate, positionClone, rate, floatRate, posiPrincipal, closePrincipal, newClosePercent, annualDays, preEodPosition, eventType, add, swap, orginPv, calcFirst, calcLast||newCalcLast, consumedInterest));
|
||||
interests.Add(CalcUnwindInterest(td, valueDate, endDate, positionClone, rate, floatRate, posiPrincipal,
|
||||
closePrincipal, newClosePercent, annualDays, preEodPosition, eventType, add, swap, orginPv, calcFirst,
|
||||
calcLast||newCalcLast, consumedInterest));
|
||||
}
|
||||
}
|
||||
//当日有平仓或互换记录时,避免重复结算
|
||||
@@ -1132,11 +1134,13 @@ namespace YLErp.Modules.SwapModule
|
||||
preEod.ValueDate = td.StartDate.Value;
|
||||
if (calcFirst)
|
||||
{
|
||||
preEod.ValueDate= preEod.ValueDate.AddDays(-1);
|
||||
preEod.ValueDate = preEod.ValueDate.AddDays(-1);
|
||||
}
|
||||
}
|
||||
|
||||
return InitSwapDealInterest(td, valueDate, endDate, rate, position, add, swap, posiPrincipal, closePrincipal, closePercent, annualDays, eventType, preEod, false, orginPv, calcFirst, calcLast, consumedInterest);
|
||||
return InitSwapDealInterest(td, valueDate, endDate, rate, position, add, swap, posiPrincipal,
|
||||
closePrincipal, closePercent, annualDays, eventType, preEod, false,
|
||||
orginPv, calcFirst, calcLast, consumedInterest);
|
||||
}
|
||||
/// <summary>
|
||||
/// 初始化利息腿信息
|
||||
@@ -1324,7 +1328,9 @@ namespace YLErp.Modules.SwapModule
|
||||
/// <param name="isAnnualized">是否年化</param>
|
||||
/// <param name="annualDays">年化天数</param>
|
||||
/// <returns></returns>
|
||||
public void CalcDailyCompoundInterest(DateTime endDate, swap_position position, decimal principal, swap_flow_event flowEvent, int annualDays, bool needPrice, decimal floateRate, decimal closePercent, decimal orginPv, bool calcFirst, bool calcLast, ref decimal InterestAmount, ref decimal TdInterestAmount, decimal consumedInterest = 0m, decimal resetCarryInterest = 0m)
|
||||
public void CalcDailyCompoundInterest(DateTime endDate, swap_position position, decimal principal, swap_flow_event flowEvent,
|
||||
int annualDays, bool needPrice, decimal floateRate, decimal closePercent, decimal orginPv, bool calcFirst, bool calcLast,
|
||||
ref decimal InterestAmount, ref decimal TdInterestAmount, decimal consumedInterest = 0m, decimal resetCarryInterest = 0m)
|
||||
{
|
||||
var startDate = position.PosiStartDate;
|
||||
decimal interestProfitSum = 0;
|
||||
|
||||
@@ -369,7 +369,7 @@ namespace YLErp.Modules.SwapModule
|
||||
{
|
||||
interestStart = td.StartDate.Value;
|
||||
var exerciseDate = td.ExerciseDate.Value;
|
||||
interestEnd = valueDate> exerciseDate? exerciseDate : valueDate;
|
||||
interestEnd = valueDate > exerciseDate ? exerciseDate : valueDate;
|
||||
bool calcFirst = true;
|
||||
bool calcLast = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user