use of com.paascloud.provider.model.dto.role.BindUserDto 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;
}
Aggregations