|
|
@@ -367,16 +367,16 @@ public class SysRoleServiceImpl implements ISysRoleService, RoleService {
|
|
|
*/
|
|
|
private int insertRoleMenu(SysRoleBo role) {
|
|
|
int rows = 1;
|
|
|
- // 新增角色与组织机构(数据权限)管理
|
|
|
- List<SysRoleOrg> list = new ArrayList<>();
|
|
|
- for (Long orgId : role.getOrgIds()) {
|
|
|
- SysRoleOrg rd = new SysRoleOrg();
|
|
|
- rd.setRoleId(role.getRoleId());
|
|
|
- rd.setOrgId(orgId);
|
|
|
- list.add(rd);
|
|
|
+ // 新增角色与菜单管理
|
|
|
+ List<SysRoleMenu> list = new ArrayList<>();
|
|
|
+ for (Long menuId : role.getMenuIds()) {
|
|
|
+ SysRoleMenu rm = new SysRoleMenu();
|
|
|
+ rm.setRoleId(role.getRoleId());
|
|
|
+ rm.setMenuId(menuId);
|
|
|
+ list.add(rm);
|
|
|
}
|
|
|
if (CollUtil.isNotEmpty(list)) {
|
|
|
- rows = roleOrgMapper.insertBatch(list) ? list.size() : 0;
|
|
|
+ rows = roleMenuMapper.insertBatch(list) ? list.size() : 0;
|
|
|
}
|
|
|
return rows;
|
|
|
}
|
|
|
@@ -389,7 +389,7 @@ public class SysRoleServiceImpl implements ISysRoleService, RoleService {
|
|
|
private int insertRoleOrg(SysRoleBo role) {
|
|
|
Long[] orgIds = role.getOrgIds();
|
|
|
if (ArrayUtil.isEmpty(orgIds)) {
|
|
|
- return 0;
|
|
|
+ return 1;
|
|
|
}
|
|
|
List<SysRoleOrg> roleOrgList = Arrays.stream(orgIds)
|
|
|
.map(orgId -> {
|