From cee353650702f5b1db821e711c9a2a31b9afd2d5 Mon Sep 17 00:00:00 2001
From: ssss <111@qq.com>
Date: Mon, 6 Jul 2026 13:37:03 +0800
Subject: [PATCH] =?UTF-8?q?feat(service):=20=E6=B7=BB=E5=8A=A0=E6=8C=89?=
=?UTF-8?q?=E5=9C=BA=E6=99=AFID=E6=9F=A5=E8=AF=A2Ploss=E5=92=8CQfod?=
=?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=96=B9=E6=B3=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Services/ScenarioService.cs | 29 +++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/src/WCTDataMiner.Core/Services/ScenarioService.cs b/src/WCTDataMiner.Core/Services/ScenarioService.cs
index b070ed9..4ac0b39 100644
--- a/src/WCTDataMiner.Core/Services/ScenarioService.cs
+++ b/src/WCTDataMiner.Core/Services/ScenarioService.cs
@@ -264,6 +264,35 @@ public class ScenarioService
return await query.ToListAsync();
}
+ ///
+ /// 获取指定场景的 Ploss 记录
+ ///
+ /// 场景 ID
+ /// Ploss 记录列表,按 TriggerCount (Field9) 排序
+ public async Task> GetPlossRecordsByScenarioIdAsync(Guid scenarioId)
+ {
+ return await _context.PlossRecords
+ .AsNoTracking()
+ .Where(r => r.ScenarioId == scenarioId && !r.IsDeleted)
+ .OrderBy(r => r.Field9)
+ .ToListAsync();
+ }
+
+ ///
+ /// 获取指定场景的 Qfod 记录
+ ///
+ /// 场景 ID
+ /// Qfod 记录列表,按 ChargerIndex 和 CoilIndex 排序
+ public async Task> GetQfodRecordsByScenarioIdAsync(Guid scenarioId)
+ {
+ return await _context.QfodRecords
+ .AsNoTracking()
+ .Where(r => r.ScenarioId == scenarioId && !r.IsDeleted)
+ .OrderBy(r => r.ChargerIndex)
+ .ThenBy(r => r.CoilIndex)
+ .ToListAsync();
+ }
+
///
/// 检测 SQLite 唯一约束违反错误
///