考试信息返回接口,新增返回考试说明

ESS端 查询我的学习新增返回考试历史记录
master
xiaochanghai 1 month ago
parent e1a6abce15
commit 0cae4902a9
  1. 2
      Tiobon.Core.Model/View/Ghre/Ghre_StudyRecord.Dto.View.cs
  2. 25
      Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs
  3. 3
      Tiobon.Core.Services/Ghre/Ghre_SurveyQuestionPoolServices.cs

@ -170,6 +170,8 @@ public class Ghre_StudyRecordDto : Ghre_StudyRecord
public DateTime? ExamDate1 { get; set; }
public List<ExamGroup> Groups { get; set; } = new List<ExamGroup>();
public long? ExamRecordId { get; set; }
}

@ -186,7 +186,7 @@ public class Ghre_StudyRecordServices : BaseServices<Ghre_StudyRecord, Ghre_Stud
var courses = await Db.Queryable<Ghre_Course>().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<Ghre_StudyRecord, Ghre_Stud
entity.UpdateYN = 1;
if (entity.ExamStatus != "SystemEnd" && entity.ExamStatus.IsNotEmptyOrNull())
entity.IsViewResult = true;
#region 处理场景对应课程
if (entity.CourseSceneId.IsNotEmptyOrNull())
{
entity.CourseName = string.Join("\n", courses.Where(x => x.CourseSceneId == entity.CourseSceneId).Select(x => x.CourseName + " (" + x.CourseNo + ")"));
}
#endregion
if (entity.ExamRecordId != null)
{
var Groups = await Db.Queryable<Ghre_ExamRecordGroup>()
.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<Ghre_StudyRecordDto>(filter.pageNum, total, filter.pageSize, entitys);

@ -46,7 +46,8 @@ public class Ghre_SurveyQuestionPoolServices : BaseServices<Ghre_SurveyQuestionP
result.result.DT_TableDataT1.ForEach(async x =>
{
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()

Loading…
Cancel
Save