use of com.paascloud.provider.model.vo.MenuVo in project paascloud-master by paascloud.
the class UacGroupServiceImpl method buildGroupTree.
private List<MenuVo> buildGroupTree(List<GroupZtreeVo> childUacGroupList, Long currentGroupId) {
List<MenuVo> listVo = Lists.newArrayList();
MenuVo menuVo;
for (GroupZtreeVo group : childUacGroupList) {
menuVo = new MenuVo();
menuVo.setId(group.getId());
if (currentGroupId.equals(group.getId())) {
menuVo.setPid(0L);
} else {
menuVo.setPid(group.getpId());
}
menuVo.setMenuCode(group.getGroupCode());
menuVo.setMenuName(group.getGroupName());
listVo.add(menuVo);
}
return TreeUtil.getChildMenuVos(listVo, 0L);
}
use of com.paascloud.provider.model.vo.MenuVo in project paascloud-master by paascloud.
the class UacMenuServiceImpl method getMenuVo.
private List<MenuVo> getMenuVo(List<UacMenu> list) {
List<MenuVo> menuVoList = Lists.newArrayList();
for (UacMenu uacMenu : list) {
MenuVo menuVo = new MenuVo();
BeanUtils.copyProperties(uacMenu, menuVo);
menuVo.setUrl(uacMenu.getUrl());
menuVo.setMenuName(uacMenu.getMenuName());
menuVoList.add(menuVo);
}
return menuVoList;
}
use of com.paascloud.provider.model.vo.MenuVo in project paascloud-master by paascloud.
the class UacRoleServiceImpl method getAuthList.
private List<MenuVo> getAuthList(List<UacMenu> uacMenus, List<UacAction> uacActions) {
List<MenuVo> menuVoList = Lists.newArrayList();
MenuVo menuVo;
for (UacMenu uacMenu : uacMenus) {
menuVo = new MenuVo();
BeanUtils.copyProperties(uacMenu, menuVo);
menuVo.setRemark("menu");
menuVoList.add(menuVo);
}
if (PublicUtil.isNotEmpty(uacActions)) {
for (UacAction uacAction : uacActions) {
menuVo = new MenuVo();
menuVo.setId(uacAction.getId());
menuVo.setMenuName(uacAction.getActionName());
menuVo.setMenuCode(uacAction.getActionCode());
menuVo.setPid(uacAction.getMenuId());
menuVo.setUrl(uacAction.getUrl());
menuVo.setRemark("action");
menuVoList.add(menuVo);
}
}
return menuVoList;
}
use of com.paascloud.provider.model.vo.MenuVo in project paascloud-master by paascloud.
the class UacRoleServiceImpl method getMenuTreeByRoleId.
@Override
@Transactional(readOnly = true, rollbackFor = Exception.class)
public BindAuthVo getMenuTreeByRoleId(Long roleId) {
BindAuthVo bindAuthVo = new BindAuthVo();
Preconditions.checkArgument(roleId != null, ErrorCodeEnum.UAC10012001.msg());
UacRole roleById = this.getRoleById(roleId);
if (roleById == null) {
logger.error("找不到角色信息 roleId={}", roleId);
throw new UacBizException(ErrorCodeEnum.UAC10012005, roleId);
}
// 查询所有的菜单信息
List<UacMenu> uacMenus = uacMenuService.selectAll();
// 合并菜单和按钮权限 递归生成树结构
List<MenuVo> menuVoList = this.getAuthList(uacMenus, null);
List<MenuVo> tree = TreeUtil.getChildMenuVos(menuVoList, 0L);
// 获取所有绑定的菜单和按钮权限Id集合
List<Long> checkedAuthList = uacActionService.getCheckedMenuList(roleId);
bindAuthVo.setAuthTree(tree);
bindAuthVo.setCheckedAuthList(checkedAuthList);
return bindAuthVo;
}
use of com.paascloud.provider.model.vo.MenuVo in project paascloud-master by paascloud.
the class UacUserCommonController method queryUserInfo.
/**
* 根据userId查询用户详细信息(连表查询).
*
* @return the wrapper
*/
@PostMapping(value = "/queryUserInfo/{loginName}")
@ApiOperation(httpMethod = "POST", value = "根据userId查询用户详细信息")
public Wrapper<UserVo> queryUserInfo(@PathVariable String loginName) {
logger.info("根据userId查询用户详细信息");
UserVo userVo = new UserVo();
UacUser uacUser = uacUserService.findByLoginName(loginName);
uacUser = uacUserService.findUserInfoByUserId(uacUser.getId());
List<UacRole> roleList = uacRoleService.findAllRoleInfoByUserId(uacUser.getId());
List<MenuVo> authTree = uacRoleService.getOwnAuthTree(uacUser.getId());
BeanUtils.copyProperties(uacUser, userVo);
if (PublicUtil.isNotEmpty(roleList)) {
userVo.setRoles(new HashSet<>(roleList));
}
userVo.setAuthTree(authTree);
return WrapMapper.ok(userVo);
}
Aggregations