From 5749ed70ef32a69c69add0f7490adfbebf211f0f Mon Sep 17 00:00:00 2001 From: liujie <1793218484@qq.com> Date: 星期二, 26 八月 2025 16:13:40 +0800 Subject: [PATCH] 8.26 --- ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TStudyController.java | 33 +++++++++++++++++++++++++++++++-- 1 files changed, 31 insertions(+), 2 deletions(-) diff --git a/ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TStudyController.java b/ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TStudyController.java index b6cf51a..8eecf77 100644 --- a/ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TStudyController.java +++ b/ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TStudyController.java @@ -2,6 +2,7 @@ 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; @@ -353,6 +354,7 @@ studyId.setAnswerCount(game.getAnswerCount()); studyId.setRate(game.getRate()); studyId.setAnswerRate(game.getAnswerRate()); + studyId.setSubjectIds(game.getSubjectIds()); gameService.updateById(studyId); } else { // 判断当前周目配置的题目数量 @@ -381,6 +383,7 @@ tGame.setAnswerTime(game.getAnswerTime()); tGame.setAnswerIntegral(game.getAnswerIntegral()); tGame.setAnswerCount(game.getAnswerCount()); + tGame.setSubjectIds(game.getSubjectIds()); gameService.save(tGame); } @@ -924,6 +927,11 @@ 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>() @@ -1711,7 +1719,16 @@ 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); @@ -1766,7 +1783,12 @@ 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); // 返回数据 @@ -2452,5 +2474,12 @@ 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); + } + } -- Gitblit v1.7.1