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()