WANG 6 年之前
父节点
当前提交
b1ff79305e

+ 8 - 2
examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/ExamController.java

@@ -316,11 +316,17 @@ public class ExamController extends ControllerSupport {
 			@RequestParam(required = false) String examTypes,
 			@RequestParam(required = false) Boolean enable,
 			@RequestParam(required = false) String propertyKeys,
-			@RequestParam(required = false) Long studentId) {
+			@RequestParam(required = false) Long studentId,
+			@RequestParam(required = false) Long rootOrgId) {
+
+		if (null == rootOrgId) {
+			rootOrgId = getRootOrgId();
+		}
+		final Long finalRootOrgId = rootOrgId;
 
 		Specification<ExamEntity> specification = (root, query, cb) -> {
 			List<Predicate> predicates = new ArrayList<>();
-			predicates.add(cb.equal(root.get("rootOrgId"), getRootOrgId()));
+			predicates.add(cb.equal(root.get("rootOrgId"), finalRootOrgId));
 			if (StringUtils.isNotBlank(name)) {
 				predicates.add(cb.like(root.get("name"), toSqlSearchPattern(name)));
 			}