From 9559bcffcd253075042f5edb8f4ca25e306dfca8 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Wed, 16 Apr 2025 15:04:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=80=83=E8=AF=95=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Ghre/Ghre_ExamRecordController.cs | 13 +++++++++- Tiobon.Core.Api/Tiobon.Core.xml | 8 ++++++ .../Ghre/IGhre_ExamRecordServices.cs | 2 +- .../Extend/Ghre_ExamRecordExtend.cs | 11 ++++++-- .../Ghre/Ghre_ExamRecordServices.cs | 25 +++++++++++++++++-- Tiobon.Core/Tiobon.Core.xml | 8 ++++++ 6 files changed, 61 insertions(+), 6 deletions(-) diff --git a/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamRecordController.cs b/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamRecordController.cs index 5db49a50..0e74a588 100644 --- a/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamRecordController.cs +++ b/Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamRecordController.cs @@ -58,7 +58,18 @@ public class Ghre_ExamRecordController : BaseController> ExtendAsync(long examRecordId) { - return await _service.ExtendAsync(examRecordId); + return await _service.ExtendAsync(examRecordId, null); + } + /// + /// 获取考试记录明细扩展接口 + /// + /// + /// + /// + [HttpPost("QueryExtend/{examRecordId}/{groupId}")] + public async Task> ExtendAsync(long examRecordId, long groupId) + { + return await _service.ExtendAsync(examRecordId, groupId); } /// diff --git a/Tiobon.Core.Api/Tiobon.Core.xml b/Tiobon.Core.Api/Tiobon.Core.xml index 1fcec658..3eab8aa5 100644 --- a/Tiobon.Core.Api/Tiobon.Core.xml +++ b/Tiobon.Core.Api/Tiobon.Core.xml @@ -1007,6 +1007,14 @@ + + + 获取考试记录明细扩展接口 + + + + + 提交评语接口 diff --git a/Tiobon.Core.IServices/Ghre/IGhre_ExamRecordServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_ExamRecordServices.cs index 53633113..e5694e6d 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_ExamRecordServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_ExamRecordServices.cs @@ -12,7 +12,7 @@ public interface IGhre_ExamRecordServices : IBaseServices ModifyAdjustScore(string examRecordId, EditGhre_ExamRecordInput edit); - Task> ExtendAsync(long examRecordId); + Task> ExtendAsync(long examRecordId, long? groupId); Task CommentAsync(Ghre_ExamRecordExtend extend, long examRecordId); diff --git a/Tiobon.Core.Model/ViewModels/Extend/Ghre_ExamRecordExtend.cs b/Tiobon.Core.Model/ViewModels/Extend/Ghre_ExamRecordExtend.cs index 8e0bf9ca..9e941b7e 100644 --- a/Tiobon.Core.Model/ViewModels/Extend/Ghre_ExamRecordExtend.cs +++ b/Tiobon.Core.Model/ViewModels/Extend/Ghre_ExamRecordExtend.cs @@ -104,17 +104,24 @@ public class QueryExam : DefaultGhre_ExamPaperPageData /// public bool? IsAllowView { get; set; } = true; - /// /// 是否缺考 /// public bool? IsMissExam { get; set; } = false; - /// /// 是否缺考 /// public bool? IsAllowExam { get; set; } = true; + + public List Groups { get; set; } = new List(); +} + +public class ExamGroup +{ + public long? GroupId { get; set; } + public long? ExamRecordId { get; set; } + public DateTime? ExamTime { get; set; } } public class CommentData diff --git a/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs b/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs index 0ccd033c..436917f3 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs @@ -220,7 +220,7 @@ public class Ghre_ExamRecordServices : BaseServices> ExtendAsync(long examRecordId) + public async Task> ExtendAsync(long examRecordId, long? groupId) { var extend = new Ghre_ExamRecordExtend(); var record = await QuerySingle(x => x.Id == examRecordId || x.StudyRecordId == examRecordId); @@ -830,6 +830,16 @@ public class Ghre_ExamRecordServices : BaseServices() + .OrderByDescending(x => x.ExamTime) + .Where(x => x.ExamRecordId == record.Id) + .Select(x => new ExamGroup() + { + GroupId = x.Id, + ExamRecordId = x.ExamRecordId, + ExamTime = x.ExamTime, + }).ToListAsync(); + return ServiceResult.OprateSuccess("查询成功!", extend); } @@ -922,6 +932,16 @@ public class Ghre_ExamRecordServices : BaseServices() .Where(x => x.Id == record.ExamId) .FirstAsync(x => x.Status == DIC_EXAM_STATUS.RELEASED); @@ -972,7 +992,8 @@ public class Ghre_ExamRecordServices : BaseServices x.QuestionId == answer.QuestionId).ToList(); switch (answer.QuestionType) diff --git a/Tiobon.Core/Tiobon.Core.xml b/Tiobon.Core/Tiobon.Core.xml index 1fcec658..3eab8aa5 100644 --- a/Tiobon.Core/Tiobon.Core.xml +++ b/Tiobon.Core/Tiobon.Core.xml @@ -1007,6 +1007,14 @@ + + + 获取考试记录明细扩展接口 + + + + + 提交评语接口