44323
2024-05-21 b2c5b8c958ba187246302f835811b3739a50f212
ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TStudyController.java
@@ -87,7 +87,6 @@
    public R<PageInfo<TSubject>> subjectList(@RequestBody ChoiceSubject query) {
        PageInfo<TSubject> res = new PageInfo<>(query.getPageNumber(), query.getPageSize());
        QueryWrapper<TSubject> wrapper = new QueryWrapper<>();
        if (StringUtils.hasLength(query.getName())){
            wrapper.like("name",query.getName());
        }
@@ -226,6 +225,7 @@
                tStudyListen.setSubject(studyListenDTO.getSubject());
                tStudyListen.setIntegral(studyListenDTO.getIntegral());
                tStudyListen.setWeek(week);
                tStudyListen.setIsVip(studyListenDTO.getIsVip());
                studyListenService.save(tStudyListen);
            }
            studyLookService.remove(new QueryWrapper<TStudyLook>()
@@ -240,6 +240,7 @@
                tStudyLook.setSubject(studyLookDTO.getSubject());
                tStudyLook.setIntegral(studyLookDTO.getIntegral());
                tStudyLook.setWeek(week);
                tStudyLook.setIsVip(studyLookDTO.getIsVip());
                studyLookService.save(tStudyLook);
            }
            studyInductionService.remove(new QueryWrapper<TStudyInduction>()
@@ -254,6 +255,7 @@
                tStudyInduction.setSubject(studyInductionDTO.getSubject());
                tStudyInduction.setIntegral(studyInductionDTO.getIntegral());
                tStudyInduction.setWeek(week);
                tStudyInduction.setIsVip(studyInductionDTO.getIsVip());
            }
            studyAnswerService.remove(new QueryWrapper<TStudyAnswer>()
                    .eq("studyId", one.getId())
@@ -269,6 +271,7 @@
                tStudyAnswer.setAnswerSubject(studyAnswerDTO.getAnswerSubject());
                tStudyAnswer.setIntegral(studyAnswerDTO.getIntegral());
                tStudyAnswer.setWeek(week);
                tStudyAnswer.setIsVip(studyAnswerDTO.getIsVip());
                studyAnswerService.save(tStudyAnswer);
            }
            studyPairService.remove(new QueryWrapper<TStudyPair>()
@@ -283,6 +286,7 @@
                tStudyPair.setSubject(studyPairDTO.getSubject());
                tStudyPair.setIntegral(studyPairDTO.getIntegral());
                tStudyPair.setWeek(week);
                tStudyPair.setIsVip(studyPairDTO.getIsVip());
                studyPairService.save(tStudyPair);
            }
        }
@@ -300,6 +304,7 @@
        tStudy.setType(dto.getType());
        tStudy.setWeek(dto.getWeek());
        tStudy.setTitle(dto.getTitle());
        tStudy.setQuarter(dto.getQuarter());
        studyService.save(tStudy);
        return R.ok();
    }
@@ -314,14 +319,43 @@
        List<TStudy> count = studyService.list(new QueryWrapper<TStudy>()
                .eq("type", 1));
        studyListVO.setWeeks(count.size());
        // todo 补充开始学习人数
        studyListVO.setCount(0);
        studyListVO.setName("听");
        // 查询听类型有多少周目
        res.add(studyListVO);
        // 后续类型 不在1.0功能中
        for (int i = 1; i <= 6; i++) {
            res.add(new StudyListVO(0,0));
        }
        StudyListVO studyListVO1 = new StudyListVO();
        studyListVO1.setWeeks(0);
        studyListVO1.setCount(0);
        studyListVO1.setName("说");
        res.add(studyListVO1);
        StudyListVO studyListVO2 = new StudyListVO();
        studyListVO2.setWeeks(0);
        studyListVO2.setCount(0);
        studyListVO2.setName("认读");
        res.add(studyListVO2);
        StudyListVO studyListVO3 = new StudyListVO();
        studyListVO3.setWeeks(0);
        studyListVO3.setCount(0);
        studyListVO3.setName("阅读");
        res.add(studyListVO3);
        StudyListVO studyListVO4 = new StudyListVO();
        studyListVO4.setWeeks(0);
        studyListVO4.setCount(0);
        studyListVO4.setName("练习");
        res.add(studyListVO4);
        StudyListVO studyListVO5 = new StudyListVO();
        studyListVO5.setWeeks(0);
        studyListVO5.setCount(0);
        studyListVO5.setName("智能互动问答");
        res.add(studyListVO5);
        StudyListVO studyListVO6 = new StudyListVO();
        studyListVO6.setWeeks(0);
        studyListVO6.setCount(0);
        studyListVO6.setName("智能识别");
        res.add(studyListVO6);
        return R.ok(res);
    }
    /**