use of com.xhuicloud.upms.entity.SysRoleMenu in project XHuiCloud by sindaZeng.
the class SysRoleMenuServiceImpl method saveRoleMenus.
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean saveRoleMenus(Integer roleId, String menuIds) {
this.remove(Wrappers.<SysRoleMenu>query().lambda().eq(SysRoleMenu::getRoleId, roleId));
if (StringUtils.isEmpty(menuIds)) {
return Boolean.TRUE;
}
List<SysRoleMenu> roleMenuList = Arrays.stream(menuIds.split(",")).map(menuId -> {
SysRoleMenu roleMenu = new SysRoleMenu();
roleMenu.setRoleId(roleId);
roleMenu.setMenuId(Integer.valueOf(menuId));
return roleMenu;
}).collect(Collectors.toList());
return saveBatch(roleMenuList);
}
Aggregations