ruoyi-api/ruoyi-api-study/src/main/java/com/ruoyi/study/api/dto/SetStudyTypeDto.java
New file @@ -0,0 +1,22 @@ package com.ruoyi.study.api.dto; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; @Data @ApiModel(value = "听图选音设置类型Dto") public class SetStudyTypeDto { @ApiModelProperty("类型1常规 2示例") @NotNull(message = "类型不能为空") private Integer type; @ApiModelProperty("题组id") @NotNull(message = "题组id不能为空") private Integer id; @ApiModelProperty("题目") @NotBlank(message = "题目不能为空") private String subject; } ruoyi-api/ruoyi-api-study/src/main/java/com/ruoyi/study/api/dto/StudyAnswerDTO.java
@@ -17,4 +17,6 @@ private Integer isAnswer; @ApiModelProperty("非会员是否可看 0否1是") private Integer isVip; @ApiModelProperty("排序") private Integer studySort; } ruoyi-api/ruoyi-api-study/src/main/java/com/ruoyi/study/api/dto/StudyInductionDTO.java
@@ -13,4 +13,6 @@ private Integer integral; @ApiModelProperty("非会员是否可看 0否1是") private Integer isVip; @ApiModelProperty("排序") private Integer studySort; } ruoyi-api/ruoyi-api-study/src/main/java/com/ruoyi/study/api/dto/StudyListenDTO.java
@@ -13,4 +13,6 @@ private Integer integral; @ApiModelProperty("非会员是否可看 0否1是") private Integer isVip; @ApiModelProperty("排序") private Integer studySort; } ruoyi-api/ruoyi-api-study/src/main/java/com/ruoyi/study/api/dto/StudyLookDTO.java
@@ -15,4 +15,6 @@ private Integer integral; @ApiModelProperty("非会员是否可看 0否1是") private Integer isVip; @ApiModelProperty("排序") private Integer studySort; } ruoyi-api/ruoyi-api-study/src/main/java/com/ruoyi/study/api/dto/StudyPairDTO.java
@@ -13,6 +13,8 @@ private Integer integral; @ApiModelProperty("非会员是否可看 0否1是") private Integer isVip; @ApiModelProperty("排序") private Integer studySort; } ruoyi-api/ruoyi-api-study/src/main/java/com/ruoyi/study/api/feignClient/StudyClient.java
@@ -14,6 +14,7 @@ import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import java.util.List; @FeignClient(contextId = "studyClient", value = ServiceNameConstants.STUDY_SERVICE, fallbackFactory = StudyFallbackFactory.class) @@ -238,7 +239,6 @@ R<Boolean> resetLookVideo(); @PostMapping("/base/study/setStudyType") R<Object> setStudyType(@RequestBody SetStudyTypeDto dto); } ruoyi-service/ruoyi-management/src/main/java/com/ruoyi/management/controller/TStudyController.java
@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import javax.validation.Valid; import java.util.List; /** @@ -71,6 +72,20 @@ return AjaxResult.success("保存成功"); } @ApiOperation(value = "听图选音设置常规/示例", tags = {"后台-学习"}) @PostMapping(value = "/setStudyType") @ResponseBody public AjaxResult setStudyType(@RequestBody @Valid SetStudyTypeDto dto) { R<Object> objectR = studyClient.setStudyType(dto); int code = objectR.getCode(); if (code == 500){ String string = objectR.getMsg().toString(); return AjaxResult.error(string); } return AjaxResult.success("设置成功"); } /** * 通过类型、周目、day查询学习配置 * @return ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/controller/TStudyController.java
@@ -448,6 +448,7 @@ tStudyListen.setWeek(week); tStudyListen.setIsVip(studyListenDTO.getIsVip()); tStudyListen.setRate(dto.getListenRate()); tStudyListen.setStudySort(studyListenDTO.getStudySort()); studyListenService.save(tStudyListen); } List<Integer> ids1 = studyLookService.lambdaQuery().eq(TStudyLook::getId, one.getId()) @@ -474,7 +475,7 @@ tStudyLook.setWeek(week); tStudyLook.setIsVip(studyLookDTO.getIsVip()); tStudyLook.setRate(dto.getLookRate()); tStudyLook.setStudySort(studyLookDTO.getStudySort()); studyLookService.save(tStudyLook); } List<Integer> ids2 = studyInductionService.lambdaQuery().eq(TStudyInduction::getId, one.getId()) @@ -499,8 +500,9 @@ tStudyInduction.setIntegral(studyInductionDTO.getIntegral()); tStudyInduction.setWeek(week); tStudyInduction.setRate(dto.getInductionRate()); tStudyInduction.setIsVip(studyInductionDTO.getIsVip()); tStudyInduction.setStudySort(studyInductionDTO.getStudySort()); studyInductionService.save(tStudyInduction); } List<Integer> ids3 = studyAnswerService.lambdaQuery().eq(TStudyAnswer::getId, one.getId()) @@ -528,6 +530,9 @@ tStudyAnswer.setWeek(week); tStudyAnswer.setRate(dto.getAnswerRate()); tStudyAnswer.setIsVip(studyAnswerDTO.getIsVip()); tStudyAnswer.setStudySort(studyAnswerDTO.getStudySort()); studyAnswerService.save(tStudyAnswer); } List<Integer> ids4 = studyPairService.lambdaQuery().eq(TStudyPair::getId, one.getId()) @@ -553,6 +558,7 @@ tStudyPair.setWeek(week); tStudyPair.setRate(dto.getPairRate()); tStudyPair.setIsVip(studyPairDTO.getIsVip()); tStudyPair.setStudySort(studyPairDTO.getStudySort()); studyPairService.save(tStudyPair); } } @@ -755,7 +761,7 @@ // 听音选图 List<TStudyListen> list = studyListenService.list(new QueryWrapper<TStudyListen>() .eq("week", week) .eq("day", day)); .eq("day", day).orderByAsc("studySort")); List<TSubject> list9 = subjectService.list(); for (TStudyListen tStudyListen : list) { @@ -773,6 +779,8 @@ studyListenVO.setIntegral(tStudyListen.getIntegral()); studyListenVO.setSubject(tStudyListen.getSubject()); studyListenVO.setIsVip(tStudyListen.getIsVip()); studyListenVO.setId(tStudyListen.getId()); studyListenVO.setType(tStudyListen.getType()); listenVOS.add(studyListenVO); } res.setListenRate(tStudyListen.getRate()); @@ -781,7 +789,7 @@ // 看音选图 List<TStudyLook> list1 = studyLookService.list(new QueryWrapper<TStudyLook>() .eq("week", week) .eq("day", day) .eq("day", day).orderByAsc("studySort") ); for (TStudyLook tStudyLook : list1) { int index = 0; @@ -806,6 +814,8 @@ studyLookVO1.setIntegral(tStudyLook.getIntegral()); studyLookVO1.setSubject(tStudyLook.getSubject()); studyLookVO1.setIsVip(tStudyLook.getIsVip()); studyLookVO1.setId(tStudyLook.getId()); lookVOS.add(studyLookVO1); } res.setLookRate(tStudyLook.getRate()); @@ -814,7 +824,7 @@ // 归纳排除 List<TStudyInduction> list2 = studyInductionService.list(new QueryWrapper<TStudyInduction>() .eq("week", week) .eq("day", day) .eq("day", day).orderByAsc("studySort") ); for (TStudyInduction tStudyInduction : list2) { StringBuilder names = new StringBuilder(); @@ -832,6 +842,8 @@ studyInductionVO.setIntegral(tStudyInduction.getIntegral()); studyInductionVO.setSubject(tStudyInduction.getSubject()); studyInductionVO.setIsVip(tStudyInduction.getIsVip()); studyInductionVO.setId(tStudyInduction.getId()); inductionVOS.add(studyInductionVO); } res.setInductionRate(tStudyInduction.getRate()); @@ -840,7 +852,7 @@ // 有问有答 List<TStudyAnswer> list3 = studyAnswerService.list(new QueryWrapper<TStudyAnswer>() .eq("week", week) .eq("day", day)); .eq("day", day).orderByAsc("studySort")); for (TStudyAnswer tStudyAnswer : list3) { StringBuilder names = new StringBuilder(); StudyAnswerVO studyAnswerVO = new StudyAnswerVO(); @@ -882,6 +894,8 @@ studyAnswerVO.setIsVip(tStudyAnswer.getIsVip()); studyAnswerVO.setIsAnswer(tStudyAnswer.getIsAnswer()); studyAnswerVO.setSubject(tStudyAnswer.getSubject() + "," + tStudyAnswer.getAnswerSubject()); studyAnswerVO.setId(tStudyAnswer.getId()); answerVOS.add(studyAnswerVO); res.setAnswerRate(tStudyAnswer.getRate()); @@ -891,7 +905,7 @@ // 音图相配 List<TStudyPair> list4 = studyPairService.list(new QueryWrapper<TStudyPair>() .eq("week", week) .eq("day", day) .eq("day", day).orderByAsc("studySort") ); for (TStudyPair tStudyPair : list4) { StringBuilder names = new StringBuilder(); @@ -909,6 +923,7 @@ studyPairVO.setIntegral(tStudyPair.getIntegral()); studyPairVO.setSubject(tStudyPair.getSubject()); studyPairVO.setIsVip(tStudyPair.getIsVip()); studyPairVO.setId(tStudyPair.getId()); pairVOS.add(studyPairVO); } res.setPairRate(tStudyPair.getRate()); @@ -2492,5 +2507,19 @@ return R.ok(update); } /** * 设置题组类型 常规 示例 * @param dto * @return */ @PostMapping("/setStudyType") public R<Object> setStudyType(@RequestBody SetStudyTypeDto dto){ TStudyListen studyListen = studyListenService.getById(dto.getId()); studyListen.setType(dto.getType()); studyListen.setSubject(dto.getSubject()); return R.ok(studyListenService.updateById(studyListen)); } } ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/domain/TStudyAnswer.java
@@ -67,5 +67,7 @@ private Integer isVip; @ApiModelProperty("通关率") private String rate; @ApiModelProperty("排序") private Integer studySort; } ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/domain/TStudyInduction.java
@@ -58,4 +58,6 @@ private Integer isVip; @ApiModelProperty("通关率") private String rate; @ApiModelProperty("排序") private Integer studySort; } ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/domain/TStudyListen.java
@@ -59,5 +59,10 @@ private Integer isVip; @ApiModelProperty("通关率") private String rate; @ApiModelProperty("排序") private Integer studySort; @ApiModelProperty("1常规 2示例") private Integer type; } ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/domain/TStudyLook.java
@@ -63,4 +63,6 @@ private Integer isVip; @ApiModelProperty("通关率") private String rate; @ApiModelProperty("排序") private Integer studySort; } ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/domain/TStudyPair.java
@@ -58,4 +58,6 @@ private Integer isVip; @ApiModelProperty("通关率") private String rate; @ApiModelProperty("排序") private Integer studySort; } ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/dto/SetStudyTypeDto.java
New file @@ -0,0 +1,22 @@ package com.ruoyi.study.dto; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; @Data @ApiModel(value = "听图选音设置类型Dto") public class SetStudyTypeDto { @ApiModelProperty("类型1常规 2示例") @NotNull(message = "类型不能为空") private Integer type; @ApiModelProperty("题组id") @NotNull(message = "题组id不能为空") private Integer id; @ApiModelProperty("题目") @NotBlank(message = "题目不能为空") private String subject; } ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/dto/StudyAnswerDTO.java
@@ -17,4 +17,6 @@ private Integer isAnswer; @ApiModelProperty("非会员是否可看 0否1是") private Integer isVip; @ApiModelProperty("排序") private Integer studySort; } ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/dto/StudyInductionDTO.java
@@ -13,4 +13,6 @@ private Integer integral; @ApiModelProperty("非会员是否可看 0否1是") private Integer isVip; @ApiModelProperty("排序") private Integer studySort; } ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/dto/StudyListenDTO.java
@@ -13,4 +13,6 @@ private Integer integral; @ApiModelProperty("非会员是否可看 0否1是") private Integer isVip; @ApiModelProperty("排序") private Integer studySort; } ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/dto/StudyLookDTO.java
@@ -15,4 +15,6 @@ private Integer integral; @ApiModelProperty("非会员是否可看 0否1是") private Integer isVip; @ApiModelProperty("排序") private Integer studySort; } ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/dto/StudyPairDTO.java
@@ -13,6 +13,8 @@ private Integer integral; @ApiModelProperty("非会员是否可看 0否1是") private Integer isVip; @ApiModelProperty("排序") private Integer studySort; } ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/vo/StudyAnswerVO.java
@@ -19,4 +19,6 @@ private Integer isVip; @ApiModelProperty(value = "问题题目是否为答案图片 0否1是 为0 那么回答题目是答案图片") private Integer isAnswer; @ApiModelProperty(value = "id") private Integer id; } ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/vo/StudyInductionVO.java
@@ -15,4 +15,6 @@ private String subject; @ApiModelProperty(value = "非会员是否可以查看 0否1是") private Integer isVip; @ApiModelProperty(value = "id") private Integer id; } ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/vo/StudyListenVO.java
@@ -16,4 +16,11 @@ @ApiModelProperty(value = "非会员是否可以查看 0否1是") private Integer isVip; @ApiModelProperty(value = "id") private Integer id; @ApiModelProperty(value = "题型 1常规 2示例") private Integer type; } ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/vo/StudyLookVO.java
@@ -17,4 +17,7 @@ private String subject; @ApiModelProperty(value = "非会员是否可以查看 0否1是") private Integer isVip; @ApiModelProperty(value = "题组id") private Integer id; } ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/vo/StudyPairVO.java
@@ -15,4 +15,6 @@ private String subject; @ApiModelProperty(value = "非会员是否可以查看 0否1是") private Integer isVip; @ApiModelProperty(value = "id") private Integer id; }