wangwei 6 years ago
parent
commit
87e51ef824

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

@@ -269,9 +269,8 @@ public class OrgServiceImpl implements OrgService {
 			throw new StatusException("E-001004", "该机构非子机构");
 		}
 		Long rootId = orgEntity.getRootId();
-		Long parentId = orgEntity.getParentId();
 
-		if (0 < orgRepo.countByRootIdAndParentId(rootId, parentId)) {
+		if (0 < orgRepo.countByRootIdAndParentId(rootId, orgEntity.getId())) {
 			throw new StatusException("E-001004", "该机构有子机构");
 		}