|
@@ -97,6 +97,7 @@ import cn.com.qmth.examcloud.core.questions.service.PaperDetailUnitService;
|
|
import cn.com.qmth.examcloud.core.questions.service.PaperService;
|
|
import cn.com.qmth.examcloud.core.questions.service.PaperService;
|
|
import cn.com.qmth.examcloud.core.questions.service.QuesService;
|
|
import cn.com.qmth.examcloud.core.questions.service.QuesService;
|
|
import cn.com.qmth.examcloud.core.questions.service.RandomPaperQuestionService;
|
|
import cn.com.qmth.examcloud.core.questions.service.RandomPaperQuestionService;
|
|
|
|
+import cn.com.qmth.examcloud.core.questions.service.RandomPaperService;
|
|
import cn.com.qmth.examcloud.core.questions.service.bean.PaperId;
|
|
import cn.com.qmth.examcloud.core.questions.service.bean.PaperId;
|
|
import cn.com.qmth.examcloud.core.questions.service.bean.dto.DownloadPaperDto;
|
|
import cn.com.qmth.examcloud.core.questions.service.bean.dto.DownloadPaperDto;
|
|
import cn.com.qmth.examcloud.core.questions.service.bean.dto.ObjectiveQuestionStructure;
|
|
import cn.com.qmth.examcloud.core.questions.service.bean.dto.ObjectiveQuestionStructure;
|
|
@@ -189,6 +190,8 @@ public class PaperServiceImpl implements PaperService {
|
|
private BasePaperCache basePaperCache;
|
|
private BasePaperCache basePaperCache;
|
|
@Autowired
|
|
@Autowired
|
|
private RandomPaperQuestionService randomPaperQuestionService;
|
|
private RandomPaperQuestionService randomPaperQuestionService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private RandomPaperService randomPaperService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private QuestionCache questionCache;
|
|
private QuestionCache questionCache;
|
|
@@ -626,6 +629,9 @@ public class PaperServiceImpl implements PaperService {
|
|
if (paper.getInUse() != null && paper.getInUse() == 1) {
|
|
if (paper.getInUse() != null && paper.getInUse() == 1) {
|
|
throw new StatusException("试卷[" + paper.getName() + "]已调用,不能删除");
|
|
throw new StatusException("试卷[" + paper.getName() + "]已调用,不能删除");
|
|
}
|
|
}
|
|
|
|
+ if(randomPaperService.existPaper(Long.valueOf(paper.getCourse().getId()),paper.getId())) {
|
|
|
|
+ throw new StatusException("试卷[" + paper.getName() + "]被抽题模板使用,不能删除");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
paperDetailService.deletePaperDetailsByPapers(papers);
|
|
paperDetailService.deletePaperDetailsByPapers(papers);
|