From 689440364e45d515966f908506ec66dc5ccb8d62 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期三, 15 十一月 2023 14:42:30 +0800
Subject: [PATCH] 1、*Mapper.java继承泛型错误修改 2、行政区实体中增加编号属性 3、行政区级别枚举去掉组 4、实现系统启动后初始化数据库数据监听器
---
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/role/RoleSv.java | 30 +++++++++++++++++++++++++-----
1 files changed, 25 insertions(+), 5 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 4d8e31c..f0b9702 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
@@ -5,6 +5,7 @@
import com.dy.pipIrrGlobal.daoBa.BaRoleMapper;
import com.dy.pipIrrGlobal.daoBa.BaRolePrivilegeMapper;
import com.dy.pipIrrGlobal.pojoBa.BaRole;
+import com.dy.pipIrrGlobal.pojoBa.BaRolePrivilege;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -95,17 +96,36 @@
}
/**
+ * 璁剧疆瑙掕壊鏉冮檺
+ * @param roleId 瑙掕壊id
+ * @param priviIds 閫夋嫨鐨勬潈闄恑d闆嗗悎
+ * @return 鎻掑叆瑙掕壊涓庢潈闄愬叧鑱旇褰曟暟閲�
+ */
+ public int setRoles(Long roleId, Long[] priviIds){
+ this.rolePrivDao.deleteByRoleId(roleId) ;
+ int count = 0 ;
+ if(priviIds != null && priviIds.length > 0){
+ for(Long privId : priviIds){
+ count += this.rolePrivDao.insertSelective(new BaRolePrivilege(roleId, privId)) ;
+ }
+ }
+ return count ;
+ }
+
+ /**
* 淇濆瓨淇敼瀹炰綋
* @param id 瀹炰綋ID
* @return 褰卞搷璁板綍鏁伴噺
*/
@Transactional
public int delete(Long id){
- int count = this.dao.deleteLogicById(id) ;
- if(count > 0){
- this.rolePrivDao.deleteByRoleId(id) ;
- }
- return count ;
+ //int count = this.dao.deleteLogicById(id) ;
+ //閫昏緫鍒犻櫎锛屾墍浠ヤ笉瀹為檯鍒犻櫎鍏跺叧鑱旂殑鏉冮檺
+ //if(count > 0){
+ // this.rolePrivDao.deleteByRoleId(id) ;
+ //}
+ //return count ;
+ return this.dao.deleteLogicById(id) ;
}
--
Gitblit v1.8.0