Search in sources :

Example 1 with GroupBindUserDto

use of com.paascloud.provider.model.dto.group.GroupBindUserDto in project paascloud-master by paascloud.

the class UacGroupServiceImpl method getGroupBindUserDto.

@Override
@Transactional(readOnly = true, rollbackFor = Exception.class)
public GroupBindUserDto getGroupBindUserDto(Long groupId, Long currentUserId) {
    GroupBindUserDto groupBindUserDto = new GroupBindUserDto();
    Set<Long> alreadyBindUserIdSet = Sets.newHashSet();
    UacGroup uacGroup = uacGroupMapper.selectByPrimaryKey(groupId);
    if (PublicUtil.isEmpty(uacGroup)) {
        logger.error("找不到uacGroup={}, 的组织", uacGroup);
        throw new UacBizException(ErrorCodeEnum.UAC10015001, groupId);
    }
    // 查询所有用户包括已禁用的用户
    List<BindUserDto> bindUserDtoList = uacRoleMapper.selectAllNeedBindUser(GlobalConstant.Sys.SUPER_MANAGER_ROLE_ID, currentUserId);
    // 该组织已经绑定的用户
    List<UacGroupUser> setAlreadyBindUserSet = uacGroupUserMapper.listByGroupId(groupId);
    Set<BindUserDto> allUserSet = new HashSet<>(bindUserDtoList);
    for (UacGroupUser uacGroupUser : setAlreadyBindUserSet) {
        alreadyBindUserIdSet.add(uacGroupUser.getUserId());
    }
    groupBindUserDto.setAllUserSet(allUserSet);
    groupBindUserDto.setAlreadyBindUserIdSet(alreadyBindUserIdSet);
    return groupBindUserDto;
}
Also used : BindUserDto(com.paascloud.provider.model.dto.role.BindUserDto) GroupBindUserDto(com.paascloud.provider.model.dto.group.GroupBindUserDto) UacGroup(com.paascloud.provider.model.domain.UacGroup) UacBizException(com.paascloud.provider.model.exceptions.UacBizException) UacGroupUser(com.paascloud.provider.model.domain.UacGroupUser) GroupBindUserDto(com.paascloud.provider.model.dto.group.GroupBindUserDto) Transactional(org.springframework.transaction.annotation.Transactional)

Example 2 with GroupBindUserDto

use of com.paascloud.provider.model.dto.group.GroupBindUserDto in project paascloud-master by paascloud.

the class UacGroupBindUserController method getGroupBindUserPageInfo.

/**
 * 组织绑定用户页面数据
 *
 * @param groupId the group id
 *
 * @return the group bind user page info
 */
@PostMapping(value = "/getBindUser/{groupId}")
@ApiOperation(httpMethod = "POST", value = "获取组织绑定用户页面数据")
public Wrapper<GroupBindUserDto> getGroupBindUserPageInfo(@ApiParam(name = "groupId", value = "组织id") @PathVariable Long groupId) {
    logger.info("查询组织绑定用户页面数据 groupId={}", groupId);
    LoginAuthDto loginAuthDto = super.getLoginAuthDto();
    Long currentUserId = loginAuthDto.getUserId();
    GroupBindUserDto bindUserDto = uacGroupService.getGroupBindUserDto(groupId, currentUserId);
    return WrapMapper.ok(bindUserDto);
}
Also used : LoginAuthDto(com.paascloud.base.dto.LoginAuthDto) GroupBindUserDto(com.paascloud.provider.model.dto.group.GroupBindUserDto) ApiOperation(io.swagger.annotations.ApiOperation)

Aggregations

GroupBindUserDto (com.paascloud.provider.model.dto.group.GroupBindUserDto)2 LoginAuthDto (com.paascloud.base.dto.LoginAuthDto)1 UacGroup (com.paascloud.provider.model.domain.UacGroup)1 UacGroupUser (com.paascloud.provider.model.domain.UacGroupUser)1 BindUserDto (com.paascloud.provider.model.dto.role.BindUserDto)1 UacBizException (com.paascloud.provider.model.exceptions.UacBizException)1 ApiOperation (io.swagger.annotations.ApiOperation)1 Transactional (org.springframework.transaction.annotation.Transactional)1