|
|
@@ -5,6 +5,7 @@ import cn.iocoder.byzs.framework.common.pojo.PageParam;
|
|
|
import cn.iocoder.byzs.framework.common.pojo.PageResult;
|
|
|
import cn.iocoder.byzs.framework.common.util.object.BeanUtils;
|
|
|
import cn.iocoder.byzs.framework.common.util.string.StrUtils;
|
|
|
+import cn.iocoder.byzs.framework.tenant.core.util.TenantUtils;
|
|
|
import cn.iocoder.byzs.module.system.controller.admin.invitecode.vo.InviteCodePageReqVO;
|
|
|
import cn.iocoder.byzs.module.system.controller.admin.invitecode.vo.InviteCodeRespVO;
|
|
|
import cn.iocoder.byzs.module.system.controller.admin.invitecode.vo.InviteCodeSaveReqVO;
|
|
|
@@ -180,17 +181,23 @@ public class InviteCodeServiceImpl implements InviteCodeService {
|
|
|
// 2. 转换为RespVO并填充关联数据
|
|
|
// 取所有角色ID
|
|
|
Set<Long> roleIdSet = list.stream().map(InviteCodeDO::getRoleIds).filter(Objects::nonNull).flatMap(roleIds -> StrUtils.splitToLongSet(roleIds).stream()).collect(Collectors.toSet());
|
|
|
- List<RoleDO> roleList = roleIdSet.isEmpty() ? Collections.emptyList() : roleMapper.selectBatchIds(roleIdSet);
|
|
|
+ List<RoleDO> roleList = roleIdSet.isEmpty() ? Collections.emptyList() : TenantUtils.executeIgnore(() ->
|
|
|
+ roleMapper.selectBatchIds(roleIdSet)
|
|
|
+ );
|
|
|
Map<Long, String> roleMap = roleList.stream().collect(Collectors.toMap(RoleDO::getId, RoleDO::getName));
|
|
|
|
|
|
// 取所有用户ID
|
|
|
Set<Long> userIdSet = list.stream().map(InviteCodeDO::getUseUserId).filter(Objects::nonNull).collect(Collectors.toSet());
|
|
|
- List<AdminUserDO> userList = userIdSet.isEmpty() ? Collections.emptyList() : userMapper.selectBatchIds(userIdSet);
|
|
|
+ List<AdminUserDO> userList = userIdSet.isEmpty() ? Collections.emptyList() : TenantUtils.executeIgnore(() ->
|
|
|
+ userMapper.selectBatchIds(userIdSet)
|
|
|
+ );
|
|
|
Map<Long, String> userMap = userList.stream().collect(Collectors.toMap(AdminUserDO::getId, AdminUserDO::getNickname));
|
|
|
|
|
|
// 取所有租户ID
|
|
|
Set<Long> userTenantIdSet = list.stream().map(InviteCodeDO::getUseUserTenantId).filter(Objects::nonNull).collect(Collectors.toSet());
|
|
|
- List<TenantDO> tenantList = userTenantIdSet.isEmpty() ? Collections.emptyList() : tenantMapper.selectBatchIds(userTenantIdSet);
|
|
|
+ List<TenantDO> tenantList = userTenantIdSet.isEmpty() ? Collections.emptyList() : TenantUtils.executeIgnore(() ->
|
|
|
+ tenantMapper.selectBatchIds(userTenantIdSet)
|
|
|
+ );
|
|
|
Map<Long, String> tenantMap = tenantList.stream().collect(Collectors.toMap(TenantDO::getId, TenantDO::getName));
|
|
|
|
|
|
// 转换为RespVO
|