|
@@ -23,12 +23,14 @@ import com.ynfy.buss.exam.question.enums.QuestionType;
|
|
|
import com.ynfy.buss.exam.question.service.IQuestionService;
|
|
|
import com.ynfy.buss.exam.questionanswer.entity.QuestionAnswer;
|
|
|
import com.ynfy.buss.exam.repository.service.IRepositoryService;
|
|
|
+import com.ynfy.buss.exam.userexam.service.IUserExamService;
|
|
|
import com.ynfy.common.utils.ThreadPoolUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.jeecg.common.exception.JeecgBootException;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
@@ -67,9 +69,17 @@ public class PaperServiceImpl extends ServiceImpl<PaperMapper, Paper> implements
|
|
|
@Autowired
|
|
|
private IRepositoryService repositoryService;
|
|
|
|
|
|
+ @Lazy
|
|
|
+ @Autowired
|
|
|
+ private IUserExamService userExamService;
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void save(PaperDTO paperDTO) {
|
|
|
+ //检查试卷是否正在用于考试
|
|
|
+ if (StringUtils.isNotBlank(paperDTO.getId()) && userExamService.checkPaperInExam(paperDTO.getId())) {
|
|
|
+ throw new JeecgBootException("该试卷有正在进行中的考试,不允许修改!");
|
|
|
+ }
|
|
|
//校验数据
|
|
|
checkData(paperDTO);
|
|
|
//校验分数
|