From 2547447c96ab52fc64375923c418a1d5c7e67cbb Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期一, 13 十一月 2023 10:17:37 +0800
Subject: [PATCH] 删除角色时,关联删除角色的分配的权限
---
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleSv.java | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleSv.java
index b6bd5d2..4d8e31c 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleSv.java
@@ -3,6 +3,7 @@
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrBase.user.QueryVo;
import com.dy.pipIrrGlobal.daoBa.BaRoleMapper;
+import com.dy.pipIrrGlobal.daoBa.BaRolePrivilegeMapper;
import com.dy.pipIrrGlobal.pojoBa.BaRole;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
@@ -18,10 +19,16 @@
public class RoleSv {
private BaRoleMapper dao;
+ private BaRolePrivilegeMapper rolePrivDao ;
@Autowired
private void setDao(BaRoleMapper dao){
this.dao = dao;
+ }
+
+ @Autowired
+ private void setRolePrivDao(BaRolePrivilegeMapper dao){
+ this.rolePrivDao = dao;
}
@@ -94,7 +101,11 @@
*/
@Transactional
public int delete(Long id){
- return this.dao.deleteLogicById(id) ;
+ int count = this.dao.deleteLogicById(id) ;
+ if(count > 0){
+ this.rolePrivDao.deleteByRoleId(id) ;
+ }
+ return count ;
}
--
Gitblit v1.8.0