|
|
|
@ -113,52 +113,53 @@ public class TeaGradeManageServiceImpl implements ITeaGradeManageService {
|
|
|
|
|
} else {
|
|
|
|
|
teaExaminationDetailsDto.setExamActualNum(stuStudentExamWithBLOBs.size()); //否则为集合的长度
|
|
|
|
|
for (StuStudentExamWithBLOBs stuStudentExamWithBLOB : stuStudentExamWithBLOBs) { //不为就求分数
|
|
|
|
|
BigDecimal score = stuStudentExamWithBLOB.getTotalScore();
|
|
|
|
|
int passThreshold = 60; // 60是及格分数
|
|
|
|
|
int totalStudents = stuStudentExamWithBLOBs.size();
|
|
|
|
|
int totalScore = 0;
|
|
|
|
|
totalScore += score.intValue();
|
|
|
|
|
|
|
|
|
|
if (score.intValue() >= passThreshold) {
|
|
|
|
|
passNum++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 更新最高分和最低分
|
|
|
|
|
if (score.intValue() > topScore) {
|
|
|
|
|
topScore = score.intValue();
|
|
|
|
|
}
|
|
|
|
|
if (score.intValue() < lowScore) {
|
|
|
|
|
lowScore = score.intValue();
|
|
|
|
|
if (stuStudentExamWithBLOB.getTotalScore()==null){
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
BigDecimal score = stuStudentExamWithBLOB.getTotalScore();
|
|
|
|
|
int passThreshold = 60; // 60是及格分数
|
|
|
|
|
int totalStudents = stuStudentExamWithBLOBs.size();
|
|
|
|
|
int totalScore = 0;
|
|
|
|
|
totalScore += score.intValue();
|
|
|
|
|
if (score.intValue() >= passThreshold) {
|
|
|
|
|
passNum++;
|
|
|
|
|
}
|
|
|
|
|
// 更新最高分和最低分
|
|
|
|
|
if (score.intValue() > topScore) {
|
|
|
|
|
topScore = score.intValue();
|
|
|
|
|
}
|
|
|
|
|
if (score.intValue() < lowScore) {
|
|
|
|
|
lowScore = score.intValue();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 更新不同成绩等级的学生人数
|
|
|
|
|
if (score.intValue() >= 90) {
|
|
|
|
|
excellentNum++;
|
|
|
|
|
} else if (score.intValue() >= 80) {
|
|
|
|
|
goodNum++;
|
|
|
|
|
} else if (score.intValue() >= 60) {
|
|
|
|
|
generalNum++;
|
|
|
|
|
} else {
|
|
|
|
|
failNumber++;
|
|
|
|
|
}
|
|
|
|
|
// 更新不同成绩等级的学生人数
|
|
|
|
|
if (score.intValue() >= 90) {
|
|
|
|
|
excellentNum++;
|
|
|
|
|
} else if (score.intValue() >= 80) {
|
|
|
|
|
goodNum++;
|
|
|
|
|
} else if (score.intValue() >= 60) {
|
|
|
|
|
generalNum++;
|
|
|
|
|
} else {
|
|
|
|
|
failNumber++;
|
|
|
|
|
}
|
|
|
|
|
// 计算平均分
|
|
|
|
|
if (totalStudents > 0) {
|
|
|
|
|
avgScore = totalScore / totalStudents;
|
|
|
|
|
}
|
|
|
|
|
if (totalStudents > 0) {
|
|
|
|
|
avgScore = totalScore / totalStudents;
|
|
|
|
|
}
|
|
|
|
|
// 将计算出的值设置到 TeaExaminationDetailsDto 对象中
|
|
|
|
|
teaExaminationDetailsDto.setExamPassNum(passNum);
|
|
|
|
|
teaExaminationDetailsDto.setTopScore(topScore);
|
|
|
|
|
teaExaminationDetailsDto.setLossScore(lowScore);
|
|
|
|
|
teaExaminationDetailsDto.setAverageScore(avgScore);
|
|
|
|
|
teaExaminationDetailsDto.setExcellentNumber(excellentNum);
|
|
|
|
|
teaExaminationDetailsDto.setGoodNumber(goodNum);
|
|
|
|
|
teaExaminationDetailsDto.setGeneralNum(generalNum);
|
|
|
|
|
teaExaminationDetailsDto.setFailingNumber(failNumber);
|
|
|
|
|
teaExaminationDetailsDto.setCaseName(""); //todo 补充 暂时没有
|
|
|
|
|
teaExaminationDetailsDto.setExamPassNum(passNum);
|
|
|
|
|
teaExaminationDetailsDto.setTopScore(topScore);
|
|
|
|
|
teaExaminationDetailsDto.setLossScore(lowScore);
|
|
|
|
|
teaExaminationDetailsDto.setAverageScore(avgScore);
|
|
|
|
|
teaExaminationDetailsDto.setExcellentNumber(excellentNum);
|
|
|
|
|
teaExaminationDetailsDto.setGoodNumber(goodNum);
|
|
|
|
|
teaExaminationDetailsDto.setGeneralNum(generalNum);
|
|
|
|
|
teaExaminationDetailsDto.setFailingNumber(failNumber);
|
|
|
|
|
teaExaminationDetailsDto.setCaseName(""); //todo 补充 暂时没有
|
|
|
|
|
|
|
|
|
|
// 返回填充好数值的 teaExaminationDetailsDto 对象
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return teaExaminationDetailsDto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|