wangwei 6 жил өмнө
parent
commit
6686ac97e3

+ 16 - 0
examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/provider/ExamCloudServiceProvider.java

@@ -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()]));
 		};