|
@@ -33,6 +33,9 @@ public class SysRolePrivilegeServiceImpl extends ServiceImpl<SysRolePrivilegeMap
|
|
@Resource
|
|
@Resource
|
|
SysPrivilegeService sysPrivilegeService;
|
|
SysPrivilegeService sysPrivilegeService;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ SysRolePrivilegeService sysRolePrivilegeService;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 批量保存角色权限
|
|
* 批量保存角色权限
|
|
*
|
|
*
|
|
@@ -62,9 +65,8 @@ public class SysRolePrivilegeServiceImpl extends ServiceImpl<SysRolePrivilegeMap
|
|
List<Long> finalRelatedList = relatedList;
|
|
List<Long> finalRelatedList = relatedList;
|
|
int count = (int) sysRolePrivilegeList.stream().filter(s -> finalRelatedList.contains(s.getPrivilegeId())).count();
|
|
int count = (int) sysRolePrivilegeList.stream().filter(s -> finalRelatedList.contains(s.getPrivilegeId())).count();
|
|
if (count != sysRolePrivilegeList.size() || count != finalRelatedSet.size()) {
|
|
if (count != sysRolePrivilegeList.size() || count != finalRelatedSet.size()) {
|
|
- //学校角色编辑超管
|
|
|
|
- List<Long> sysRolePrivilegeIdList = sysRolePrivilegeList.stream().map(SysRolePrivilege::getPrivilegeId).collect(Collectors.toList());
|
|
|
|
- relatedList = relatedList.stream().filter(m -> !sysRolePrivilegeIdList.contains(m)).collect(Collectors.toList());
|
|
|
|
|
|
+ sysRolePrivilegeService.remove(new QueryWrapper<SysRolePrivilege>().lambda().eq(SysRolePrivilege::getRoleId, role.getId()));
|
|
|
|
+ commonCacheService.removeRolePrivilegeCache(role.getId());
|
|
List<SysRolePrivilege> list = new ArrayList<>();
|
|
List<SysRolePrivilege> list = new ArrayList<>();
|
|
for (Long privilegeId : relatedList) {
|
|
for (Long privilegeId : relatedList) {
|
|
list.add(new SysRolePrivilege(role.getId(), privilegeId));
|
|
list.add(new SysRolePrivilege(role.getId(), privilegeId));
|