refactor(swap): 优化基金公司行为处理逻辑 - finished001
- 修改 FindFundCorporateActions 方法以支持查询跨日期范围的公司行为记录 - 实现按生效日期和ID顺序稳定排序的多条公司行为记录处理 - 更新平仓时基金基线恢复逻辑以正确处理跨多个生效日的场景 - 在测试类中重写 FindFundCorporateActions 方法以支持单元测试验证 - 添加完整的跨非交易日公司行为恢复功能测试用例
This commit is contained in:
@@ -60,6 +60,20 @@ namespace YLErp.Modules.SwapModule
|
||||
&& x.UnderlyingCode == underlyingCode
|
||||
&& x.EffectiveDate == valueDate.Date);
|
||||
|
||||
protected override List<ex_dividend_info> FindFundCorporateActions(
|
||||
string underlyingCode,
|
||||
DateTime eodDate,
|
||||
DateTime valueDate)
|
||||
=> ExDividendInfos
|
||||
.Where(x => x.ValidStatus
|
||||
&& x.UnderlyingCode == underlyingCode
|
||||
&& x.EffectiveDate.HasValue
|
||||
&& x.EffectiveDate.Value.Date > eodDate.Date
|
||||
&& x.EffectiveDate.Value.Date <= valueDate.Date)
|
||||
.OrderBy(x => x.EffectiveDate)
|
||||
.ThenBy(x => x.id)
|
||||
.ToList();
|
||||
|
||||
protected override decimal GetFundCorporateActionClosePrice(
|
||||
ex_dividend_info dividendInfo,
|
||||
decimal fallbackPrice)
|
||||
|
||||
Reference in New Issue
Block a user