|
@@ -3,6 +3,7 @@ package com.zhongzheng.modules.bank.service.impl;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.lang.Validator;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
@@ -131,6 +132,9 @@ 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);
|
|
|
+ if(Validator.isNotEmpty(bo.getSimulateConfig())){
|
|
|
+ add.setSimulateConfigJson(JSON.toJSONString(bo.getSimulateConfig()));
|
|
|
+ }
|
|
|
add.setCode(ServletUtils.getEncoded("SJ"));
|
|
|
validEntityBeforeSave(add);
|
|
|
add.setCreateTime(DateUtils.getNowTime());
|
|
@@ -181,6 +185,9 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
|
|
|
throw new CustomException("试卷ID缺失");
|
|
|
}
|
|
|
Exam update = BeanUtil.toBean(bo, Exam.class);
|
|
|
+ if(Validator.isNotEmpty(bo.getSimulateConfig())){
|
|
|
+ update.setSimulateConfigJson(JSON.toJSONString(bo.getSimulateConfig()));
|
|
|
+ }
|
|
|
validEntityBeforeSave(update);
|
|
|
update.setUpdateTime(DateUtils.getNowTime());
|
|
|
if(bo.getQuestionList()!=null){
|
|
@@ -236,6 +243,7 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
|
|
|
throw new CustomException("该卷已被绑定,不允许修改发布状态为未发布");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|