新增退出时机表,完成投资报告页面接口

master
xiaoCJ 1 year ago
parent 230bda7eee
commit 9312056347

@ -6,6 +6,8 @@ import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@Mapper
public interface PerformanceScoreMapper {
long countByExample(PerformanceScoreExample example);
@ -29,4 +31,7 @@ public interface PerformanceScoreMapper {
int updateByPrimaryKeySelective(PerformanceScore record);
int updateByPrimaryKey(PerformanceScore record);
@Select("select class_id from performance_score group By class_id")
List<String> selectClassId();
}

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

Loading…
Cancel
Save