| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | |
| | | studyId.setAnswerCount(game.getAnswerCount()); |
| | | studyId.setRate(game.getRate()); |
| | | studyId.setAnswerRate(game.getAnswerRate()); |
| | | studyId.setSubjectIds(game.getSubjectIds()); |
| | | gameService.updateById(studyId); |
| | | } else { |
| | | // 判断当前周目配置的题目数量 |
| | |
| | | tGame.setAnswerTime(game.getAnswerTime()); |
| | | tGame.setAnswerIntegral(game.getAnswerIntegral()); |
| | | tGame.setAnswerCount(game.getAnswerCount()); |
| | | tGame.setSubjectIds(game.getSubjectIds()); |
| | | gameService.save(tGame); |
| | | } |
| | | |
| | |
| | | gameVO.setAnswerCount(tGame.getAnswerCount()); |
| | | gameVO.setRate(tGame.getRate()); |
| | | gameVO.setAnswerRate(tGame.getAnswerRate()); |
| | | String subjectIds = tGame.getSubjectIds(); |
| | | if(subjectIds!=null && subjectIds.length()>0){ |
| | | gameVO.setSubjects(subjectService.list(new QueryWrapper<TSubject>() |
| | | .in("id", subjectIds.split(",")))); |
| | | } |
| | | gameVOS.add(gameVO); |
| | | } |
| | | List<TStoryListen> list6 = storyListenService.list(new QueryWrapper<TStoryListen>() |
| | |
| | | game.setTime(game.getTime().split(",")[difficulty]); |
| | | // 检验是否完成难度 |
| | | studyService.checkDifficulty(difficulty, week, game, userStudy.getUserid()); |
| | | List<String> subjectId = getSubjectId(week); |
| | | |
| | | |
| | | // List<String> subjectId = getSubjectId(week); |
| | | |
| | | String[] split = game.getSubjectIds().split(","); |
| | | List<String> subjectId = new ArrayList<>(); |
| | | for (String s : split) { |
| | | subjectId.add(s); |
| | | } |
| | | |
| | | List<String> newSubjectId = subjectId.stream().map(data -> { |
| | | if (data.startsWith(Constants.REDUCE)) { |
| | | data = data.replace(Constants.REDUCE, Constants.EMPTY_STR); |
| | |
| | | if (null == game) { |
| | | throw new GlobalException("当前季度该周目暂无配置游戏数据!"); |
| | | } |
| | | List<String> subjectId = getSubjectId(week); |
| | | // List<String> subjectId = getSubjectId(week); |
| | | String[] split = game.getSubjectIds().split(","); |
| | | List<String> subjectId = new ArrayList<>(); |
| | | for (String s : split) { |
| | | subjectId.add(s); |
| | | } |
| | | List<String> subjectData = getSubjectData(game, subjectId); |
| | | List<TSubject> subjectList = getSubjectList(subjectData); |
| | | // 返回数据 |
| | |
| | | return R.ok(userService.updateById(user)); |
| | | } |
| | | |
| | | @GetMapping("/lookVideo") |
| | | // @ApiOperation(value = "用户积分变动", tags = {"用户积分变动"}) |
| | | public R<Boolean> lookVideo() { |
| | | boolean update = userService.update(new LambdaUpdateWrapper<TUser>().set(TUser::getLookVideo, 0)); |
| | | return R.ok(update); |
| | | } |
| | | |
| | | } |
| | | |