diff --git a/YD_YiLu/Services/Impl/DeviceSyncService.cs b/YD_YiLu/Services/Impl/DeviceSyncService.cs index ea4f9f7..04b76a8 100644 --- a/YD_YiLu/Services/Impl/DeviceSyncService.cs +++ b/YD_YiLu/Services/Impl/DeviceSyncService.cs @@ -198,8 +198,12 @@ namespace YD_YiLu.Api.Services.Impl var item = normalized.Item; // 👉 3. 唯一校验(跳过已存在) - //if (!seenSerials.Add(normalized.TrainSerial)) - // continue; + if (!seenSerials.Add(normalized.TrainSerial)) + continue; + + var score = CalculateScore(item); + if (!score.HasValue || score.Value <= 0) + continue; var entity = new YL_Train { @@ -226,7 +230,7 @@ namespace YD_YiLu.Api.Services.Impl EndTime = Util.ParseDateTime(item.EndTime), // 👉 成绩计算(建议统一规则) - Score = CalculateScore(item), + Score = score, IsValid = 1, // 默认有效 UploadTime = DateTime.Now,