Commit dd0981d7 authored by guangjing.gao's avatar guangjing.gao

单用户/批量用户查询,租户ID为空默认羊小咩走原流程,否则走新流程

parent 1d98ae83
......@@ -49,22 +49,24 @@ public class UserCenterServiceImpl implements UserCenterService {
public List<UserAttached> searchUserAttachedListByUserId(List<Long> userIds, Integer tenantId) {
List<UserAttached> userAttacheds = userAttachedRepository.findByUserIdIn(userIds);
if (userAttacheds != null) {
//租户ID校验
if (TenantUtil.validationTenantIdIsNullOrZero(tenantId)) {
List<UserAttached> resultProductUsers = new ArrayList<>();
List<User> users = userRepository.findByIdIn(userIds);
List<User> productUsers = tenantService.selectUsersByTenantId(users, tenantId);
if (productUsers != null) {
userAttacheds.forEach(a->{
productUsers.forEach(b->{
if (a.getUserId().equals(b.getId())) {
resultProductUsers.add(a);
}
if (!tenantId.equals(TenantUtil.TENANT_DEFAULT)) {
if (userAttacheds != null) {
//租户ID校验
if (TenantUtil.validationTenantIdIsNullOrZero(tenantId)) {
List<UserAttached> resultProductUsers = new ArrayList<>();
List<User> users = userRepository.findByIdIn(userIds);
List<User> productUsers = tenantService.selectUsersByTenantId(users, tenantId);
if (productUsers != null) {
userAttacheds.forEach(a->{
productUsers.forEach(b->{
if (a.getUserId().equals(b.getId())) {
resultProductUsers.add(a);
}
});
});
});
}
return resultProductUsers;
}
return resultProductUsers;
}
}
return userAttacheds;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment