|
|
|
@ -52,7 +52,7 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
|
|
|
|
|
@Override
|
|
|
|
|
public PageInfo<TeaTrainingInfoDTO> getTrainingInfo(Integer index, Integer size, String schoolId, String keyWord, String classId) {
|
|
|
|
|
List<TeaTrainingInfoDTO> list = getTeaTrainingInfoDTOS(schoolId, keyWord, classId);
|
|
|
|
|
assert list != null;
|
|
|
|
|
assert !list.isEmpty();
|
|
|
|
|
list.sort(new TotalScoreComparator());
|
|
|
|
|
int i = 0;
|
|
|
|
|
for (TeaTrainingInfoDTO teaTrainingInfoDTO : list) {
|
|
|
|
@ -287,7 +287,6 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private List<TeaTrainingInfoDTO> getTeaTrainingInfoDTOS(String schoolId, String keyWord, String classId) {
|
|
|
|
|
StuUserExample userExample = new StuUserExample();
|
|
|
|
|
StuUserExample.Criteria criteria = userExample.createCriteria();
|
|
|
|
@ -317,7 +316,9 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
|
|
|
|
|
StuTrainingExample stuTrainingExample = new StuTrainingExample();
|
|
|
|
|
stuTrainingExample.createCriteria().andUserIdIn(new ArrayList<>(userIds));
|
|
|
|
|
List<StuTrainingWithBLOBs> stuTrainingsWithBLOBs = trainingMapper.selectByExampleWithBLOBs(stuTrainingExample);
|
|
|
|
|
|
|
|
|
|
if (stuTrainingsWithBLOBs.isEmpty()){
|
|
|
|
|
return Collections.emptyList();
|
|
|
|
|
}
|
|
|
|
|
// 实训记录按用户ID分组
|
|
|
|
|
Map<String, List<StuTrainingWithBLOBs>> userIdToTrainingsMap = stuTrainingsWithBLOBs.stream().collect(Collectors.groupingBy(StuTrainingWithBLOBs::getUserId));
|
|
|
|
|
|
|
|
|
@ -325,7 +326,6 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
|
|
|
|
|
Set<String> reportIds = stuTrainingsWithBLOBs.stream().map(StuTrainingWithBLOBs::getReportId).collect(Collectors.toSet());
|
|
|
|
|
List<TrainingReport> trainingReports = trainingReportMapper.selectByPrimaryKeys(reportIds);
|
|
|
|
|
Map<String, BigDecimal> reportIdToScoreMap = trainingReports.stream().collect(Collectors.toMap(TrainingReport::getReportId, TrainingReport::getTeacherScore));
|
|
|
|
|
|
|
|
|
|
// 获取总模块数量
|
|
|
|
|
BigDecimal chapterNum = sysCourseChapterMapper.selectChapterBySchoolId(schoolId);
|
|
|
|
|
|
|
|
|
@ -373,9 +373,6 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class TotalScoreComparator implements Comparator<TeaTrainingInfoDTO> {
|
|
|
|
|
@Override
|
|
|
|
|
public int compare(TeaTrainingInfoDTO o1, TeaTrainingInfoDTO o2) {
|
|
|
|
|