|
@@ -174,9 +174,12 @@ public class StudentExamResultServiceImpl extends BaseServiceImpl<Long, StudentE
|
|
|
Map<Long, List<ExamReview>> registReviewMap = examReviews.stream().collect(Collectors.groupingBy(ExamReview::getExamRegistrationId));
|
|
|
List<StudentExamResult> needUpdateStudentExamResult = new ArrayList<>();
|
|
|
for (Map.Entry<Long, List<ExamReview>> registReviewEntry : registReviewMap.entrySet()) {
|
|
|
+ List<ExamReview> reviews = registReviewEntry.getValue().stream().filter(e->Objects.nonNull(e.getEvaluationResult())).collect(Collectors.toList());
|
|
|
+ if(CollectionUtils.isEmpty(reviews)){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
StudentExamResult studentExamResult=new StudentExamResult();
|
|
|
studentExamResult.setExamRegistrationId(registReviewEntry.getKey());
|
|
|
- List<ExamReview> reviews = registReviewEntry.getValue();
|
|
|
long totalScore = reviews.stream().mapToLong(ExamReview::getEvaluationResult).sum();
|
|
|
BigDecimal avgScore = new BigDecimal(totalScore).divide(new BigDecimal(reviews.size()), 2, BigDecimal.ROUND_CEILING);
|
|
|
studentExamResult.setAvgScore(avgScore.floatValue());
|