| | |
| | | for (TStudyListen studyListen : studyListens) { |
| | | item += studyListen.getSubject().split(",").length; |
| | | } |
| | | int i = (int) ((double) (exitLearn.getTopicIds().split(",").length / item) * 100); |
| | | int i = (int) (((double) schedule / item) * 100); |
| | | if (i > userStudy.getListen()) { |
| | | userStudy.setListen(100 - i); |
| | | userStudy.setListen(i); |
| | | } |
| | | } else if (Constants.TWO.equals(type)) { |
| | | // 看图选音 |
| | | List<TStudyLook> lookList = studyLookService.pictureSelectVoice(quarter, week, day); |
| | | if (!lookList.isEmpty()) { |
| | | int item = lookList.size(); |
| | | int i = (int) ((double) (schedule / item)) * 100; |
| | | if (i > userStudy.getLook()) { |
| | | userStudy.setLook(100 - i); |
| | | } |
| | | int item = 0; |
| | | for (TStudyLook studyLook : lookList) { |
| | | item += studyLook.getSubject().split(",").length; |
| | | } |
| | | int i = (int) (((double) schedule / item) * 100); |
| | | if (i > userStudy.getLook()) { |
| | | userStudy.setLook(i); |
| | | } |
| | | } else if (Constants.THREE.equals(type)) { |
| | | // 归纳排除 |
| | | List<TStudyInduction> inductionList = studyInductionService.induceExclude(quarter, week, day); |
| | | if (!inductionList.isEmpty()) { |
| | | int item = inductionList.size(); |
| | | int i = (int) ((double) (schedule / item)) * 100; |
| | | int i = (int) (((double) schedule / item) * 100); |
| | | if (i > userStudy.getInduction()) { |
| | | userStudy.setInduction(100 - i); |
| | | userStudy.setInduction(i); |
| | | } |
| | | } |
| | | } else if (Constants.FOUR.equals(type)) { |
| | | // 有问有答 |
| | | List<TStudyAnswer> answerList = studyAnswerService.questionsAndAnswers(quarter, week, day); |
| | | if (answerList.size() % Constants.TWO == Constants.ZERO) { |
| | | int i = (int) ((double) (schedule / (answerList.size() / 2))) * 100; |
| | | int i = (int) (((double) schedule / (answerList.size() / 2)) * 100); |
| | | if (i > userStudy.getAnswer()) { |
| | | userStudy.setAnswer(100 - i); |
| | | userStudy.setAnswer(i); |
| | | } |
| | | } |
| | | } else if (Constants.FIVE.equals(type)) { |
| | | // 音图相配 |
| | | List<TStudyPair> pairList = studyPairService.pictureMateVoice(quarter, week, day); |
| | | int item = pairList.size(); |
| | | int i = (int) ((double) (schedule / item)) * 100; |
| | | int i = (int) (((double) schedule / item) * 100); |
| | | if (i > userStudy.getPair()) { |
| | | userStudy.setPair(100 - i); |
| | | userStudy.setPair(i); |
| | | } |
| | | } |
| | | } |
| | |
| | | tGameRecord.setTime(simpleDateFormat.format(tGameRecord.getCreateTime())); |
| | | } |
| | | Integer totalStudy = studyRecord.getTotalStudy(); |
| | | studyRecord.setTotalStudy(Math.round((float) (totalStudy + sum) / 3600)); |
| | | studyRecord.setTotalStudy(Math.round((float) (totalStudy) / 3600)); |
| | | // 剩余周目 |
| | | List<TStudy> studyList = studyService.lambdaQuery().eq(TStudy::getDisabled, 0) |
| | | .eq(TStudy::getType, Constants.ONE) |
| | |
| | | .eq(TGameRecord::getDisabled, 0).list(); |
| | | int sum = gameRecordList.stream().map(TGameRecord::getUseTime).mapToInt(Integer::intValue).sum(); |
| | | Integer totalStudy = studyRecord.getTotalStudy(); |
| | | studyRecord.setTotalStudy(Math.round((float) (totalStudy + sum) / 3600)); |
| | | studyRecord.setTotalStudy(Math.round((float) (totalStudy) / 3600)); |
| | | StudyRecordResultVO studyRecordResultVO = new StudyRecordResultVO(studyRecord, gameRecordList); |
| | | return R.ok(studyRecordResultVO); |
| | | } |