refactor(swap): EQD-6977 罚息标志管道——UnwindData/InterestCalcRequest/GetUnwindInterests 透传 isPenaltyInterest
新增 UnwindData.IsPenaltyInterest(bool);InterestCalcRequest 加 IsPenaltyInterest 字段+私有ctor参数+IntradayUnwind 工厂可选参(default false);GetUnwindInterests 加 isPenaltyInterest 可选参并透传 IntradayUnwind。零行为变化,现有调用方经默认值不受影响,Penalty 套件 11/11 通过。
This commit is contained in:
@@ -118,6 +118,11 @@ namespace YLErp.DBModels
|
||||
/// </summary>
|
||||
public decimal ClosePercent { get; set; }
|
||||
/// <summary>
|
||||
/// 是否计罚息(EQD-6977):提前终止平仓时利息端按持有至到期计息。默认 false=否。
|
||||
/// 由平仓页“是否罚息”下拉写入,经 GetUnwindInterests 透传至罚息接缝层。
|
||||
/// </summary>
|
||||
public bool IsPenaltyInterest { get; set; }
|
||||
/// <summary>
|
||||
/// 平仓名义本金
|
||||
/// </summary>
|
||||
public decimal CloseNotionalValue { get; set; }
|
||||
|
||||
@@ -36,19 +36,24 @@ public sealed class InterestCalcRequest
|
||||
public bool NewCalcLast { get; }
|
||||
public List<swap_flow_event> CloseList { get; }
|
||||
|
||||
/// <summary>是否计罚息(EQD-6977):利息端按持有至到期计息。由平仓页下拉经 UnwindData 透传;默认 false。</summary>
|
||||
public bool IsPenaltyInterest { get; }
|
||||
|
||||
private InterestCalcRequest(
|
||||
trade td, trade_extend tradeExtend, DateTime valueDate, DateTime unwindDate,
|
||||
List<eod_swap_position> eodPositions, List<swap_position> positions,
|
||||
decimal posiNotionalValue,
|
||||
decimal closePosiNotionalValue, decimal closePercent,
|
||||
int eventType, bool tdClose, decimal orginPv,
|
||||
bool add, bool newCalcLast, List<swap_flow_event> closeList)
|
||||
bool add, bool newCalcLast, List<swap_flow_event> closeList,
|
||||
bool isPenaltyInterest = false)
|
||||
{
|
||||
Td = td; TradeExtend = tradeExtend; ValueDate = valueDate; UnwindDate = unwindDate;
|
||||
EodPositions = eodPositions; Positions = positions;
|
||||
PosiNotionalValue = posiNotionalValue; ClosePosiNotionalValue = closePosiNotionalValue;
|
||||
ClosePercent = closePercent; EventType = eventType; TdClose = tdClose; OrginPv = orginPv;
|
||||
Add = add; NewCalcLast = newCalcLast; CloseList = closeList;
|
||||
IsPenaltyInterest = isPenaltyInterest;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -62,10 +67,11 @@ public sealed class InterestCalcRequest
|
||||
List<eod_swap_position> eodPositions, List<swap_position> positions,
|
||||
decimal preCloseNotional, decimal closedNotional, decimal closePercentRemaining,
|
||||
int eventType, bool tdClose, decimal orginPv,
|
||||
bool add, bool newCalcLast, List<swap_flow_event> closeList)
|
||||
bool add, bool newCalcLast, List<swap_flow_event> closeList,
|
||||
bool isPenaltyInterest = false)
|
||||
=> new(td, tradeExtend, valueDate, unwindDate, eodPositions, positions,
|
||||
preCloseNotional, closedNotional, closePercentRemaining,
|
||||
eventType, tdClose, orginPv, add, newCalcLast, closeList);
|
||||
eventType, tdClose, orginPv, add, newCalcLast, closeList, isPenaltyInterest);
|
||||
|
||||
/// <summary>
|
||||
/// 【EOD 当日有平仓后的收盘结息】场景(→ CalcEodPostCloseSettleInterests,settment:false 全额结息)。
|
||||
|
||||
@@ -444,7 +444,7 @@ namespace YLErp.Modules.SwapModule
|
||||
/// <param name="closePercent">平仓比例</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="ServiceException"></exception>
|
||||
public List<swap_flow_event> GetUnwindInterests(DateTime valueDate, DateTime unwindDate, int tradeId, decimal closePercent, int eventType)
|
||||
public List<swap_flow_event> GetUnwindInterests(DateTime valueDate, DateTime unwindDate, int tradeId, decimal closePercent, int eventType, bool isPenaltyInterest = false)
|
||||
{
|
||||
List<swap_flow_event> interests = new List<swap_flow_event>();
|
||||
if (closePercent > 1)
|
||||
@@ -484,7 +484,8 @@ namespace YLErp.Modules.SwapModule
|
||||
interests = GetIntradayUnwindInterests(InterestCalcRequest.IntradayUnwind(
|
||||
td, tradeExtend, valueDate, unwindDate, lastEodPositions, positions,
|
||||
stockEqvNotional, posiNotionalValue,
|
||||
closePercent, eventType, tdClose, orginPv, add: true, newCalcLast: false, closeList));
|
||||
closePercent, eventType, tdClose, orginPv, add: true, newCalcLast: false, closeList,
|
||||
isPenaltyInterest));
|
||||
return interests;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user