|
|
@@ -222,11 +222,14 @@ public class ExamSubjectScoreServiceImpl extends MPJBaseServiceImpl<ExamSubjectS
|
|
|
continue;
|
|
|
}
|
|
|
double totalSocre = scoreList.stream().filter(x -> StrUtil.isNotEmpty(x.getScore())).mapToDouble(x -> Float.parseFloat(x.getScore())).sum();
|
|
|
- BigDecimal bd = new BigDecimal(totalSocre);
|
|
|
- if (bd.scale() <= 0) { // 如果是整数
|
|
|
- rowData.add(bd.toBigInteger().toString());
|
|
|
- } else {
|
|
|
- rowData.add(bd.toPlainString());
|
|
|
+ if(totalSocre != 0){
|
|
|
+ BigDecimal bd = new BigDecimal(totalSocre);
|
|
|
+ bd = bd.stripTrailingZeros();
|
|
|
+ if (bd.scale() <= 0) { // 如果是整数
|
|
|
+ rowData.add(bd.toBigInteger().toString());
|
|
|
+ } else {
|
|
|
+ rowData.add(bd.toPlainString());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
Map<String, String> scoreMap = scoreList.stream().filter(x -> StrUtil.isNotEmpty(x.getScore())).collect(Collectors.toMap(ClassStudentScoreTitleVo::getCourseId, ClassStudentScoreTitleVo::getScore));
|
|
|
@@ -238,6 +241,7 @@ public class ExamSubjectScoreServiceImpl extends MPJBaseServiceImpl<ExamSubjectS
|
|
|
continue;
|
|
|
}
|
|
|
BigDecimal scorebd = new BigDecimal(score);
|
|
|
+ scorebd = scorebd.stripTrailingZeros();
|
|
|
if (scorebd.scale() <= 0) { // 如果是整数
|
|
|
rowData.add(scorebd.toBigInteger().toString());
|
|
|
} else {
|