|
@@ -38,6 +38,7 @@ import cn.com.qmth.examcloud.core.questions.dao.entity.Question;
|
|
import cn.com.qmth.examcloud.core.questions.base.CommonUtils;
|
|
import cn.com.qmth.examcloud.core.questions.base.CommonUtils;
|
|
import cn.com.qmth.examcloud.core.questions.base.enums.PaperType;
|
|
import cn.com.qmth.examcloud.core.questions.base.enums.PaperType;
|
|
import cn.com.qmth.examcloud.core.questions.base.question.enums.QuesStructType;
|
|
import cn.com.qmth.examcloud.core.questions.base.question.enums.QuesStructType;
|
|
|
|
+import cn.com.qmth.examcloud.commons.base.exception.StatusException;
|
|
import cn.com.qmth.examcloud.commons.base.logging.ExamCloudLog;
|
|
import cn.com.qmth.examcloud.commons.base.logging.ExamCloudLog;
|
|
import cn.com.qmth.examcloud.commons.base.logging.ExamCloudLogFactory;
|
|
import cn.com.qmth.examcloud.commons.base.logging.ExamCloudLogFactory;
|
|
import cn.com.qmth.examcloud.commons.web.security.bean.User;
|
|
import cn.com.qmth.examcloud.commons.web.security.bean.User;
|
|
@@ -81,6 +82,9 @@ public class GenPaperService {
|
|
//查询试卷结构
|
|
//查询试卷结构
|
|
long start = System.currentTimeMillis();
|
|
long start = System.currentTimeMillis();
|
|
PaperStruct paperStruct = paperStructRepo.findOne(genPaperDto.getPaperStructId());
|
|
PaperStruct paperStruct = paperStructRepo.findOne(genPaperDto.getPaperStructId());
|
|
|
|
+ if(paperStruct == null){
|
|
|
|
+ throw new StatusException("Q-030086", "试卷结构不存在");
|
|
|
|
+ }
|
|
PaperContext paperContext = new PaperContext(paperStruct, genPaperDto.getConditions());
|
|
PaperContext paperContext = new PaperContext(paperStruct, genPaperDto.getConditions());
|
|
List<UnitContext> unitContexts = new LinkedList<UnitContext>();
|
|
List<UnitContext> unitContexts = new LinkedList<UnitContext>();
|
|
List<DetailContext> detailContexts = paperContext.getDetails();
|
|
List<DetailContext> detailContexts = paperContext.getDetails();
|
|
@@ -869,6 +873,9 @@ public class GenPaperService {
|
|
//查询试卷结构
|
|
//查询试卷结构
|
|
long start = System.currentTimeMillis();
|
|
long start = System.currentTimeMillis();
|
|
PaperStruct paperStruct = paperStructRepo.findOne(genPaperDto.getPaperStructId());
|
|
PaperStruct paperStruct = paperStructRepo.findOne(genPaperDto.getPaperStructId());
|
|
|
|
+ if(paperStruct == null){
|
|
|
|
+ throw new StatusException("Q-030086", "试卷结构不存在");
|
|
|
|
+ }
|
|
PaperContext paperContext = new PaperContext(paperStruct, genPaperDto.getConditions());
|
|
PaperContext paperContext = new PaperContext(paperStruct, genPaperDto.getConditions());
|
|
List<UnitContext> unitContexts = new LinkedList<UnitContext>();
|
|
List<UnitContext> unitContexts = new LinkedList<UnitContext>();
|
|
List<DetailContext> detailContexts = paperContext.getDetails();
|
|
List<DetailContext> detailContexts = paperContext.getDetails();
|