|
@@ -221,15 +221,18 @@ public class ExamSubjectScoreServiceImpl extends MPJBaseServiceImpl<ExamSubjectS
|
|
|
sortCode ++;
|
|
sortCode ++;
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
- double totalSocre = scoreList.stream().filter(x -> StrUtil.isNotEmpty(x.getScore())).mapToDouble(x -> Float.parseFloat(x.getScore())).sum();
|
|
|
|
|
- if(totalSocre != 0){
|
|
|
|
|
- BigDecimal bd = new BigDecimal(totalSocre);
|
|
|
|
|
- bd = bd.stripTrailingZeros();
|
|
|
|
|
- if (bd.scale() <= 0) { // 如果是整数
|
|
|
|
|
- rowData.add(bd.toBigInteger().toString());
|
|
|
|
|
|
|
+ BigDecimal reduce = scoreList.stream().filter(x -> StrUtil.isNotEmpty(x.getScore())).map(x -> new BigDecimal(x.getScore())).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|
+ BigDecimal totalSocre = reduce
|
|
|
|
|
+ .setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
+ if(!totalSocre.equals(BigDecimal.ZERO)){
|
|
|
|
|
+ totalSocre = totalSocre.stripTrailingZeros();
|
|
|
|
|
+ if (totalSocre.scale() <= 0) { // 如果是整数
|
|
|
|
|
+ rowData.add(totalSocre.toBigInteger().toString());
|
|
|
} else {
|
|
} else {
|
|
|
- rowData.add(bd.toPlainString());
|
|
|
|
|
|
|
+ rowData.add(totalSocre.toPlainString());
|
|
|
}
|
|
}
|
|
|
|
|
+ }else{
|
|
|
|
|
+ rowData.add("");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Map<String, String> scoreMap = scoreList.stream().filter(x -> StrUtil.isNotEmpty(x.getScore())).collect(Collectors.toMap(ClassStudentScoreTitleVo::getCourseId, ClassStudentScoreTitleVo::getScore));
|
|
Map<String, String> scoreMap = scoreList.stream().filter(x -> StrUtil.isNotEmpty(x.getScore())).collect(Collectors.toMap(ClassStudentScoreTitleVo::getCourseId, ClassStudentScoreTitleVo::getScore));
|