diff --git a/src/main/java/com/sztzjy/money_management/controller/TopicController.java b/src/main/java/com/sztzjy/money_management/controller/TopicController.java index 2e80416..1041d94 100644 --- a/src/main/java/com/sztzjy/money_management/controller/TopicController.java +++ b/src/main/java/com/sztzjy/money_management/controller/TopicController.java @@ -19,6 +19,7 @@ import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; +import java.util.ArrayList; import java.util.List; /** @@ -130,9 +131,27 @@ public class TopicController { @PostMapping("/getObjectiveCountByChapterId") @ApiOperation("根据章节查看题目类型数量/模拟认证题库通用") @AnonymousAccess - private ResultEntity> getObjectiveCountByChapterId(@ApiParam("普通题库/金融智能/银行从业") @RequestParam String outLine, - @RequestParam(required = false) String chapterId) { - return new ResultEntity<>(objectiveQuestionMapper.getObjectiveCountByChapterId(outLine, chapterId)); + private ResultEntity> getObjectiveCountByChapterId(@ApiParam("普通题库/金融智能/银行从业") @RequestParam String outLine) { + List list = new ArrayList<>(); + if (outLine.equals("金融智能")) { + List list1 = objectiveQuestionMapper.getObjectiveCountByChapterId("金融智能", "13"); + List list2 = objectiveQuestionMapper.getObjectiveCountByChapterId("金融智能", "14"); + list.addAll(list2); + list.addAll(list1); + } + if (outLine.equals("银行从业")) { + List list1 = objectiveQuestionMapper.getObjectiveCountByChapterId("银行从业", "15"); + List list2 = objectiveQuestionMapper.getObjectiveCountByChapterId("银行从业", "16"); + List list3 = objectiveQuestionMapper.getObjectiveCountByChapterId("银行从业", "17"); + List list4 = objectiveQuestionMapper.getObjectiveCountByChapterId("银行从业", "18"); + List list5 = objectiveQuestionMapper.getObjectiveCountByChapterId("银行从业", "19"); + list.addAll(list2); + list.addAll(list1); + list.addAll(list3); + list.addAll(list4); + list.addAll(list5); + } + return new ResultEntity<>(list); } @@ -148,7 +167,7 @@ public class TopicController { @RequestParam(required = false) String schoolId, @RequestParam String chapterId) { PageHelper.startPage(index, size); - List list = objectiveQuestionMapper.getObjectiveByType(type, outLine, subClass, content,schoolId,chapterId); + List list = objectiveQuestionMapper.getObjectiveByType(type, outLine, subClass, content, schoolId, chapterId); PageInfo pageInfo = new PageInfo(list); return new ResultEntity>(pageInfo); }