use of com.paascloud.provider.model.vo.GroupZtreeVo in project paascloud-master by paascloud.
the class UacGroupServiceImpl method getGroupTreeListByUserId.
@Override
@Transactional(readOnly = true, rollbackFor = Exception.class)
public List<MenuVo> getGroupTreeListByUserId(Long userId) {
UacGroupUser groupUser = uacGroupUserMapper.getByUserId(userId);
Long groupId = groupUser.getGroupId();
// 查询当前登陆人所在的组织信息
UacGroup currentUserUacGroup = uacGroupMapper.selectByPrimaryKey(groupId);
// 获取当前所选组织的所有子节点
List<GroupZtreeVo> childUacGroupList = this.getGroupTree(currentUserUacGroup.getId());
return this.buildGroupTree(childUacGroupList, groupId);
}
use of com.paascloud.provider.model.vo.GroupZtreeVo in project paascloud-master by paascloud.
the class UacGroupServiceImpl method getGroupTree.
@Override
@Transactional(readOnly = true, rollbackFor = Exception.class)
public List<GroupZtreeVo> getGroupTree(Long groupId) {
// 1. 如果是仓库则 直接把仓库信息封装成ztreeVo返回
List<GroupZtreeVo> tree = Lists.newArrayList();
UacGroup uacGroup = uacGroupMapper.selectByPrimaryKey(groupId);
GroupZtreeVo zTreeMenuVo = buildGroupZTreeVoByGroup(uacGroup);
if (0L == uacGroup.getPid()) {
zTreeMenuVo.setOpen(true);
}
tree.add(zTreeMenuVo);
// 2.如果是组织id则遍历组织+仓库的树结构
// 如果是组织 则查询父id为
UacGroup uacGroupQuery = new UacGroup();
uacGroupQuery.setPid(groupId);
List<UacGroup> groupList = uacGroupMapper.select(uacGroupQuery);
if (PublicUtil.isNotEmpty(groupList)) {
tree = buildNode(groupList, tree);
}
return tree;
}
Aggregations