Browse Source

fix 试卷题目

he2802 4 years ago
parent
commit
14e1ec6e8d

+ 16 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/bank/ExamController.java

@@ -6,7 +6,10 @@ import java.util.Arrays;
 import com.zhongzheng.modules.bank.bo.ExamAddBo;
 import com.zhongzheng.modules.bank.bo.ExamEditBo;
 import com.zhongzheng.modules.bank.bo.ExamQueryBo;
+import com.zhongzheng.modules.bank.bo.QuestionBusinessQueryBo;
+import com.zhongzheng.modules.bank.domain.QuestionBusiness;
 import com.zhongzheng.modules.bank.service.IExamService;
+import com.zhongzheng.modules.bank.service.IQuestionBusinessService;
 import com.zhongzheng.modules.bank.vo.ExamVo;
 import lombok.RequiredArgsConstructor;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -42,6 +45,8 @@ public class ExamController extends BaseController {
 
     private final IExamService iExamService;
 
+    private final IQuestionBusinessService iQuestionBusinessService;
+
     /**
      * 查询试卷列表
      */
@@ -109,4 +114,15 @@ public class ExamController extends BaseController {
     public AjaxResult<Void> remove(@PathVariable Long[] examIds) {
         return toAjax(iExamService.deleteWithValidByIds(Arrays.asList(examIds), true) ? 1 : 0);
     }*/
+    /**
+     * 查询题目业务层次关系列表
+     */
+    @ApiOperation("查询业务层次关系列表")
+    @PreAuthorize("@ss.hasPermi('system:business:list')")
+    @GetMapping("/business/list")
+    public TableDataInfo<QuestionBusiness> businessList(QuestionBusinessQueryBo bo) {
+        startPage();
+        List<QuestionBusiness> list = iQuestionBusinessService.getListById(bo);
+        return getDataTable(list);
+    }
 }

+ 16 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/bank/QuestionChapterController.java

@@ -3,9 +3,12 @@ package com.zhongzheng.controller.bank;
 import java.util.List;
 import java.util.Arrays;
 
+import com.zhongzheng.modules.bank.bo.QuestionBusinessQueryBo;
 import com.zhongzheng.modules.bank.bo.QuestionChapterAddBo;
 import com.zhongzheng.modules.bank.bo.QuestionChapterEditBo;
 import com.zhongzheng.modules.bank.bo.QuestionChapterQueryBo;
+import com.zhongzheng.modules.bank.domain.QuestionBusiness;
+import com.zhongzheng.modules.bank.service.IQuestionBusinessService;
 import com.zhongzheng.modules.bank.service.IQuestionChapterService;
 import com.zhongzheng.modules.bank.vo.QuestionChapterVo;
 import lombok.RequiredArgsConstructor;
@@ -42,6 +45,8 @@ public class QuestionChapterController extends BaseController {
 
     private final IQuestionChapterService iQuestionChapterService;
 
+    private final IQuestionBusinessService iQuestionBusinessService;
+
     /**
      * 查询章卷列表
      */
@@ -109,4 +114,15 @@ public class QuestionChapterController extends BaseController {
     public AjaxResult<Void> remove(@PathVariable Long[] chapterExamIds) {
         return toAjax(iQuestionChapterService.deleteWithValidByIds(Arrays.asList(chapterExamIds), true) ? 1 : 0);
     }*/
+    /**
+     * 查询题目业务层次关系列表
+     */
+    @ApiOperation("查询业务层次关系列表")
+    @PreAuthorize("@ss.hasPermi('system:business:list')")
+    @GetMapping("/business/list")
+    public TableDataInfo<QuestionBusiness> businessList(QuestionBusinessQueryBo bo) {
+        startPage();
+        List<QuestionBusiness> list = iQuestionBusinessService.getListById(bo);
+        return getDataTable(list);
+    }
 }

+ 1 - 1
zhongzheng-system/src/main/resources/mapper/modules/bank/QuestionMapper.xml

@@ -67,7 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ek.knowledge_id
         FROM
         question q
-        LEFT JOIN question_business qb ON q.question_id = qb.question_id
+        LEFT JOIN question_business qb ON q.question_id = qb.major_id and qb.type = 1
         LEFT JOIN course_education_type cet ON qb.education_type_id = cet.id
         LEFT JOIN course_project_type cpt ON qb.project_id = cpt.id
         LEFT JOIN course_business cb ON qb.business_id = cb.id