From 6af7945395b1c17e4825be11c204ab269573d49b Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Sun, 27 Apr 2025 15:31:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E8=AF=95=E6=96=B0=E5=A2=9E=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E8=80=83=E8=AF=95=E7=BB=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Ghre/Ghre_ExamRecordController.cs | 11 ++++++++ Tiobon.Core.Api/Tiobon.Core.xml | 7 +++++ .../Ghre/IGhre_ExamRecordServices.cs | 2 ++ .../Ghre/Ghre_ExamRecordServices.cs | 27 +++++++++++++++++++ Tiobon.Core/Tiobon.Core.xml | 7 +++++ 5 files changed, 54 insertions(+) diff --git a/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamRecordController.cs b/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamRecordController.cs index 0e74a588..53011e54 100644 --- a/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamRecordController.cs +++ b/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamRecordController.cs @@ -280,4 +280,15 @@ public class Ghre_ExamRecordController : BaseController + /// 查询考试组 + /// + /// + /// + [HttpPost("QueryGroups/{examRecordId}")] + public async Task>> QueryGroups(long examRecordId) + { + return await _service.QueryGroups(examRecordId); + } } \ No newline at end of file diff --git a/Tiobon.Core.Api/Tiobon.Core.xml b/Tiobon.Core.Api/Tiobon.Core.xml index 6bbae7a7..51a10ad9 100644 --- a/Tiobon.Core.Api/Tiobon.Core.xml +++ b/Tiobon.Core.Api/Tiobon.Core.xml @@ -1085,6 +1085,13 @@ + + + 查询考试组 + + + + Ghre_ExamRecordDetail(Controller) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_ExamRecordServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_ExamRecordServices.cs index e5694e6d..77f94b7d 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_ExamRecordServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_ExamRecordServices.cs @@ -36,4 +36,6 @@ public interface IGhre_ExamRecordServices : IBaseServices /// Task IssueCertificate(); + + Task>> QueryGroups(long examRecordId); } \ No newline at end of file diff --git a/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs b/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs index 5078a109..2a2ac053 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs @@ -1676,4 +1676,31 @@ public class Ghre_ExamRecordServices : BaseServices>> QueryGroups(long examRecordId) + { + var Groups = await Db.Queryable() + .OrderByDescending(x => x.ExamTime) + .Where(x => x.ExamRecordId == examRecordId) + .Select(x => new + { + GroupId = x.Id, + x.ExamRecordId, + x.ExamTime, + x.Score + }).ToListAsync(); + var groups = Groups + .Select(x => new ExamGroup() + { + GroupId = x.GroupId, + ExamRecordId = x.ExamRecordId, + ExamTime = x.ExamTime.ObjToString() + (x.Score != null ? $"得分:{x.Score}" : ""), + }).ToList(); + + return ServiceResult>.OprateSuccess("成功!", groups); + } + + #endregion } \ No newline at end of file diff --git a/Tiobon.Core/Tiobon.Core.xml b/Tiobon.Core/Tiobon.Core.xml index 6bbae7a7..51a10ad9 100644 --- a/Tiobon.Core/Tiobon.Core.xml +++ b/Tiobon.Core/Tiobon.Core.xml @@ -1085,6 +1085,13 @@ + + + 查询考试组 + + + + Ghre_ExamRecordDetail(Controller)