Ver código fonte

fix 题库模块

he2802 4 anos atrás
pai
commit
b9f85d6ae6

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

@@ -3,13 +3,12 @@ package com.zhongzheng.controller.bank;
 import java.util.List;
 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.bo.*;
 import com.zhongzheng.modules.bank.domain.QuestionBusiness;
+import com.zhongzheng.modules.bank.service.IExamQuestionService;
 import com.zhongzheng.modules.bank.service.IExamService;
 import com.zhongzheng.modules.bank.service.IQuestionBusinessService;
+import com.zhongzheng.modules.bank.vo.ExamQuestionVo;
 import com.zhongzheng.modules.bank.vo.ExamVo;
 import lombok.RequiredArgsConstructor;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -47,6 +46,8 @@ public class ExamController extends BaseController {
 
     private final IQuestionBusinessService iQuestionBusinessService;
 
+    private final IExamQuestionService iExamQuestionService;
+
     /**
      * 查询试卷列表
      */
@@ -125,4 +126,15 @@ public class ExamController extends BaseController {
         List<QuestionBusiness> list = iQuestionBusinessService.getListById(bo);
         return getDataTable(list);
     }
+
+    /**
+     * 查询题目业务层次关系列表
+     */
+    @ApiOperation("查询业务层次关系列表")
+    @PreAuthorize("@ss.hasPermi('system:business:list')")
+    @GetMapping("/question/list")
+    public AjaxResult<List<ExamQuestionVo>> questionList(ExamQuestionQueryBo bo) {
+        List<ExamQuestionVo> list = iExamQuestionService.getList(bo);
+        return AjaxResult.success(list);
+    }
 }

+ 7 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/mapper/ExamQuestionMapper.java

@@ -1,7 +1,13 @@
 package com.zhongzheng.modules.bank.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.bank.bo.ExamQuestionQueryBo;
+import com.zhongzheng.modules.bank.bo.QuestionBusinessQueryBo;
 import com.zhongzheng.modules.bank.domain.ExamQuestion;
