wangwei hace 5 años
padre
commit
e1cf6bc98d

+ 2 - 0
examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/RolePrivilegeController.java

@@ -612,6 +612,7 @@ public class RolePrivilegeController extends ControllerSupport {
 
 		privilegeRepo.deleteById(id);
 		rolePrivilegeRelationRepo.deleteByPrivilegeId(id);
+		rootOrgPrivilegeRelationRepo.deleteByPrivilegeId(id);
 
 		PrivilegeGroupEntity groupEntity = GlobalHelper.getPresentEntity(privilegeGroupRepo,
 				privilege.getGroupId(), PrivilegeGroupEntity.class);
@@ -631,6 +632,7 @@ public class RolePrivilegeController extends ControllerSupport {
 				if (null != p) {
 					privilegeRepo.deleteById(p.getId());
 					rolePrivilegeRelationRepo.deleteByPrivilegeId(p.getId());
+					rootOrgPrivilegeRelationRepo.deleteByPrivilegeId(p.getId());
 				}
 			}
 

+ 2 - 0
examcloud-core-basic-dao/src/main/java/cn/com/qmth/examcloud/core/basic/dao/RootOrgPrivilegeRelationRepo.java

@@ -17,6 +17,8 @@ public interface RootOrgPrivilegeRelationRepo
 
 	void deleteByRootOrgIdAndGroupId(Long rootOrgId, Long groupId);
 
+	void deleteByPrivilegeId(Long privilegeId);
+
 	List<RootOrgPrivilegeRelationEntity> findAllByRootOrgId(Long rootOrgId);
 
 	List<RootOrgPrivilegeRelationEntity> findAllByRootOrgIdAndGroupId(Long rootOrgId, Long groupId);