|
@@ -11,8 +11,10 @@ import cn.com.qmth.stmms.biz.mark.service.ProblemTypeService;
|
|
|
import cn.com.qmth.stmms.common.enums.ExamStatus;
|
|
|
import cn.com.qmth.stmms.common.enums.ExamType;
|
|
|
import cn.com.qmth.stmms.common.enums.ObjectiveStatus;
|
|
|
+
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -22,6 +24,7 @@ import javax.persistence.criteria.CriteriaBuilder;
|
|
|
import javax.persistence.criteria.CriteriaQuery;
|
|
|
import javax.persistence.criteria.Predicate;
|
|
|
import javax.persistence.criteria.Root;
|
|
|
+
|
|
|
import java.util.Date;
|
|
|
import java.util.LinkedList;
|
|
|
import java.util.List;
|
|
@@ -35,6 +38,12 @@ public class ExamServiceImpl extends BaseQueryService<Exam> implements ExamServi
|
|
|
@Autowired
|
|
|
private ProblemTypeService problemService;
|
|
|
|
|
|
+ @Value("${exam.problem.type1}")
|
|
|
+ private String problemType1;
|
|
|
+
|
|
|
+ @Value("${exam.problem.type2}")
|
|
|
+ private String problemType2;
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional
|
|
|
// @CachePut(value = "exam_cache", key = "#exam.id", condition =
|
|
@@ -47,8 +56,8 @@ public class ExamServiceImpl extends BaseQueryService<Exam> implements ExamServi
|
|
|
} else {
|
|
|
exam.setCreateTime(new Date());
|
|
|
examDao.save(exam);
|
|
|
- ProblemType p1 = new ProblemType(exam.getId(), "空白卷", false);
|
|
|
- ProblemType p2 = new ProblemType(exam.getId(), "雷同卷", false);
|
|
|
+ ProblemType p1 = new ProblemType(exam.getId(), problemType1, false);
|
|
|
+ ProblemType p2 = new ProblemType(exam.getId(), problemType2, false);
|
|
|
problemService.save(p1);
|
|
|
problemService.save(p2);
|
|
|
}
|
|
@@ -102,9 +111,8 @@ public class ExamServiceImpl extends BaseQueryService<Exam> implements ExamServi
|
|
|
predicates.add(cb.equal(root.get("code"), query.getCode()));
|
|
|
}
|
|
|
|
|
|
- return predicates.isEmpty() ?
|
|
|
- cb.conjunction() :
|
|
|
- cb.and(predicates.toArray(new Predicate[predicates.size()]));
|
|
|
+ return predicates.isEmpty() ? cb.conjunction() : cb.and(predicates.toArray(new Predicate[predicates
|
|
|
+ .size()]));
|
|
|
}
|
|
|
}, query);
|
|
|
fillResult(result, query);
|