|
@@ -132,6 +132,7 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public ExamVo insertByAddBo(ExamAddBo bo) {
|
|
|
Exam add = BeanUtil.toBean(bo, Exam.class);
|
|
|
+ add.setSimulateConfig(bo.getSimulateConfigJson());
|
|
|
add.setCode(ServletUtils.getEncoded("SJ"));
|
|
|
validEntityBeforeSave(add);
|
|
|
add.setCreateTime(DateUtils.getNowTime());
|
|
@@ -182,6 +183,7 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
|
|
|
throw new CustomException("试卷ID缺失");
|
|
|
}
|
|
|
Exam update = BeanUtil.toBean(bo, Exam.class);
|
|
|
+ update.setSimulateConfig(bo.getSimulateConfigJson());
|
|
|
validEntityBeforeSave(update);
|
|
|
update.setUpdateTime(DateUtils.getNowTime());
|
|
|
if(bo.getQuestionList()!=null){
|
|
@@ -243,22 +245,22 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
|
|
|
}
|
|
|
}
|
|
|
if(Validator.isNotEmpty(entity.getSimulateConfig())){
|
|
|
- Integer q1 = entity.getSimulateConfig().getSingleChoice().getQNum();
|
|
|
- Integer q2 = entity.getSimulateConfig().getMultipleChoice().getQNum();
|
|
|
- Integer q3 = entity.getSimulateConfig().getCaseQuestion().getQNum();
|
|
|
- if((q1>0)&&(q1<entity.getSimulateConfig().getSingleChoice().getKNum())){
|
|
|
+ Integer q1 = entity.getSimulateConfig().getSingleChoice().getQnum();
|
|
|
+ Integer q2 = entity.getSimulateConfig().getMultipleChoice().getQnum();
|
|
|
+ Integer q3 = entity.getSimulateConfig().getCaseQuestion().getQnum();
|
|
|
+ if((q1>0)&&(q1<entity.getSimulateConfig().getSingleChoice().getKnum())){
|
|
|
throw new CustomException("模拟配置单选题参数错误");
|
|
|
}
|
|
|
if(entity.getSimulateConfig().getSingleChoice().getOrderNum()>3){
|
|
|
throw new CustomException("模拟配置单选题参数错误");
|
|
|
}
|
|
|
- if((q2>0)&&(q2<entity.getSimulateConfig().getMultipleChoice().getKNum())){
|
|
|
+ if((q2>0)&&(q2<entity.getSimulateConfig().getMultipleChoice().getKnum())){
|
|
|
throw new CustomException("模拟配置多选题参数错误");
|
|
|
}
|
|
|
if(entity.getSimulateConfig().getMultipleChoice().getOrderNum()>3){
|
|
|
throw new CustomException("模拟配置多选题参数错误");
|
|
|
}
|
|
|
- if((q3>0)&&(q3<entity.getSimulateConfig().getCaseQuestion().getKNum())){
|
|
|
+ if((q3>0)&&(q3<entity.getSimulateConfig().getCaseQuestion().getKnum())){
|
|
|
throw new CustomException("模拟配置案例题参数错误");
|
|
|
}
|
|
|
if(entity.getSimulateConfig().getCaseQuestion().getOrderNum()>3){
|