Showing
3 changed files
with
4 additions
and
23 deletions
@@ -73,20 +73,7 @@ public class UserOrganizationMappingServiceImpl implements UserOrganizationMappi | @@ -73,20 +73,7 @@ public class UserOrganizationMappingServiceImpl implements UserOrganizationMappi | ||
73 | batchInsert(userId, organizationIds); | 73 | batchInsert(userId, organizationIds); |
74 | } | 74 | } |
75 | 75 | ||
76 | - @Override | ||
77 | - public List<String> getUserIdsByOrganizationId(String organizationId) { | ||
78 | - if (StringUtils.isAllEmpty(organizationId)) { | ||
79 | - throw new YtDataValidationException(ErrorMessage.INTERNAL_ERROR.getMessage()); | ||
80 | - } | ||
81 | - return userOrganizationMappingMapper | ||
82 | - .selectList( | ||
83 | - new QueryWrapper<UserOrganizationMapping>() | ||
84 | - .lambda() | ||
85 | - .eq(UserOrganizationMapping::getOrganizationId, organizationId)) | ||
86 | - .stream() | ||
87 | - .map(UserOrganizationMapping::getUserId) | ||
88 | - .collect(Collectors.toList()); | ||
89 | - } | 76 | + |
90 | 77 | ||
91 | @Override | 78 | @Override |
92 | public List<String> getOrganizationIdsByUserId(String userId) { | 79 | public List<String> getOrganizationIdsByUserId(String userId) { |
@@ -521,7 +521,7 @@ public class YtUserServiceImpl extends AbstractBaseService<UserMapper, User> | @@ -521,7 +521,7 @@ public class YtUserServiceImpl extends AbstractBaseService<UserMapper, User> | ||
521 | if (group == null || !group.getTenantId().equals(tenantId)) { | 521 | if (group == null || !group.getTenantId().equals(tenantId)) { |
522 | return Optional.empty(); | 522 | return Optional.empty(); |
523 | } | 523 | } |
524 | - List<String> userIds = userOrganizationMappingService.getUserIdsByOrganizationId(group.getId()); | 524 | + List<String> userIds = userOrganizationMappingService.getUserIdByOrganizationIds(group.getId()); |
525 | List<User> users = baseMapper.selectBatchIds(userIds); | 525 | List<User> users = baseMapper.selectBatchIds(userIds); |
526 | return Optional.ofNullable(ReflectUtils.sourceToTarget(users, UserDTO.class)); | 526 | return Optional.ofNullable(ReflectUtils.sourceToTarget(users, UserDTO.class)); |
527 | } | 527 | } |
@@ -590,7 +590,7 @@ public class YtUserServiceImpl extends AbstractBaseService<UserMapper, User> | @@ -590,7 +590,7 @@ public class YtUserServiceImpl extends AbstractBaseService<UserMapper, User> | ||
590 | } | 590 | } |
591 | if (isTenantAdmin) { | 591 | if (isTenantAdmin) { |
592 | List<String> userList = | 592 | List<String> userList = |
593 | - userOrganizationMappingService.getUserIdsByOrganizationId(organizationId); | 593 | + userOrganizationMappingService.getUserIdByOrganizationIds(tenantId,organizationId); |
594 | if (null != userList && userList.size() > FastIotConstants.MagicNumber.ZERO) { | 594 | if (null != userList && userList.size() > FastIotConstants.MagicNumber.ZERO) { |
595 | return baseMapper.getMyCustomers(tenantId, EntityId.NULL_UUID.toString(), userList); | 595 | return baseMapper.getMyCustomers(tenantId, EntityId.NULL_UUID.toString(), userList); |
596 | } | 596 | } |
@@ -22,13 +22,7 @@ public interface UserOrganizationMappingService { | @@ -22,13 +22,7 @@ public interface UserOrganizationMappingService { | ||
22 | void addOrUpdateUserOrganizationMapping( | 22 | void addOrUpdateUserOrganizationMapping( |
23 | String userId, List<String> organizationIds, boolean isUpdate); | 23 | String userId, List<String> organizationIds, boolean isUpdate); |
24 | 24 | ||
25 | - /** | ||
26 | - * 根据组织ID查询其用户ID列表 | ||
27 | - * | ||
28 | - * @param organizationId 组织ID | ||
29 | - * @return 用户ID集合 | ||
30 | - */ | ||
31 | - List<String> getUserIdsByOrganizationId(String organizationId); | 25 | + |
32 | 26 | ||
33 | /** | 27 | /** |
34 | * 根据用户ID查询其所拥有的组织ID列表 | 28 | * 根据用户ID查询其所拥有的组织ID列表 |