|
@@ -1281,15 +1281,8 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- Collections.sort(list, (o1, o2) -> {
|
|
|
|
- if (o1.getMainNumber() > o2.getMainNumber()) {
|
|
|
|
- return 1;
|
|
|
|
- } else if (o1.getSubNumber() < o2.getSubNumber()) {
|
|
|
|
- return -1;
|
|
|
|
- } else {
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ list.sort(Comparator.comparingInt(QuestionVo::getMainNumber).thenComparingInt(QuestionVo::getSubNumber));
|
|
|
|
+
|
|
for (QuestionVo vo : list) {
|
|
for (QuestionVo vo : list) {
|
|
double total = vo.getStudentCount();
|
|
double total = vo.getStudentCount();
|
|
vo.setScoreRate(Calculator.divide(vo.getScoreCount(), total, 2));
|
|
vo.setScoreRate(Calculator.divide(vo.getScoreCount(), total, 2));
|
|
@@ -1336,7 +1329,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
if (list.size() != 0 && totalCount != 0) {
|
|
if (list.size() != 0 && totalCount != 0) {
|
|
rate = Calculator.divide(count, totalCount, 2);
|
|
rate = Calculator.divide(count, totalCount, 2);
|
|
}
|
|
}
|
|
- ScoreRangeVo vo = new ScoreRangeVo(count, start, end, rate * 100);
|
|
|
|
|
|
+ ScoreRangeVo vo = new ScoreRangeVo(count, start, end, Calculator.multiply(rate, 100, 0));
|
|
return vo;
|
|
return vo;
|
|
}
|
|
}
|
|
|
|
|