+import com.zhongzheng.modules.bank.domain.QuestionBusiness;
+import com.zhongzheng.modules.bank.vo.ExamQuestionVo;
+
+import java.util.List;
 
 /**
  * 试卷题目关系Mapper接口
@@ -10,5 +16,5 @@ import com.zhongzheng.modules.bank.domain.ExamQuestion;
  * @date 2021-10-22
  */
 public interface ExamQuestionMapper extends BaseMapper<ExamQuestion> {
-
+    List<ExamQuestionVo> getList(ExamQuestionQueryBo bo);
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IExamQuestionService.java

@@ -28,6 +28,8 @@ public interface IExamQuestionService extends IService<ExamQuestion> {
 	 */
 	List<ExamQuestionVo> queryList(ExamQuestionQueryBo bo);
 
+	List<ExamQuestionVo> getList(ExamQuestionQueryBo bo);
+
 	/**
 	 * 根据新增业务对象插入试卷题目关系
 	 * @param bo 试卷题目关系新增业务对象

+ 9 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamQuestionServiceImpl.java

@@ -10,6 +10,7 @@ import com.zhongzheng.modules.bank.domain.ExamQuestion;
 import com.zhongzheng.modules.bank.mapper.ExamQuestionMapper;
 import com.zhongzheng.modules.bank.service.IExamQuestionService;
 import com.zhongzheng.modules.bank.vo.ExamQuestionVo;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -30,6 +31,9 @@ import java.util.stream.Collectors;
 @Service
 public class ExamQuestionServiceImpl extends ServiceImpl<ExamQuestionMapper, ExamQuestion> implements IExamQuestionService {
 
+    @Autowired
+    private ExamQuestionMapper examQuestionMapper;
+
     @Override
     public ExamQuestionVo queryById(Long id){
         ExamQuestion db = this.baseMapper.selectById(id);
@@ -45,6 +49,11 @@ public class ExamQuestionServiceImpl extends ServiceImpl<ExamQuestionMapper, Exa
         return entity2Vo(this.list(lqw));
     }
 
+    @Override
+    public List<ExamQuestionVo> getList(ExamQuestionQueryBo bo) {
+        return examQuestionMapper.getList(bo);
+    }
+
     /**
     * 实体类转化成视图对象
     *

+ 63 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/ExamQuestionVo.java

@@ -46,4 +46,67 @@ public class ExamQuestionVo {
 	@Excel(name = "多选 每项部分分,默认0分则不开启")
 	@ApiModelProperty("多选 每项部分分,默认0分则不开启")
 	private BigDecimal partScore;
+
+
+
+	/** 题目正文 */
+	@Excel(name = "题目正文")
+	@ApiModelProperty("题目正文")
+	private String content;
+	/** 类型 1单选 2多选 3判断题 4简答题 5案列题 */
+	@Excel(name = "类型 1单选 2多选 3判断题 4简答题 5案列题")
+	@ApiModelProperty("类型 1单选 2多选 3判断题 4简答题 5案列题")
+	private Integer type;
+	/** 答案  判断题1正确 0错误; 单选为数字; 多选数字用,拼接; 从1坐标开始; */
+	@Excel(name = "答案  判断题1正确 0错误; 单选为数字; 多选数字用,拼接; 从1坐标开始;")
+	@ApiModelProperty("答案  判断题1正确 0错误; 单选为数字; 多选数字用,拼接; 从1坐标开始;")
+	private String answerQuestion;
+	/**  状态 1正常 0关闭 */
+	@Excel(name = " 状态 1正常 0关闭")
+	@ApiModelProperty(" 状态 1正常 0关闭")
+	private Integer status;
+	/** 解析文本 */
+	@Excel(name = "解析文本")
+	@ApiModelProperty("解析文本")
+	private String analysisContent;
+	/** 图片地址,多个,拼接 */
+	@Excel(name = "图片地址,多个,拼接")
+	@ApiModelProperty("图片地址,多个,拼接")
+	private String imgUrl;
+	/** 问题内容 */
+	@Excel(name = "问题内容")
+	@ApiModelProperty("问题内容")
+	private String jsonStr;
+	/** 前缀名称 */
+	@Excel(name = "前缀名称")
+	@ApiModelProperty("前缀名称")
+	private String prefixName;
+	/** 知识点id用,拼接 */
+	@Excel(name = "知识点id用,拼接")
+	@ApiModelProperty("知识点id用,拼接")
+	private String knowledgeIds;
+	/** 发布状态 1发布 0未发布 */
+	@Excel(name = "发布状态 1发布 0未发布")
+	@ApiModelProperty("发布状态 1发布 0未发布")
+	private Integer publishStatus;
+	/** 教育类型ID */
+	@Excel(name = "教育类型ID")
+	@ApiModelProperty("教育类型ID")
+	private Long educationTypeId;
+	/** 业务层次id */
+	@Excel(name = "业务层次id")
+	@ApiModelProperty("业务层次id")
+	private Long businessId;
+	/** 科目id */
+	@Excel(name = "科目id")
+	@ApiModelProperty("科目id")
+	private Long subjectId;
+	/** 项目ID */
+	@Excel(name = "项目ID")
+	@ApiModelProperty("项目ID")
+	private Long projectId;
+	/** 编码 */
+	@Excel(name = "编码")
+	@ApiModelProperty("编码")
+	private String code;
 }

+ 36 - 0
zhongzheng-system/src/main/resources/mapper/modules/bank/ExamQuestionMapper.xml

@@ -13,5 +13,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="partScore" column="part_score"/>
     </resultMap>
 
+    <resultMap type="com.zhongzheng.modules.bank.domain.ExamQuestion" id="ExamQuestionResultVo">
+        <result property="id" column="id"/>
+        <result property="examId" column="exam_id"/>
+        <result property="questionId" column="question_id"/>
+        <result property="sort" column="sort"/>
+        <result property="score" column="score"/>
+        <result property="partScore" column="part_score"/>
+        <result property="content" column="content"/>
+        <result property="type" column="type"/>
+        <result property="answerQuestion" column="answer_question"/>
+        <result property="status" column="status"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="analysisContent" column="analysis_content"/>
+        <result property="imgUrl" column="img_url"/>
+        <result property="jsonStr" column="json_str"/>
+        <result property="prefixName" column="prefix_name"/>
+        <result property="knowledgeIds" column="knowledge_ids"/>
+        <result property="publishStatus" column="publish_status"/>
+        <result property="code" column="code"/>
+    </resultMap>
+
+    <select id="getList" parameterType="com.zhongzheng.modules.bank.bo.ExamQuestionQueryBo" resultMap="ExamQuestionResultVo">
+        SELECT
+        q.*,
+        eq.part_score,
+        eq.score,
+        eq.sort
+        FROM
+        exam_question eq
+        LEFT JOIN question q ON eq.question_id = q.question_id
+        WHERE
+              eq.exam_id =#{businessId}
+
+
 
+    </select>
 </mapper>