From 9266080356067d2e2e7e7a0fa161d3255c4e4b97 Mon Sep 17 00:00:00 2001 From: ltx <1006158920@qq.com> Date: Wed, 21 Oct 2026 13:46:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=BC=E5=AE=B9=E5=A3=B9=E8=B7=AF?= =?UTF-8?q?=E8=BF=90=E5=8A=A8=E7=AB=99=E6=9C=89=E6=95=88=E6=AC=A1=E6=95=B0?= =?UTF-8?q?=E7=9A=84=E7=BA=BF=E4=B8=8A=E5=88=97=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 线上 YL_Train.StandardCounts 为 int,QA 为 float,原实体按 double 读取导致 GetAiSportsStationList 在生产环境抛出 Int32 到 Double 的转换异常。 在列表查询投影中使用 Convert.ToDouble,使 EF 生成 CONVERT(float, [StandardCounts]),同时兼容两种数据库列类型,不修改表结构或其他接口。 验证:WebApi Release 构建通过;EF SQL 探针确认生成 CONVERT(float);QA 和生产库只读查询均成功。线上服务仍需部署本提交并重启后生效。 --- VOL.Ai/Services/AiSportsStationService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/VOL.Ai/Services/AiSportsStationService.cs b/VOL.Ai/Services/AiSportsStationService.cs index e71901d..9b03ab8 100644 --- a/VOL.Ai/Services/AiSportsStationService.cs +++ b/VOL.Ai/Services/AiSportsStationService.cs @@ -102,7 +102,8 @@ namespace VOL.Ai.Services train.StartTime, train.EndTime, train.Score, - train.StandardCounts, + // QA stores this as float, while production still uses int. + StandardCounts = Convert.ToDouble(train.StandardCounts), train.UnStandardCounts, train.TimeKeeping, train.Duration,