|
@@ -212,11 +212,27 @@ public class ExamCloudServiceProvider extends ControllerSupport implements ExamC
|
|
|
|
|
|
Long rootOrgId = req.getRootOrgId();
|
|
|
|
|
|
+ String examType = req.getExamType();
|
|
|
+
|
|
|
+ ExamType et = null;
|
|
|
+ if (StringUtils.isNotBlank(examType)) {
|
|
|
+ try {
|
|
|
+ et = ExamType.valueOf(examType);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new StatusException("E-002005", "examType is wrong");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ final ExamType type = et;
|
|
|
+
|
|
|
Specification<ExamEntity> specification = (root, query, cb) -> {
|
|
|
List<Predicate> predicates = new ArrayList<>();
|
|
|
predicates.add(cb.equal(root.get("rootOrgId"), rootOrgId));
|
|
|
predicates.add(cb.lessThan(root.get("beginTime"), new Date()));
|
|
|
predicates.add(cb.greaterThan(root.get("endTime"), new Date()));
|
|
|
+ if (null != type) {
|
|
|
+ predicates.add(cb.equal(root.get("examType"), type));
|
|
|
+ }
|
|
|
|
|
|
return cb.and(predicates.toArray(new Predicate[predicates.size()]));
|
|
|
};
|