|
|
|
@ -148,7 +148,16 @@ public class TeaGradeManageController {
|
|
|
|
|
@RequestParam(required = false) String classId,
|
|
|
|
|
@RequestParam(required = false) String examManageId) {
|
|
|
|
|
List<TeaExamAndUserDto> list = getTeaExamAndUserDtos(schoolId, keyWord, classId, examManageId);
|
|
|
|
|
list.sort(new TeaGradeManageServiceImpl.StuUserDtoComparator()); //比较器按得分排序
|
|
|
|
|
// 先对列表按照 totalScore 进行降序排序
|
|
|
|
|
list.sort((a, b) -> {
|
|
|
|
|
BigDecimal scoreA = Optional.ofNullable(a.getTotalScore()).orElse(BigDecimal.ZERO);
|
|
|
|
|
BigDecimal scoreB = Optional.ofNullable(b.getTotalScore()).orElse(BigDecimal.ZERO);
|
|
|
|
|
return scoreB.compareTo(scoreA);
|
|
|
|
|
});
|
|
|
|
|
// 遍历排序后的列表,给每个对象设置 scoreRank 字段
|
|
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
|
|
list.get(i).setScoreRank(i + 1); // 排名从1开始
|
|
|
|
|
}
|
|
|
|
|
PageInfo<TeaExamAndUserDto> pageInfo = PageUtil.pageHelper(list, index, size);
|
|
|
|
|
return new ResultEntity<>(pageInfo);
|
|
|
|
|
}
|
|
|
|
@ -162,7 +171,7 @@ public class TeaGradeManageController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// @GetMapping("/exportExam")
|
|
|
|
|
// @GetMapping("/exportExam")
|
|
|
|
|
// @ApiOperation("考试模式--页面单个考试导出")
|
|
|
|
|
public void exportExam() {
|
|
|
|
|
//TODO 待写 页面单个考试导出
|
|
|
|
@ -315,6 +324,8 @@ public class TeaGradeManageController {
|
|
|
|
|
StuUserExample.Criteria stuUserCriteria = stuUserExample.createCriteria();
|
|
|
|
|
StuUserExample.Criteria stuUserCriteria1 = stuUserExample.createCriteria();
|
|
|
|
|
stuUserCriteria.andSchoolIdEqualTo(schoolId);
|
|
|
|
|
stuUserCriteria.andRoleIdEqualTo(4);
|
|
|
|
|
stuUserCriteria1.andRoleIdEqualTo(4);
|
|
|
|
|
stuUserCriteria1.andSchoolIdEqualTo(schoolId);
|
|
|
|
|
List<TeaExamAndUserDto> list = new ArrayList();
|
|
|
|
|
if (StringUtils.isNotBlank(keyWord)) {
|
|
|
|
@ -341,11 +352,22 @@ public class TeaGradeManageController {
|
|
|
|
|
if (StringUtils.isNotBlank(examManageId)) {
|
|
|
|
|
studentExamCriteria.andExamManageIdEqualTo(examManageId);
|
|
|
|
|
}
|
|
|
|
|
List<StuStudentExam> stuStudentExams = studentExamMapper.selectByExample(studentExamExample);
|
|
|
|
|
for (StuStudentExam stuStudentExam : stuStudentExams) {
|
|
|
|
|
teaExamAndUserDto.setObjectiveScore(stuStudentExam.getObjectiveScore());
|
|
|
|
|
teaExamAndUserDto.setCaseScore(stuStudentExam.getCaseScore());
|
|
|
|
|
teaExamAndUserDto.setTotalScore(stuStudentExam.getTotalScore());
|
|
|
|
|
StuStudentExamExample example = new StuStudentExamExample();
|
|
|
|
|
example.createCriteria().andUseridEqualTo(userid).andExamManageIdEqualTo(examManageId);
|
|
|
|
|
List<StuStudentExamWithBLOBs> stuStudentExams = studentExamMapper.selectByExampleWithBLOBs(example);
|
|
|
|
|
if (!stuStudentExams.isEmpty()) {
|
|
|
|
|
StuStudentExamWithBLOBs stuStudentExam = stuStudentExams.get(0);
|
|
|
|
|
if (stuStudentExam != null) {
|
|
|
|
|
if (stuStudentExam.getObjectiveScore() != null) {
|
|
|
|
|
teaExamAndUserDto.setObjectiveScore(stuStudentExam.getObjectiveScore());
|
|
|
|
|
}
|
|
|
|
|
if (stuStudentExam.getCaseScore() != null) {
|
|
|
|
|
teaExamAndUserDto.setCaseScore(stuStudentExam.getCaseScore());
|
|
|
|
|
}
|
|
|
|
|
if (stuStudentExam.getTotalScore() != null) {
|
|
|
|
|
teaExamAndUserDto.setTotalScore(stuStudentExam.getTotalScore());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
list.add(teaExamAndUserDto);
|
|
|
|
|
}
|
|
|
|
|