| | |
| | | Integer id = item.getId(); |
| | | // 计算总积分 |
| | | int total = 0; |
| | | List<Integer> dayList = new ArrayList<>(); |
| | | // 有问有答 |
| | | List<TStudyAnswer> answerList = studyAnswerService.lambdaQuery().eq(TStudyAnswer::getStudyId, id) |
| | | .eq(TStudyAnswer::getDisabled, 0).list(); |
| | | Optional<TStudyAnswer> answerOptional = answerList.stream().findAny(); |
| | | if (answerOptional.isPresent()) { |
| | | total += answerOptional.get().getIntegral(); |
| | | for (TStudyAnswer data : answerList) { |
| | | Integer day = data.getDay(); |
| | | if (!dayList.contains(day)) { |
| | | total += data.getIntegral(); |
| | | dayList.add(day); |
| | | } |
| | | } |
| | | dayList.clear(); |
| | | // 归纳判断 |
| | | List<TStudyInduction> inductionList = studyInductionService.lambdaQuery().eq(TStudyInduction::getStudyId, id) |
| | | .eq(TStudyInduction::getDisabled, 0).list(); |
| | | Optional<TStudyInduction> inductionOptional = inductionList.stream().findAny(); |
| | | if (inductionOptional.isPresent()) { |
| | | total += inductionOptional.get().getIntegral(); |
| | | for (TStudyInduction data : inductionList) { |
| | | Integer day = data.getDay(); |
| | | if (!dayList.contains(day)) { |
| | | total += data.getIntegral(); |
| | | dayList.add(day); |
| | | } |
| | | } |
| | | dayList.clear(); |
| | | // 看图选音 |
| | | List<TStudyLook> lookList = studyLookService.lambdaQuery().eq(TStudyLook::getStudyId, id) |
| | | .eq(TStudyLook::getDisabled, 0).list(); |
| | | Optional<TStudyLook> lookOptional = lookList.stream().findAny(); |
| | | if (lookOptional.isPresent()) { |
| | | total += lookOptional.get().getIntegral(); |
| | | for (TStudyLook data : lookList) { |
| | | Integer day = data.getDay(); |
| | | if (!dayList.contains(day)) { |
| | | total += data.getIntegral(); |
| | | dayList.add(day); |
| | | } |
| | | } |
| | | dayList.clear(); |
| | | // 听音选图 |
| | | List<TStudyListen> listenList = studyListenService.lambdaQuery().eq(TStudyListen::getStudyId, id) |
| | | .eq(TStudyListen::getDisabled, 0).list(); |
| | | Optional<TStudyListen> listenOptional = listenList.stream().findAny(); |
| | | if (listenOptional.isPresent()) { |
| | | total += listenOptional.get().getIntegral(); |
| | | for (TStudyListen data : listenList) { |
| | | Integer day = data.getDay(); |
| | | if (!dayList.contains(day)) { |
| | | total += data.getIntegral(); |
| | | dayList.add(day); |
| | | } |
| | | } |
| | | dayList.clear(); |
| | | // 音图相配 |
| | | List<TStudyPair> pairList = studyPairService.lambdaQuery().eq(TStudyPair::getStudyId, id) |
| | | .eq(TStudyPair::getDisabled, 0).list(); |
| | | Optional<TStudyPair> pairOptional = pairList.stream().findAny(); |
| | | if (pairOptional.isPresent()) { |
| | | total += pairOptional.get().getIntegral(); |
| | | for (TStudyPair data : pairList) { |
| | | Integer day = data.getDay(); |
| | | if (!dayList.contains(day)) { |
| | | total += data.getIntegral(); |
| | | dayList.add(day); |
| | | } |
| | | } |
| | | dayList.clear(); |
| | | // 自主游戏 |
| | | List<TGame> gameList = gameService.lambdaQuery().eq(TGame::getStudyId, id) |
| | | .eq(TGame::getDisabled, 0).list(); |