| | |
| | | // 游戏难度 |
| | | GAME_DIFFICULTY_MAP.put(Constants.ZERO, Constants.ONE); |
| | | GAME_DIFFICULTY_MAP.put(Constants.ONE, Constants.TWO); |
| | | GAME_DIFFICULTY_MAP.put(Constants.TWO, Constants.ZERO); |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | userStudyRecord.setAnswer(Constants.ONE_HUNDRED); |
| | | userStudyRecord.setPair(Constants.BURDEN_ONE); |
| | | } else if (Constants.FIVE.equals(type)) { |
| | | userStudyRecord.setPair(Constants.ONE_HUNDRED); |
| | | // type为5并且day为5应该进入游戏日 |
| | | Integer nextDay = DAY_MAP.get(String.valueOf(userStudyRecord.getDay())); |
| | | userStudyRecord.setDay(nextDay); |
| | | // type为5并且day为5应该进入游戏日 |
| | | if (Constants.FIVE.equals(completeStudy.getDay())) { |
| | | userStudyRecord.setPair(Constants.ONE_HUNDRED); |
| | | // 游戏难度初始化 0(入门难度) |
| | | userStudyRecord.setGameDifficulty(Constants.ZERO); |
| | | } else { |
| | | userStudyRecord.setListen(Constants.BURDEN_ONE); |
| | | userStudyRecord.setLook(Constants.BURDEN_ONE); |
| | | userStudyRecord.setInduction(Constants.BURDEN_ONE); |
| | | userStudyRecord.setAnswer(Constants.BURDEN_ONE); |
| | | userStudyRecord.setPair(Constants.BURDEN_ONE); |
| | | } |
| | | userStudyRecord.setDay(nextDay); |
| | | } |
| | | } |
| | | // 更新学习时长 |
| | |
| | | for (int i = 0; i < studyList1.size(); i++) { |
| | | TStudy tStudy = studyList1.get(i); |
| | | if (tStudy.getWeek().equals(userStudy.getWeek())) { |
| | | if (studyList1.size() == 1 || i + 1 == studyList1.size() - 1) { |
| | | // 是否为当前季度最后一周目 |
| | | if (i + 1 == studyList1.size() - 1) { |
| | | List<TStudy> studyList2 = studyMap.get(quarterItem + 1); |
| | | // 下一季度数据为空 |
| | | if (null != studyList2 && !studyList2.isEmpty()) { |
| | | TStudy tStudy1 = studyList2.get(Constants.ZERO); |
| | | tStudy.setWeek(tStudy1.getWeek()); |
| | | userStudy.setWeek(tStudy1.getWeek()); |
| | | } |
| | | } else { |
| | | TStudy tStudy1 = studyList1.get(i + 1); |
| | |
| | | } |
| | | } |
| | | } |
| | | userStudy.setDay(DAY_MAP.get(String.valueOf(userStudy.getDay()))); |
| | | userStudy.setLook(Constants.BURDEN_ONE); |
| | | userStudy.setPair(Constants.BURDEN_ONE); |
| | | userStudy.setInduction(Constants.BURDEN_ONE); |
| | | userStudy.setListen(Constants.BURDEN_ONE); |
| | | userStudy.setAnswer(Constants.BURDEN_ONE); |
| | | userStudy.setGameDifficulty(Constants.ZERO); |
| | | this.updateById(userStudy); |
| | | } |
| | | } |
| | |
| | | // 获取用户超级记忆游戏记录 |
| | | TUserStudy userStudy = this.lambdaQuery().eq(TUserStudy::getUserId, userid).one(); |
| | | // 更新游戏难度学习记录 |
| | | if (!Constants.TWO.equals(userStudy.getGameDifficulty())) { |
| | | userStudy.setGameDifficulty(GAME_DIFFICULTY_MAP.get(completeStudy.getDifficulty())); |
| | | } |
| | | this.updateById(userStudy); |
| | | } |
| | | } |