From 0cae4902a9e80e28dedda47784d90c97fb911ddd Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Wed, 21 May 2025 15:18:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E8=AF=95=E4=BF=A1=E6=81=AF=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E6=8E=A5=E5=8F=A3=EF=BC=8C=E6=96=B0=E5=A2=9E=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E8=80=83=E8=AF=95=E8=AF=B4=E6=98=8E=20ESS=E7=AB=AF=20?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=88=91=E7=9A=84=E5=AD=A6=E4=B9=A0=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E8=BF=94=E5=9B=9E=E8=80=83=E8=AF=95=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/Ghre/Ghre_StudyRecord.Dto.View.cs | 2 ++ .../Ghre/Ghre_StudyRecordServices.cs | 25 ++++++++++++++++++- .../Ghre/Ghre_SurveyQuestionPoolServices.cs | 3 ++- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/Tiobon.Core.Model/View/Ghre/Ghre_StudyRecord.Dto.View.cs b/Tiobon.Core.Model/View/Ghre/Ghre_StudyRecord.Dto.View.cs index 850e6f6a..cd242039 100644 --- a/Tiobon.Core.Model/View/Ghre/Ghre_StudyRecord.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghre/Ghre_StudyRecord.Dto.View.cs @@ -170,6 +170,8 @@ public class Ghre_StudyRecordDto : Ghre_StudyRecord public DateTime? ExamDate1 { get; set; } + public List Groups { get; set; } = new List(); + public long? ExamRecordId { get; set; } } diff --git a/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs b/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs index bf32aa19..46b8260e 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs @@ -186,7 +186,7 @@ public class Ghre_StudyRecordServices : BaseServices().Where(x => x.CourseSceneId != null && courseSceneIds.Contains(x.CourseSceneId)).ToListAsync(); - entitys.ForEach(entity => + entitys.ForEach(async entity => { if (!string.IsNullOrWhiteSpace(entity.Indate)) entity.Indate = DateTimeHelper.ConvertToDayString(entity.Indate); @@ -202,12 +202,35 @@ public class Ghre_StudyRecordServices : BaseServices x.CourseSceneId == entity.CourseSceneId).Select(x => x.CourseName + " (" + x.CourseNo + ")")); } #endregion + + if (entity.ExamRecordId != null) + { + + var Groups = await Db.Queryable() + .OrderByDescending(x => x.ExamTime) + .Where(x => x.ExamRecordId == entity.ExamRecordId) + .Select(x => new + { + GroupId = x.Id, + x.ExamRecordId, + x.ExamTime, + x.Score + }).ToListAsync(); + entity.Groups = Groups + .Select(x => new ExamGroup() + { + GroupId = x.GroupId, + ExamRecordId = x.ExamRecordId, + ExamTime = x.ExamTime.ObjToString() + (x.Score != null ? $"得分:{x.Score}" : ""), + }).ToList(); + } }); return new ServicePageResult(filter.pageNum, total, filter.pageSize, entitys); diff --git a/Tiobon.Core.Services/Ghre/Ghre_SurveyQuestionPoolServices.cs b/Tiobon.Core.Services/Ghre/Ghre_SurveyQuestionPoolServices.cs index b3c9612c..84ffc0d3 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_SurveyQuestionPoolServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_SurveyQuestionPoolServices.cs @@ -46,7 +46,8 @@ public class Ghre_SurveyQuestionPoolServices : BaseServices { x.BuiltInLabel = x.BuiltIn == 1 ? "是" : "否"; - x.QuestionType = await GetParaLabel("SurveyQuestionType", x.QuestionType); + if (filter.menuName.IsNotEmptyOrNull()) + x.QuestionType = await GetParaLabel("SurveyQuestionType", x.QuestionType); x.Options = answers.Where(o => o.SurveyQuestionPoolId == x.Id) .Select(x => new InsertGhre_SurveyOptionExtend()