|
|
|
@ -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); |
|
|
|
|