Althars123 hace 3 años
padre
commit
b799c111b2

+ 124 - 0
twzd-admin/src/main/java/com/miaxis/pc/controller/question/PcQuestionInfoController.java

@@ -0,0 +1,124 @@
+package com.miaxis.pc.controller.question;
+
+import com.miaxis.common.annotation.Log;
+import com.miaxis.common.core.controller.BaseController;
+import com.miaxis.common.core.domain.Response;
+import com.miaxis.common.core.page.ResponsePageInfo;
+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.QuestionInfoExcelVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 【题库】Controller
+ *
+ * @author miaxis
+ * @date 2021-12-24
+ */
+@RestController
+@RequestMapping("pc/question/info")
+@Api(tags={"【pc-题库排序】"})
+public class PcQuestionInfoController extends BaseController{
+    @Autowired
+    private IQuestionInfoService questionInfoService;
+
+    /**
+     * 查询题库列表
+     */
+    @PreAuthorize("@ss.hasPermi('question:info:list')")
+    @GetMapping("/list")
+    @ApiOperation("查询题库列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
+            @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
+    })
+    public ResponsePageInfo<QuestionInfoExcelVo> list(@ModelAttribute QuestionInfoSortDTO questionInfoSortDTO){
+        startPage();
+        initParams(questionInfoSortDTO);
+        List<QuestionInfoExcelVo> list = questionInfoService.selectQuestionInfoSortList(questionInfoSortDTO);
+        return toResponsePageInfo(list);
+    }
+
+    private void initParams(QuestionInfoSortDTO questionInfoSortDTO) {
+        Integer issueTypeValue = questionInfoSortDTO.getIssueTypeValue();
+        switch (issueTypeValue){
+            case 1:
+                questionInfoSortDTO.setIssueTypeParmName("class_issue");
+                questionInfoSortDTO.setSortName("class_sort");
+                break;
+            case 2:
+                questionInfoSortDTO.setIssueTypeParmName("excell_issue");
+                questionInfoSortDTO.setSortName("excell_sort");
+                break;
+            case 3:
+                questionInfoSortDTO.setIssueTypeParmName("place_issue");
+                questionInfoSortDTO.setSortName("place_sort");
+                break;
+            case 4:
+                questionInfoSortDTO.setIssueTypeParmName("seque_issue");
+                questionInfoSortDTO.setSortName("seque_sort");
+                break;
+        }
+
+    }
+
+//    /**
+//     * 导出题库列表
+//     */
+//    @PreAuthorize("@ss.hasPermi('question:info:export')")
+//    @Log(title = "题库", businessType = BusinessTypeEnum.EXPORT)
+//    @GetMapping("/export")
+//    @ApiOperation("导出题库列表Excel")
+//    public Response<String> export(@ModelAttribute QuestionInfo questionInfo){
+//        List<QuestionInfo> list = questionInfoService.selectQuestionInfoList(questionInfo);
+//        ExcelUtil<QuestionInfo> util = new ExcelUtil<QuestionInfo>(QuestionInfo.class);
+//        return util.exportExcel(list, "info");
+//    }
+
+
+
+    /**
+     * 修改题库
+     */
+    @PreAuthorize("@ss.hasPermi('question:info:edit')")
+    @Log(title = "题库", businessType = BusinessTypeEnum.UPDATE)
+    @PutMapping
+    @ApiOperation("修改顺序")
+    public Response questionInfoSortUpate(@RequestBody QuestionInfoSortUpateDTO questionInfoSortUpateDTO){
+        initParams(questionInfoSortUpateDTO);
+        questionInfoService.updateSortById(questionInfoSortUpateDTO);
+        return Response.success();
+    }
+
+    private void initParams(QuestionInfoSortUpateDTO dto) {
+        Integer issueTypeValue = dto.getIssueTypeValue();
+        switch (issueTypeValue){
+            case 1:
+                dto.setSortName("class_sort");
+                break;
+            case 2:
+                dto.setSortName("excell_sort");
+                break;
+            case 3:
+                dto.setSortName("place_sort");
+                break;
+            case 4:
+                dto.setSortName("seque_sort");
+                break;
+        }
+    }
+
+
+
+
+}

