feat(settlement): 添加标的类型判断逻辑支持价格表分流

- 在ConsGlobal中为所有标的类型常量添加中文注释说明
- 新增UseStockPriceTable方法用于判断标的类型是否使用股票价格表
- 修改SettlementPriceImportService中的价格表分流逻辑
- 添加单元测试验证股指期货、基金等进入股票价格表的逻辑
- 确保Shibor、利率收益率和债券指数进入正确的商品期货价格表
This commit is contained in:
张名锐
2026-07-31 16:57:49 +08:00
parent a507d0ce66
commit 2eba4ce2a9
3 changed files with 49 additions and 28 deletions
@@ -14,6 +14,12 @@ namespace YLErp.Modules.EodModule
}
public static bool UseStockPriceTable(string instrumentType)
{
return ConsGlobal.InstrumentType.EquityTypes().Contains(instrumentType)
|| instrumentType == ConsGlobal.InstrumentType.Fund;
}
/// <summary>
/// 导入xlsx数据
/// </summary>
@@ -134,7 +140,7 @@ namespace YLErp.Modules.EodModule
EodPriceService.StampBondOperator(eodPrice, UserId, eodPrice.id == 0);
result.SuccessCount++;
}
else if (!underlying.CalcTypeIsStock())
else if (!UseStockPriceTable(underlying.UnderlyingInstrumentType))
{
var eodPrice = DbContext.eod_commodity_future_price
.FirstOrDefault(p => p.ValueDate == item.date && p.UnderlyingCode == underlying.UnderlyingCode);