|
|
|
@ -296,39 +296,34 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
|
|
|
|
|
userExample.or().andSchoolIdEqualTo(schoolId).andNameEqualTo(keyWord);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int chapterNum = sysCourseChapterMapper.selectChapterBySchoolId(schoolId);
|
|
|
|
|
List<StuUser> stuUsers = userMapper.selectByExample(userExample);
|
|
|
|
|
List<TeaTrainingInfoDTO> list = new ArrayList<>();
|
|
|
|
|
if (stuUsers.isEmpty()) {
|
|
|
|
|
return null;
|
|
|
|
|
} else {
|
|
|
|
|
for (StuUser stuUser : stuUsers) { //先查出学校下所有的用户ID,再根据USERid去实训表中查实训记录,实训记录为空就跳过,有数据就封装
|
|
|
|
|
TeaTrainingInfoDTO teaTrainingInfoDTO = new TeaTrainingInfoDTO();
|
|
|
|
|
StuClass stuClass = classMapper.selectByPrimaryKey(stuUser.getClassId());
|
|
|
|
|
//封装user表的数据
|
|
|
|
|
teaTrainingInfoDTO.setClassName(stuClass.getClassName());
|
|
|
|
|
teaTrainingInfoDTO.setStudentId(stuUser.getStudentId());
|
|
|
|
|
teaTrainingInfoDTO.setName(stuUser.getName());
|
|
|
|
|
teaTrainingInfoDTO.setUserId(stuUser.getUserid());
|
|
|
|
|
|
|
|
|
|
//看用户在实训表有没有记录
|
|
|
|
|
StuTrainingExample stuTrainingExample = new StuTrainingExample();
|
|
|
|
|
stuTrainingExample.createCriteria().andUserIdEqualTo(stuUser.getUserid());
|
|
|
|
|
List<StuTrainingWithBLOBs> stuTrainings = trainingMapper.selectByExampleWithBLOBs(stuTrainingExample);
|
|
|
|
|
|
|
|
|
|
int trainingSize = stuTrainingMapper.selectProgressFinish(stuUser.getUserid()); //已学任务数量
|
|
|
|
|
if (stuTrainings.isEmpty()) { //实训为空跳过这个用户
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
for (StuTrainingWithBLOBs stuTrainingWithBLOB : stuTrainings) {
|
|
|
|
|
if (trainingSize != 0 && chapterNum != 0) {
|
|
|
|
|
int i = trainingSize / chapterNum; //综合进度
|
|
|
|
|
teaTrainingInfoDTO.setProgress(BigDecimal.valueOf(i));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (StuTrainingWithBLOBs stuTrainingWithBLOB : stuTrainings) {
|
|
|
|
|
TeaTrainingInfoDTO teaTrainingInfoDTO = new TeaTrainingInfoDTO();
|
|
|
|
|
//封装user表的数据
|
|
|
|
|
teaTrainingInfoDTO.setClassName(stuClass.getClassName());
|
|
|
|
|
teaTrainingInfoDTO.setStudentId(stuUser.getStudentId());
|
|
|
|
|
teaTrainingInfoDTO.setName(stuUser.getName());
|
|
|
|
|
teaTrainingInfoDTO.setUserId(stuUser.getUserid());
|
|
|
|
|
//求综合得分 拿到每个已完成的章节分数
|
|
|
|
|
BigDecimal totalScore = BigDecimal.valueOf(0);
|
|
|
|
|
teaTrainingInfoDTO.setTrainingId(stuTrainingWithBLOB.getTrainingId());
|
|
|
|
|
teaTrainingInfoDTO.setProgress(stuTrainingWithBLOB.getProgress());
|
|
|
|
|
TrainingReport trainingReport = trainingReportMapper.selectByPrimaryKey(stuTrainingWithBLOB.getReportId());
|
|
|
|
|
BigDecimal reportScore = null;
|
|
|
|
|
if (trainingReport != null) {
|
|
|
|
@ -353,6 +348,7 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
|
|
|
|
|
if (learningEvalScore != null && BigDecimal.ZERO.compareTo(learningEvalScore) == 0) {
|
|
|
|
|
totalScore = totalScore.add(learningEvalScore);
|
|
|
|
|
}
|
|
|
|
|
int chapterNum = sysCourseChapterMapper.selectChapterBySchoolId(schoolId);
|
|
|
|
|
int score = totalScore.intValue() / chapterNum; //已完成的模块分数/总模块数量
|
|
|
|
|
teaTrainingInfoDTO.setTotalScore(BigDecimal.valueOf(score));
|
|
|
|
|
}
|
|
|
|
|