+ 2 - 0
twzd-admin/src/main/java/com/miaxis/system/controller/test/TestController.java

@@ -111,4 +111,6 @@ public class TestController {
 
 
 
+
+
 }

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

@@ -1,7 +1,11 @@
 package com.miaxis.test;
 
 import com.miaxis.TwzdApplication;
+import com.miaxis.question.mapper.QuestionInfoMapper;
+import com.miaxis.question.vo.QuestionInfoExcelTypeVo;
+import com.miaxis.question.vo.QuestionInfoExcelVo;
 import com.miaxis.wx.service.impl.WxGzhServiceImpl;
+import org.apache.poi.hssf.usermodel.*;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.boot.test.context.SpringBootTest;
@@ -9,6 +13,9 @@ import org.springframework.test.context.ActiveProfiles;
 import org.springframework.test.context.junit4.SpringRunner;
 
 import javax.annotation.Resource;
+import java.io.FileOutputStream;
+import java.io.OutputStream;
+import java.util.List;
 
 @ActiveProfiles("prod")
 @SpringBootTest(classes = TwzdApplication.class)
@@ -18,11 +25,183 @@ public class NormalTest {
 
     @Resource
     WxGzhServiceImpl wxGzhService;
+
+    @Resource
+    QuestionInfoMapper questionInfoMapper;
+
+
+
+
     @Test
-    public void test1() throws Exception {
+    public void test0() throws Exception {
         wxGzhService.handlePublicMsg(null);
     }
 
+    @Test
+    public void test1() throws Exception {
+        try {
+            OutputStream out = new FileOutputStream("D:\\分类专题.xls");
+            List<QuestionInfoExcelTypeVo> questionInfoExcelTypeVos = questionInfoMapper.selectIssueType1();
+            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++){
+                try {
+                    QuestionInfoExcelTypeVo questionInfoExcelTypeVo =  questionInfoExcelTypeVos.get(index);
+                    List<QuestionInfoExcelVo> questionInfoExcelVos = questionInfoMapper.selecQuestionInfoExcel1(questionInfoExcelTypeVo.getTypeId());
+                    exportExcel(workbook, index,questionInfoExcelTypeVo.getTitle().replaceAll("/","|") , headers, questionInfoExcelVos, out);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+            //原理就是将所有的数据一起写入,然后再关闭输入流。
+            workbook.write(out);
+            out.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Test
+    public void test2() throws Exception {
+        try {
+            OutputStream out = new FileOutputStream("D:\\精选专题.xls");
+            List<QuestionInfoExcelTypeVo> questionInfoExcelTypeVos = questionInfoMapper.selectIssueType2();
+            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++){
+                try {
+                    QuestionInfoExcelTypeVo questionInfoExcelTypeVo =  questionInfoExcelTypeVos.get(index);
+                    List<QuestionInfoExcelVo> questionInfoExcelVos = questionInfoMapper.selecQuestionInfoExcel2(questionInfoExcelTypeVo.getTypeId());
+                    exportExcel(workbook, index,questionInfoExcelTypeVo.getTitle().replaceAll("/","|") , headers, questionInfoExcelVos, out);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+            //原理就是将所有的数据一起写入,然后再关闭输入流。
+            workbook.write(out);
+            out.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Test
+    public void test3() throws Exception {
+        try {
+            OutputStream out = new FileOutputStream("D:\\地方专题.xls");
+            List<QuestionInfoExcelTypeVo> questionInfoExcelTypeVos = questionInfoMapper.selectIssueType3();
+            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++){
+                try {
+                    QuestionInfoExcelTypeVo questionInfoExcelTypeVo =  questionInfoExcelTypeVos.get(index);
+                    List<QuestionInfoExcelVo> questionInfoExcelVos = questionInfoMapper.selecQuestionInfoExcel3(questionInfoExcelTypeVo.getTypeId());
+                    exportExcel(workbook, index,questionInfoExcelTypeVo.getTitle().replaceAll("/","|") , headers, questionInfoExcelVos, out);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+            //原理就是将所有的数据一起写入,然后再关闭输入流。
+            workbook.write(out);
+            out.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Test
+    public void test4() throws Exception {
+        try {
+            OutputStream out = new FileOutputStream("D:\\顺序练习.xls");
+            List<QuestionInfoExcelTypeVo> questionInfoExcelTypeVos = questionInfoMapper.selectIssueType4();
+            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++){
+                try {
+                    QuestionInfoExcelTypeVo questionInfoExcelTypeVo =  questionInfoExcelTypeVos.get(index);
+                    List<QuestionInfoExcelVo> questionInfoExcelVos = questionInfoMapper.selecQuestionInfoExcel4(questionInfoExcelTypeVo.getTypeId());
+                    exportExcel(workbook, index,questionInfoExcelTypeVo.getTitle().replaceAll("/","|") , headers, questionInfoExcelVos, out);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+            //原理就是将所有的数据一起写入,然后再关闭输入流。
+            workbook.write(out);
+            out.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+
+
+    /**
+     * @Title: exportExcel
+     * @Description: 导出Excel的方法
+     * @author: evan @ 2014-01-09
+     * @param workbook
+     * @param sheetNum (sheet的位置,0表示第一个表格中的第一个sheet)
+     * @param sheetTitle  (sheet的名称)
+     * @param headers    (表格的标题)
+     * @param result   (表格的数据)
+     * @param out  (输出流)
+     * @throws Exception
+     */
+    public void exportExcel(HSSFWorkbook workbook, int sheetNum,
+                            String sheetTitle, String[] headers, List<QuestionInfoExcelVo> result,
+                            OutputStream out) throws Exception {
+        // 生成一个表格
+        HSSFSheet sheet = workbook.createSheet();
+        workbook.setSheetName(sheetNum, sheetTitle);
+        // 设置表格默认列宽度为20个字节
+        sheet.setDefaultColumnWidth((short) 20);
+        // 生成一个样式
+        HSSFCellStyle style = workbook.createCellStyle();
+        // 把字体应用到当前的样式
+        // 指定当单元格内容显示不下时自动换行
+        style.setWrapText(true);
+
+        // 产生表格标题行
+        HSSFRow row = sheet.createRow(0);
+        for (int i = 0; i < headers.length; i++) {
+            HSSFCell cell = row.createCell((short) i);
+
+            cell.setCellStyle(style);
+            HSSFRichTextString text = new HSSFRichTextString(headers[i]);
+            cell.setCellValue(text.toString());
+        }
+        // 遍历集合数据,产生数据行
+        if (result != null) {
+            int index =1;
+            for (QuestionInfoExcelVo vo : result) {
+                row = sheet.createRow(index);
+                HSSFCell cell = row.createCell(0);
+                cell.setCellValue(vo.getId());
+                cell = row.createCell(1);
+                cell.setCellValue(vo.getNumber());
+                cell = row.createCell(2);
+                cell.setCellValue(vo.getIssue());
+                cell = row.createCell(3);
+                cell.setCellValue(vo.getImage());
+                cell = row.createCell(4);
+                cell.setCellValue(vo.getExcellIssueName());
+                cell = row.createCell(5);
+                cell.setCellValue(vo.getClassIssueName());
+                cell = row.createCell(6);
+                cell.setCellValue(vo.getSequeIssueName());
+                cell = row.createCell(7);
+                cell.setCellValue(vo.getPlaceIssueName());
+                cell = row.createCell(8);
+                cell.setCellValue(vo.getQuestionType());
+                cell = row.createCell(9);
+                cell.setCellValue("");
+                index++;
+            }
+        }
+    }
+
+
+
 
 
 

+ 60 - 0
twzd-common/src/main/java/com/miaxis/common/utils/poi/ExportExcelUtils.java

@@ -0,0 +1,60 @@
+package com.miaxis.common.utils.poi;
+
+import org.apache.poi.hssf.usermodel.*;
+
+import java.io.OutputStream;
+import java.util.List;
+
+public class ExportExcelUtils {
+
+    /**
+     * @Title: exportExcel
+     * @Description: 导出Excel的方法
+     * @author: evan @ 2014-01-09
+     * @param workbook
+     * @param sheetNum (sheet的位置,0表示第一个表格中的第一个sheet)
+     * @param sheetTitle  (sheet的名称)
+     * @param headers    (表格的标题)
+     * @param result   (表格的数据)
+     * @param out  (输出流)
+     * @throws Exception
+     */
+    public void exportExcel(HSSFWorkbook workbook, int sheetNum,
+                            String sheetTitle, String[] headers, List<List<String>> result,
+                            OutputStream out) throws Exception {
+        // 生成一个表格
+        HSSFSheet sheet = workbook.createSheet();
+        workbook.setSheetName(sheetNum, sheetTitle);
+        // 设置表格默认列宽度为20个字节
+        sheet.setDefaultColumnWidth((short) 20);
+        // 生成一个样式
+        HSSFCellStyle style = workbook.createCellStyle();
+        // 把字体应用到当前的样式
+        // 指定当单元格内容显示不下时自动换行
+        style.setWrapText(true);
+
+        // 产生表格标题行
+        HSSFRow row = sheet.createRow(0);
+        for (int i = 0; i < headers.length; i++) {
+            HSSFCell cell = row.createCell((short) i);
+
+            cell.setCellStyle(style);
+            HSSFRichTextString text = new HSSFRichTextString(headers[i]);
+            cell.setCellValue(text.toString());
+        }
+        // 遍历集合数据,产生数据行
+        if (result != null) {
+            int index = 1;
+            for (List<String> m : result) {
+                row = sheet.createRow(index);
+                int cellIndex = 0;
+                for (String str : m) {
+                    HSSFCell cell = row.createCell((short) cellIndex);
+                    cell.setCellValue(str.toString());
+                    cellIndex++;
+                }
+                index++;
+            }
+        }
+    }
+}

+ 37 - 0
twzd-service/src/main/java/com/miaxis/question/dto/QuestionInfoSortDTO.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 QuestionInfoSortDTO 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;
+
+
+}

+ 30 - 0
twzd-service/src/main/java/com/miaxis/question/dto/QuestionInfoSortUpateDTO.java

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

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

@@ -1,14 +1,14 @@
 package com.miaxis.question.mapper;
 
-import java.util.List;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.miaxis.question.domain.QuestionInfo;
 import com.miaxis.question.dto.QuestionInfoDTO;
 import com.miaxis.question.dto.QuestionInfoFlDTO;
-import com.miaxis.question.vo.QuestionInfoDfVO;
-import com.miaxis.question.vo.QuestionInfoFlVO;
-import com.miaxis.question.vo.QuestionInfoJxVO;
-import com.miaxis.question.vo.QuestionInfoSxVO;
+import com.miaxis.question.dto.QuestionInfoSortDTO;
+import com.miaxis.question.dto.QuestionInfoSortUpateDTO;
+import com.miaxis.question.vo.*;
+
+import java.util.List;
 
 /**
  * 题库Mapper接口
@@ -36,4 +36,24 @@ public interface QuestionInfoMapper extends BaseMapper<QuestionInfo> {
     List<QuestionInfoFlVO> selectFlQuestionInfo(QuestionInfoFlDTO questionInfoFlDTO);
 
     List<QuestionInfo> selectNormalQuestionInfoList(QuestionInfoDTO questionInfoDTO);
+
+    List<QuestionInfoExcelTypeVo> selectIssueType1();
+
+    List<QuestionInfoExcelVo> selecQuestionInfoExcel1(String issueType);
+
+    List<QuestionInfoExcelTypeVo> selectIssueType2();
+
+    List<QuestionInfoExcelVo> selecQuestionInfoExcel2(String issueType);
+
+    List<QuestionInfoExcelTypeVo> selectIssueType3();
+
+    List<QuestionInfoExcelVo> selecQuestionInfoExcel3(String issueType);
+
+    List<QuestionInfoExcelTypeVo> selectIssueType4();
+
+    List<QuestionInfoExcelVo> selecQuestionInfoExcel4(String issueType);
+
+    List<QuestionInfoExcelVo> selectQuestionInfoSortList(QuestionInfoSortDTO questionInfoSortDTO);
+
+    void updateSortById(QuestionInfoSortUpateDTO dto);
 }

+ 10 - 7
twzd-service/src/main/java/com/miaxis/question/service/IQuestionInfoService.java

@@ -1,14 +1,14 @@
 package com.miaxis.question.service;
 
-import java.util.List;
-import com.miaxis.question.domain.QuestionInfo;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.miaxis.question.domain.QuestionInfo;
 import com.miaxis.question.dto.QuestionInfoDTO;
 import com.miaxis.question.dto.QuestionInfoFlDTO;
-import com.miaxis.question.vo.QuestionInfoDfVO;
-import com.miaxis.question.vo.QuestionInfoFlVO;
-import com.miaxis.question.vo.QuestionInfoJxVO;
-import com.miaxis.question.vo.QuestionInfoSxVO;
+import com.miaxis.question.dto.QuestionInfoSortDTO;
+import com.miaxis.question.dto.QuestionInfoSortUpateDTO;
+import com.miaxis.question.vo.*;
+
+import java.util.List;
 
 /**
  * 题库Service接口
@@ -20,7 +20,7 @@ public interface IQuestionInfoService extends IService<QuestionInfo>{
     /**
      * 查询题库列表
      *
-     * @param questionInfo 题库
+     * @param
      * @return 题库集合
      */
     List<QuestionInfo> selectQuestionInfoList(QuestionInfoDTO questionInfoDTO);
@@ -37,5 +37,8 @@ public interface IQuestionInfoService extends IService<QuestionInfo>{
 
     List<QuestionInfoSxVO> selectSxQuestionInfo(QuestionInfoFlDTO questionInfoFlDTO);
 
+    List<QuestionInfoExcelVo> selectQuestionInfoSortList(QuestionInfoSortDTO questionInfoSortDTO);
+
+    void updateSortById(QuestionInfoSortUpateDTO dto);
 }
 

+ 14 - 5
twzd-service/src/main/java/com/miaxis/question/service/impl/QuestionInfoServiceImpl.java

@@ -4,12 +4,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.miaxis.question.domain.QuestionInfo;
 import com.miaxis.question.dto.QuestionInfoDTO;
 import com.miaxis.question.dto.QuestionInfoFlDTO;
+import com.miaxis.question.dto.QuestionInfoSortDTO;
+import com.miaxis.question.dto.QuestionInfoSortUpateDTO;
 import com.miaxis.question.mapper.QuestionInfoMapper;
 import com.miaxis.question.service.IQuestionInfoService;
-import com.miaxis.question.vo.QuestionInfoDfVO;
-import com.miaxis.question.vo.QuestionInfoFlVO;
-import com.miaxis.question.vo.QuestionInfoJxVO;
-import com.miaxis.question.vo.QuestionInfoSxVO;
+import com.miaxis.question.vo.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -29,7 +28,7 @@ public class QuestionInfoServiceImpl extends ServiceImpl<QuestionInfoMapper, Que
     /**
      * 查询题库列表
      *
-     * @param questionInfo 题库
+     * @param
      * @return 题库
      */
     @Override
@@ -67,4 +66,14 @@ public class QuestionInfoServiceImpl extends ServiceImpl<QuestionInfoMapper, Que
         return questionInfoMapper.selectSxQuestionInfo(questionInfoFlDTO);
     }
 
+    @Override
+    public List<QuestionInfoExcelVo> selectQuestionInfoSortList(QuestionInfoSortDTO questionInfoSortDTO) {
+        return questionInfoMapper.selectQuestionInfoSortList(questionInfoSortDTO);
+    }
+
+    @Override
+    public void updateSortById(QuestionInfoSortUpateDTO dto) {
+        questionInfoMapper.updateSortById(dto);
+    }
+
 }

+ 29 - 0
twzd-service/src/main/java/com/miaxis/question/vo/QuestionInfoExcelTypeVo.java

@@ -0,0 +1,29 @@
+package com.miaxis.question.vo;
+
+import com.miaxis.common.core.domain.BaseBusinessEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 分类专题分类返回对象
+ * @author miaxis
+ * @date 2021-10-20
+ */
+@Data
+@ApiModel(value = "QuestionInfoExcelVo", description = "分类专题分类返回对象")
+public class QuestionInfoExcelTypeVo extends BaseBusinessEntity{
+    private static final long serialVersionUID = 1L;
+
+
+    @ApiModelProperty(value = "分类题(包含科一到科四)")
+    private String  title;
+
+    /** 题目在地方中所属的模块名称 */
+    @ApiModelProperty(value = "题目在分类中所属的模块名称")
+    private String typeId;
+
+
+
+
+}

+ 47 - 0
twzd-service/src/main/java/com/miaxis/question/vo/QuestionInfoExcelVo.java

@@ -0,0 +1,47 @@
+package com.miaxis.question.vo;
+
+import com.miaxis.common.core.domain.BaseBusinessEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 分类专题分类返回对象
+ * @author miaxis
+ * @date 2021-10-20
+ */
+@Data
+@ApiModel(value = "QuestionInfoExcelVo", description = "")
+public class QuestionInfoExcelVo extends BaseBusinessEntity{
+    private static final long serialVersionUID = 1L;
+
+
+    @ApiModelProperty("题目id")
+    private long id;
+
+    @ApiModelProperty("在所有题目中的序号")
+    private Integer number;
+
+    @ApiModelProperty("题目图片URL")
+    private String image;
+    @ApiModelProperty("题目")
+    private String issue;
+
+    @ApiModelProperty("精选模块名称")
+    private String excellIssueName;
+
+    @ApiModelProperty("地方专题模块名称")
+    private String placeIssueName;
+    @ApiModelProperty("分类模块名称")
+    private String classIssueName;
+    @ApiModelProperty("顺序联系模块名称")
+    private String sequeIssueName;
+    @ApiModelProperty("题目类型 1判断题 2选择题 3多选")
+    private String questionType;
+    @ApiModelProperty("排序")
+    private Integer sort;
+
+
+
+
+}

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

@@ -230,5 +230,133 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         seque_issue + 0 ASC
     </select>
 
+    <select id="selectIssueType1"  resultType="com.miaxis.question.vo.QuestionInfoExcelTypeVo">
+        		SELECT
+                    DISTINCT case WHEN class_issue_name is null then '地方专题' else class_issue_name end as title,
+                     class_issue  as type_id
+                    FROM
+                     question_info
+                    WHERE
+                     subject_1 = 1
+                     AND lice_car = 1 and
+                     class_issue_name is not null
+                    ORDER BY
+                     class_issue + 0 ASC
+    </select>
+
+
+    <select id="selecQuestionInfoExcel1"  resultType="com.miaxis.question.vo.QuestionInfoExcelVo">
+        SELECT id,
+             number,
+             issue,
+             image,
+             excell_issue_name,
+             class_issue_name,
+              place_issue_name,
+              seque_issue_name,
+             question_type  FROM question_info WHERE class_issue = #{typeId} and subject_1 =1 and lice_car = 1
+    </select>
+
+    <select id="selectIssueType2"  resultType="com.miaxis.question.vo.QuestionInfoExcelTypeVo">
+        		SELECT
+                    DISTINCT case WHEN excell_issue_name is null then '地方专题' else excell_issue_name end as title,
+                     excell_issue as type_id
+                    FROM
+                     question_info
+                    WHERE
+                     subject_1 = 1
+                     AND lice_car = 1 and
+                     excell_issue_name is not null
+                    ORDER BY
+                     excell_issue + 0 ASC
+    </select>
+
+
+    <select id="selecQuestionInfoExcel2"  resultType="com.miaxis.question.vo.QuestionInfoExcelVo">
+        SELECT id,
+             number,
+             issue,
+             image,
+             excell_issue_name,
+             class_issue_name,
+              place_issue_name,
+               seque_issue_name,
+             question_type  FROM question_info WHERE excell_issue = #{typeId} and subject_1 =1 and lice_car = 1
+    </select>
+
+
+    <select id="selectIssueType3"  resultType="com.miaxis.question.vo.QuestionInfoExcelTypeVo">
+        		SELECT
+                    DISTINCT case WHEN place_issue_name is null then '地方专题' else place_issue_name end as title,
+                     place_issue as type_id
+                    FROM
+                     question_info
+                    WHERE
+                     subject_1 = 1
+                     AND lice_car = 1 and
+                     place_issue_name is not null
+                    ORDER BY
+                     place_issue + 0 ASC
+    </select>
+
+
+    <select id="selecQuestionInfoExcel3"  resultType="com.miaxis.question.vo.QuestionInfoExcelVo">
+        SELECT id,
+             number,
+             issue,
+             image,
+             excell_issue_name,
+             class_issue_name,
+              place_issue_name,
+              seque_issue_name,
+             question_type  FROM question_info WHERE  place_issue  = #{typeId} and subject_1 =1 and lice_car = 1
+    </select>
+
+
+    <select id="selectIssueType4"  resultType="com.miaxis.question.vo.QuestionInfoExcelTypeVo">
+        		SELECT
+                    DISTINCT case WHEN seque_issue_name is null then '地方专题' else seque_issue_name end as title,
+                     seque_issue as type_id
+                    FROM
+                     question_info
+                    WHERE
+                     subject_1 = 1
+                     AND lice_car = 1 and
+                     seque_issue_name is not null
+                    ORDER BY
+                     seque_issue + 0 ASC
+    </select>
+
+
+    <select id="selecQuestionInfoExcel4"  resultType="com.miaxis.question.vo.QuestionInfoExcelVo">
+        SELECT id,
+             number,
+             issue,
+             image,
+             excell_issue_name,
+             class_issue_name,
+              place_issue_name,
+              seque_issue_name,
+             question_type  FROM question_info WHERE  seque_issue  = #{typeId} and subject_1 =1 and lice_car = 1
+    </select>
+
+
+    <select id="selectQuestionInfoSortList"  resultType="com.miaxis.question.vo.QuestionInfoExcelVo">
+        SELECT id,
+             number,
+             issue,
+             image,
+             excell_issue_name,
+             class_issue_name,
+              place_issue_name,
+              seque_issue_name,
+              ${sortName} as sort,
+             question_type  FROM question_info WHERE  ${issueTypeParmName}  = #{issueValue} and subject =#{subject} and lice_car = 1 order by ${sortName}
+    </select>
+
+    <select id="updateSortById"  >
+        update question_info set ${sortName} = #{sort} WHERE  id = #{id}
+    </select>
+
 
 </mapper>