use of com.paascloud.provider.model.exceptions.UacBizException in project paascloud-master by paascloud.
the class UacRoleActionServiceImpl method deleteByRoleId.
@Override
public void deleteByRoleId(Long roleId) {
if (roleId == null) {
throw new UacBizException(ErrorCodeEnum.UAC10012001);
}
UacRoleAction roleMenu = new UacRoleAction();
roleMenu.setRoleId(roleId);
uacRoleActionMapper.delete(roleMenu);
}
use of com.paascloud.provider.model.exceptions.UacBizException in project paascloud-master by paascloud.
the class UacRoleServiceImpl method getActionTreeByRoleId.
@Override
@Transactional(readOnly = true, rollbackFor = Exception.class)
public BindAuthVo getActionTreeByRoleId(Long roleId) {
BindAuthVo bindAuthVo = new BindAuthVo();
if (roleId == null) {
throw new UacBizException(ErrorCodeEnum.UAC10012001);
}
UacRole roleById = this.getRoleById(roleId);
if (roleById == null) {
logger.error("找不到角色信息 roleId={}", roleId);
throw new UacBizException(ErrorCodeEnum.UAC10012005, roleId);
}
List<UacMenu> uacMenus = uacMenuService.listMenuListByRoleId(roleId);
if (PublicUtil.isEmpty(uacMenus)) {
throw new UacBizException(ErrorCodeEnum.UAC10013009);
}
// 查询所有的权限信息
List<UacAction> uacActions = uacActionService.listActionList(uacMenus);
// 合并菜单和按钮权限 递归生成树结构
List<MenuVo> menuVoList = this.getAuthList(uacMenus, uacActions);
List<MenuVo> tree = TreeUtil.getChildMenuVos(menuVoList, 0L);
// 获取所有绑定的菜单和按钮权限Id集合
List<Long> checkedAuthList = uacActionService.getCheckedActionList(roleId);
bindAuthVo.setAuthTree(tree);
bindAuthVo.setCheckedAuthList(checkedAuthList);
return bindAuthVo;
}
Aggregations