From 06785f798746f180f8b33a177beb77dfd383ecf7 Mon Sep 17 00:00:00 2001
From: ltx <1006158920@qq.com>
Date: Thu, 22 Oct 2026 11:32:30 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E6=81=A2=E5=A4=8D=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?=E5=8E=9F=E5=A7=8B=E7=B1=BB=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
将 YL_Train.StandardCounts 和 AiSportsStationDto.StandardCounts 从 double 恢复为 int,与原始实体定义及迁移快照保持一致。
列表查询保留显式数值转换,以适配测试库 float 和生产库 int 的列类型差异;不修改数据库表结构或数据。
验证:dotnet build VOL.WebApi/VOL.WebApi.csproj --no-restore -c Release 成功;git diff --cached --check 通过。
---
VOL.Ai/Services/AiSportsStationService.cs | 4 ++--
VOL.Entity/DomainModels/YiLu/YL_Train.cs | 2 +-
VOL.Model/Ai/Response/AiSportsStationDto.cs | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/VOL.Ai/Services/AiSportsStationService.cs b/VOL.Ai/Services/AiSportsStationService.cs
index 9b03ab8..fb64b74 100644
--- a/VOL.Ai/Services/AiSportsStationService.cs
+++ b/VOL.Ai/Services/AiSportsStationService.cs
@@ -102,8 +102,8 @@ namespace VOL.Ai.Services
train.StartTime,
train.EndTime,
train.Score,
- // QA stores this as float, while production still uses int.
- StandardCounts = Convert.ToDouble(train.StandardCounts),
+ // Cast in SQL so int and float columns both materialize as the original int type.
+ StandardCounts = Convert.ToInt32(Convert.ToDouble(train.StandardCounts)),
train.UnStandardCounts,
train.TimeKeeping,
train.Duration,
diff --git a/VOL.Entity/DomainModels/YiLu/YL_Train.cs b/VOL.Entity/DomainModels/YiLu/YL_Train.cs
index 872bffe..a4c5f1a 100644
--- a/VOL.Entity/DomainModels/YiLu/YL_Train.cs
+++ b/VOL.Entity/DomainModels/YiLu/YL_Train.cs
@@ -72,7 +72,7 @@ namespace VOL.Entity.DomainModels.YiLu
///
/// 有效个数
///
- public double StandardCounts { get; set; }
+ public int StandardCounts { get; set; }
///
/// 不合格动作数
diff --git a/VOL.Model/Ai/Response/AiSportsStationDto.cs b/VOL.Model/Ai/Response/AiSportsStationDto.cs
index bd37f8b..950b85c 100644
--- a/VOL.Model/Ai/Response/AiSportsStationDto.cs
+++ b/VOL.Model/Ai/Response/AiSportsStationDto.cs
@@ -42,7 +42,7 @@ namespace VOL.Model.Ai.Response
///
public double? Score { get; set; }
- public double StandardCounts { get; set; }
+ public int StandardCounts { get; set; }
public int UnStandardCounts { get; set; }