he2802 2 лет назад
Родитель
Сommit
3a3112b452

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/domain/ExamSimulate.java

@@ -47,5 +47,5 @@ private static final long serialVersionUID=1L;
     /** 试卷类型id */
     private Long examPaperId;
     /** 1题库商品 2视频商品 3模考商品 */
-    private Integer from;
+    private Integer fromType;
 }

+ 7 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamSimulateServiceImpl.java

@@ -92,6 +92,7 @@ public class ExamSimulateServiceImpl extends ServiceImpl<ExamSimulateMapper, Exa
     @Transactional(rollbackFor = Exception.class)
     public ExamSimulateVo insertByAddBo(ExamSimulateAddBo bo) {
         ExamSimulate add = BeanUtil.toBean(bo, ExamSimulate.class);
+        add.setFromType(bo.getFrom());
         Exam exam = iExamService.getOne(new LambdaQueryWrapper<Exam>().eq(Exam::getExamId, bo.getExamId()));
         if(exam.getDoType()!=2||exam.getSimulateStatus()==0){
             throw new CustomException("该试卷没开启模拟随机考");
@@ -108,6 +109,7 @@ public class ExamSimulateServiceImpl extends ServiceImpl<ExamSimulateMapper, Exa
         qk1Bo.setKnum(simulateConfig.getSingleChoice().getKnum());
         qk1Bo.setRandomNum(simulateConfig.getType());
         qk1Bo.setType(1);
+        qk1Bo.setFrom(bo.getFrom());
         List<Long> qk1 = baseMapper.getKnowledQuestionList(qk1Bo);
 
         ExamSimulateQueryBo qk2Bo = new ExamSimulateQueryBo(); //多选知识点
@@ -116,6 +118,7 @@ public class ExamSimulateServiceImpl extends ServiceImpl<ExamSimulateMapper, Exa
         qk2Bo.setKnum(simulateConfig.getMultipleChoice().getKnum());
         qk2Bo.setRandomNum(simulateConfig.getType());
         qk2Bo.setType(2);
+        qk2Bo.setFrom(bo.getFrom());
         List<Long> qk2 = baseMapper.getKnowledQuestionList(qk2Bo);
 
         ExamSimulateQueryBo qk3Bo = new ExamSimulateQueryBo(); //案例选知识点
@@ -124,6 +127,7 @@ public class ExamSimulateServiceImpl extends ServiceImpl<ExamSimulateMapper, Exa
         qk3Bo.setKnum(simulateConfig.getCaseQuestion().getKnum());
         qk3Bo.setRandomNum(simulateConfig.getType());
         qk3Bo.setType(4);
+        qk3Bo.setFrom(bo.getFrom());
         List<Long> qk3 = baseMapper.getKnowledQuestionList(qk3Bo);
 
         ExamSimulateQueryBo q1Bo = new ExamSimulateQueryBo();  //单选
@@ -132,6 +136,7 @@ public class ExamSimulateServiceImpl extends ServiceImpl<ExamSimulateMapper, Exa
         q1Bo.setQnum(simulateConfig.getSingleChoice().getQnum()-qk1.size());
         q1Bo.setRandomNum(simulateConfig.getType());
         q1Bo.setType(1);
+        q1Bo.setFrom(bo.getFrom());
         List<Long> q1 = baseMapper.getQuestionList(q1Bo);
 
         ExamSimulateQueryBo q2Bo = new ExamSimulateQueryBo();  //多选
@@ -140,6 +145,7 @@ public class ExamSimulateServiceImpl extends ServiceImpl<ExamSimulateMapper, Exa
         q2Bo.setQnum(simulateConfig.getMultipleChoice().getQnum()-qk2.size());
         q2Bo.setRandomNum(simulateConfig.getType());
         q2Bo.setType(2);
+        q2Bo.setFrom(bo.getFrom());
         List<Long> q2 = baseMapper.getQuestionList(q2Bo);
 
         ExamSimulateQueryBo q3Bo = new ExamSimulateQueryBo();  //案例选
@@ -148,6 +154,7 @@ public class ExamSimulateServiceImpl extends ServiceImpl<ExamSimulateMapper, Exa
         q3Bo.setQnum(simulateConfig.getCaseQuestion().getQnum()-qk3.size());
         q3Bo.setRandomNum(simulateConfig.getType());
         q3Bo.setType(4);
+        q3Bo.setFrom(bo.getFrom());
         List<Long> q3 = baseMapper.getQuestionList(q3Bo);
 
         qk1.addAll(q1);

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

@@ -15,7 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="userId" column="user_id"/>
         <result property="orderGoodsId" column="order_goods_id"/>
         <result property="examPaperId" column="exam_paper_id"/>
-        <result property="from" column="from"/>
+        <result property="from" column="from_type"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.bank.vo.QuestionVo" id="QuestionResultVo">