fix: eod_commodity_future_price 入库前以 UnderlyingCode 重派生 UnderlyingId,防止 FR007 等价格行 UnderlyingId 与 FutureContractId 失同步

- 新增 EodPriceService.SyncUnderlyingIdFromCode:入库前以 UnderlyingCode(FutureContractId) 为准反查真实 UnderlyingId,不一致则告警并自动校正
- SaveEodFuturePrice(web编辑/新增)、SettlementPriceImportService(xlsx上传)、EodSyntheticPriceSaveService(系统合成价) 写入前调用
- 根治'网页端能查到、EOD结算查不到'的失同步问题
This commit is contained in:
hjhan
2026-07-17 10:32:57 +08:00
parent f37a5b997c
commit 75988a33eb
3 changed files with 40 additions and 4 deletions
@@ -159,6 +159,9 @@ namespace YLErp.Modules.EodModule.SettlementModule
DataSource = EodPriceBase.
};
// 入库前强制 UnderlyingId 与 UnderlyingCode(FutureContractId) 一致,避免网页/结算两套 JOIN 失同步。
EodPriceService.SyncUnderlyingIdFromCode(DbContext, dto.CommodityPrice);
DbContext.eod_commodity_future_price.Add(dto.CommodityPrice);
}