wangwei 6 vuotta sitten
vanhempi
commit
ee20f7d4a2

+ 7 - 1
examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/impl/StudentServiceImpl.java

@@ -70,8 +70,14 @@ public class StudentServiceImpl implements StudentService {
 
 		if (null != orgId) {
 			OrgEntity org = orgRepo.findOne(orgId);
+			if (null == org) {
+				throw new StatusException("B-160050", "orgId is wrong");
+			}
 			if (!org.getRootId().equals(rootOrgId)) {
-				throw new StatusException("B-160002", "orgId is wrong");
+				throw new StatusException("B-160052", "orgId is wrong");
+			}
+			if (!org.getParentId().equals(rootOrgId)) {
+				throw new StatusException("B-160051", "orgId is wrong");
 			}
 		} else if (StringUtils.isNotBlank(orgCode)) {
 			OrgEntity org = orgRepo.findByRootIdAndCode(rootOrgId, orgCode);