Althars123 пре 3 година
родитељ
комит
e35a0bba94

+ 15 - 4
twzd-admin/src/main/java/com/miaxis/pc/controller/question/PcQuestionInfoController.java

@@ -8,11 +8,9 @@ import com.miaxis.common.enums.BusinessTypeEnum;
 import com.miaxis.question.dto.QuestionInfoSortDTO;
 import com.miaxis.question.dto.QuestionInfoSortUpateDTO;
 import com.miaxis.question.service.IQuestionInfoService;
+import com.miaxis.question.vo.QuestionInfoExcelTypeVo;
 import com.miaxis.question.vo.QuestionInfoExcelVo;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
@@ -87,6 +85,19 @@ public class PcQuestionInfoController extends BaseController{
 
 
 
+    /**
+     * 根据专题类型获取具体分类
+     */
+    @PreAuthorize("@ss.hasPermi('question:info:list')")
+    @GetMapping(value = "/issueType")
+    @ApiOperation("根据专题类型获取具体分类")
+    public Response<List<QuestionInfoExcelTypeVo>> getTypes(Integer subject,Integer issueTypeValue)
+    {
+
+        return Response.success(questionInfoService.getIssueTypes(subject,issueTypeValue));
+    }
+
+
     /**
      * 修改题库
      */

+ 4 - 4
twzd-admin/src/test/java/com/miaxis/test/NormalTest.java

@@ -41,7 +41,7 @@ public class NormalTest {
     public void test1() throws Exception {
         try {
             OutputStream out = new FileOutputStream("D:\\分类专题.xls");
-            List<QuestionInfoExcelTypeVo> questionInfoExcelTypeVos = questionInfoMapper.selectIssueType1();
+            List<QuestionInfoExcelTypeVo> questionInfoExcelTypeVos = questionInfoMapper.selectIssueType1(1);
             String[] headers = { "id", "number", "issue", "image","excell_issue_name", "class_issue_name" ,"seque_issue_name","place_issue_name","question_type","class_sort"};
             HSSFWorkbook workbook = new HSSFWorkbook();
             for (int index=0; index < questionInfoExcelTypeVos.size();index++){
@@ -65,7 +65,7 @@ public class NormalTest {
     public void test2() throws Exception {
         try {
             OutputStream out = new FileOutputStream("D:\\精选专题.xls");
-            List<QuestionInfoExcelTypeVo> questionInfoExcelTypeVos = questionInfoMapper.selectIssueType2();
+            List<QuestionInfoExcelTypeVo> questionInfoExcelTypeVos = questionInfoMapper.selectIssueType2(1);
             String[] headers = { "id", "number", "issue", "image","excell_issue_name", "class_issue_name" ,"seque_issue_name","place_issue_name","question_type","class_sort"};
             HSSFWorkbook workbook = new HSSFWorkbook();
             for (int index=0; index < questionInfoExcelTypeVos.size();index++){
@@ -89,7 +89,7 @@ public class NormalTest {
     public void test3() throws Exception {
         try {
             OutputStream out = new FileOutputStream("D:\\地方专题.xls");
-            List<QuestionInfoExcelTypeVo> questionInfoExcelTypeVos = questionInfoMapper.selectIssueType3();
+            List<QuestionInfoExcelTypeVo> questionInfoExcelTypeVos = questionInfoMapper.selectIssueType3(1);
             String[] headers = { "id", "number", "issue", "image","excell_issue_name", "class_issue_name" ,"seque_issue_name","place_issue_name","question_type","class_sort"};
             HSSFWorkbook workbook = new HSSFWorkbook();
             for (int index=0; index < questionInfoExcelTypeVos.size();index++){
@@ -113,7 +113,7 @@ public class NormalTest {
     public void test4() throws Exception {
         try {
             OutputStream out = new FileOutputStream("D:\\顺序练习.xls");
-            List<QuestionInfoExcelTypeVo> questionInfoExcelTypeVos = questionInfoMapper.selectIssueType4();
+            List<QuestionInfoExcelTypeVo> questionInfoExcelTypeVos = questionInfoMapper.selectIssueType4(1);
             String[] headers = { "id", "number", "issue", "image","excell_issue_name", "class_issue_name" ,"seque_issue_name","place_issue_name","question_type","class_sort"};
             HSSFWorkbook workbook = new HSSFWorkbook();
             for (int index=0; index < questionInfoExcelTypeVos.size();index++){

+ 37 - 0
twzd-service/src/main/java/com/miaxis/question/dto/QuestionInfoIssueTypeDTO.java

@@ -0,0 +1,37 @@
+package com.miaxis.question.dto;
+
+import com.miaxis.common.core.domain.BaseBusinessEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 题库对象 question_info
+ *
+ * @author miaxis
+ * @date 2021-10-20
+ */
+@Data
+public class QuestionInfoIssueTypeDTO extends BaseBusinessEntity{
+    private static final long serialVersionUID = 1L;
+
+
+    /**  主键 */
+    @ApiModelProperty(value = "科目")
+    private String subject;
+
+    /** 在所有题目中的序号 */
+    @ApiModelProperty(value = "类型参数: 1--按分类专题分类,2--按精选专题分类,3--按地方专题分类,4--按顺序练习分类")
+    private Integer  issueTypeValue;
+
+    /** 正确答案 */
+    @ApiModelProperty(value = "分类id值")
+    private String issueValue;
+
+    @ApiModelProperty(value = "分类字段名",hidden = true)
+    private String issueTypeParmName;
+
+    @ApiModelProperty(value = "排序字段名",hidden = true)
+    private String sortName;
+
+
+}

+ 0 - 1
twzd-service/src/main/java/com/miaxis/question/dto/QuestionInfoSortDTO.java

@@ -19,7 +19,6 @@ public class QuestionInfoSortDTO extends BaseBusinessEntity{
     @ApiModelProperty(value = "科目")
     private String subject;
 
-    /** 在所有题目中的序号 */
     @ApiModelProperty(value = "类型参数: 1--按分类专题分类,2--按精选专题分类,3--按地方专题分类,4--按顺序练习分类")
     private Integer  issueTypeValue;
 

+ 6 - 5
twzd-service/src/main/java/com/miaxis/question/mapper/QuestionInfoMapper.java

@@ -20,7 +20,7 @@ public interface QuestionInfoMapper extends BaseMapper<QuestionInfo> {
     /**
      * 查询题库列表
      *
-     * @param questionInfo 题库
+     * @param
      * @return 题库集合
      */
     List<QuestionInfo> selectQuestionInfoList(QuestionInfoDTO questionInfoDTO);
@@ -37,23 +37,24 @@ public interface QuestionInfoMapper extends BaseMapper<QuestionInfo> {
 
     List<QuestionInfo> selectNormalQuestionInfoList(QuestionInfoDTO questionInfoDTO);
 
-    List<QuestionInfoExcelTypeVo> selectIssueType1();
+    List<QuestionInfoExcelTypeVo> selectIssueType1(int subject);
 
     List<QuestionInfoExcelVo> selecQuestionInfoExcel1(String issueType);
 
-    List<QuestionInfoExcelTypeVo> selectIssueType2();
+    List<QuestionInfoExcelTypeVo> selectIssueType2(int subject);
 
     List<QuestionInfoExcelVo> selecQuestionInfoExcel2(String issueType);
 
-    List<QuestionInfoExcelTypeVo> selectIssueType3();
+    List<QuestionInfoExcelTypeVo> selectIssueType3(int subject);
 
     List<QuestionInfoExcelVo> selecQuestionInfoExcel3(String issueType);
 
-    List<QuestionInfoExcelTypeVo> selectIssueType4();
+    List<QuestionInfoExcelTypeVo> selectIssueType4(int subject);
 
     List<QuestionInfoExcelVo> selecQuestionInfoExcel4(String issueType);
 
     List<QuestionInfoExcelVo> selectQuestionInfoSortList(QuestionInfoSortDTO questionInfoSortDTO);
 
     void updateSortById(QuestionInfoSortUpateDTO dto);
+
 }

+ 2 - 0
twzd-service/src/main/java/com/miaxis/question/service/IQuestionInfoService.java

@@ -40,5 +40,7 @@ public interface IQuestionInfoService extends IService<QuestionInfo>{
     List<QuestionInfoExcelVo> selectQuestionInfoSortList(QuestionInfoSortDTO questionInfoSortDTO);
 
     void updateSortById(QuestionInfoSortUpateDTO dto);
+
+    List<QuestionInfoExcelTypeVo> getIssueTypes(int issueTypeValue, Integer typeValue);
 }
 

+ 20 - 0
twzd-service/src/main/java/com/miaxis/question/service/impl/QuestionInfoServiceImpl.java

@@ -76,4 +76,24 @@ public class QuestionInfoServiceImpl extends ServiceImpl<QuestionInfoMapper, Que
         questionInfoMapper.updateSortById(dto);
     }
 
+    @Override
+    public List<QuestionInfoExcelTypeVo> getIssueTypes(int issueTypeValue, Integer subject) {
+        if (issueTypeValue == 1){
+            return questionInfoMapper.selectIssueType1(subject);
+        }
+        if (issueTypeValue == 2){
+            return questionInfoMapper.selectIssueType2(subject);
+        }
+        if (issueTypeValue == 3){
+            return questionInfoMapper.selectIssueType3(subject);
+        }
+        if (issueTypeValue == 4){
+            return questionInfoMapper.selectIssueType4(subject);
+        }
+        return null;
+
+
+
+    }
+
 }

+ 4 - 4
twzd-service/src/main/resources/mapper/qustion/QuestionInfoMapper.xml

@@ -221,7 +221,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     FROM
                      question_info
                     WHERE
-                     subject_1 = 1
+                    subject = #{subject}
                      AND lice_car = 1 and
                      class_issue_name is not null
                     ORDER BY
@@ -248,7 +248,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     FROM
                      question_info
                     WHERE
-                     subject_1 = 1
+                    subject = #{subject}
                      AND lice_car = 1 and
                      excell_issue_name is not null
                     ORDER BY
@@ -276,7 +276,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     FROM
                      question_info
                     WHERE
-                     subject_1 = 1
+                     subject = #{subject}
                      AND lice_car = 1 and
                      place_issue_name is not null
                     ORDER BY
@@ -304,7 +304,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     FROM
                      question_info
                     WHERE
-                     subject_1 = 1
+                     subject = #{subject}
                      AND lice_car = 1 and
                      seque_issue_name is not null
                     ORDER BY