|
|
|
@ -38,14 +38,7 @@ public class Task {
|
|
|
|
|
// 查到单个班级下所有的已经在投资报告页面提交过的学生的总成绩
|
|
|
|
|
// 算平均值,存表
|
|
|
|
|
//查出所有数据
|
|
|
|
|
PerformanceScoreExample performanceScoreExample = new PerformanceScoreExample();
|
|
|
|
|
List<PerformanceScore> performanceScores = performanceScoreMapper.selectByExample(performanceScoreExample);
|
|
|
|
|
List<String> classIdList = new ArrayList<>();
|
|
|
|
|
for (PerformanceScore performanceScore : performanceScores) {
|
|
|
|
|
//查询classID相同的所有数据
|
|
|
|
|
String classId = performanceScore.getClassId();
|
|
|
|
|
classIdList.add(classId);
|
|
|
|
|
}
|
|
|
|
|
List<String> classIdList = performanceScoreMapper.selectClassId();
|
|
|
|
|
for (String classId : classIdList) {
|
|
|
|
|
BigDecimal avgScore = BigDecimal.ZERO;
|
|
|
|
|
BigDecimal count = BigDecimal.ZERO;
|
|
|
|
@ -70,6 +63,7 @@ public class Task {
|
|
|
|
|
schoolId = score.getSchoolId();
|
|
|
|
|
//没提交报告的 算0分跳过
|
|
|
|
|
if (score.getInvestmentReportScore() == null || score.getInvestmentReportScore().equals(BigDecimal.ZERO)) {
|
|
|
|
|
classMinScore = BigDecimal.ZERO;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -102,7 +96,7 @@ public class Task {
|
|
|
|
|
Date date = Date.from(currentDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
|
|
|
|
|
teaClassScore.setSchoolId(schoolId);
|
|
|
|
|
teaClassScore.setStartTime(date);
|
|
|
|
|
System.out.println("定时任务执行的时间为=========》》:date");
|
|
|
|
|
System.out.println(new Date());
|
|
|
|
|
teaClassScore.setId(IdUtil.simpleUUID());
|
|
|
|
|
teaClassScore.setClassMaxScore(classMaxScore);
|
|
|
|
|
teaClassScore.setClassMinScore(classMinScore);
|
|
|
|
@ -125,5 +119,6 @@ public class Task {
|
|
|
|
|
teaClassScoreMapper.insert(teaClassScore);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|