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

校验是否羊小咩租户

parent b4419300
......@@ -32,4 +32,8 @@ public interface ITenantService {
List<User> selectUsersByTenantId(List<User> users, Integer tenantId);
Long getTenantCustomerInfoByOpenId(String openId, Integer tenantId);
List<User> validationTentIdByTentId(List<User> users, Integer tenantId);
}
......@@ -156,4 +156,24 @@ public class TenantServiceImpl implements ITenantService {
}
return null;
}
@Override
public List<User> validationTentIdByTentId(List<User> users, Integer tenantId) {
List<User> result = new ArrayList<>();
OauthClientDetailsEntity oauthClientDetails = oauthClientDetailsService.findFirstByClientId(tenantId);
if (oauthClientDetails != null) {
List<ProductLoginEntity> productLoginEntities = productLoginService.findProductLoginsByInstitutionIdAndProductId(oauthClientDetails.getInstitutionId(), oauthClientDetails.getProductId());
if (productLoginEntities == null || productLoginEntities.size()>0) {
users.forEach(a->{
productLoginEntities.forEach(b->{
if (a.getPhoneNo().equals(b.getPhoneNo())) {
a.setPassword(b.getPassword());
result.add(a);
}
});
});
}
}
return result;
}
}
......@@ -508,6 +508,8 @@ public class UserServiceImpl implements IUserService, IBaseController {
if (!TenantUtil.validationTenantIdIsNullOrZero(tenantId)) {
return tenantService.selectUsersByTenantId(users, tenantId);
}
}else {
return tenantService.validationTentIdByTentId(users, tenantId);
}
return users;
} else { //不是1 就是 uuids
......@@ -515,6 +517,8 @@ public class UserServiceImpl implements IUserService, IBaseController {
if (!tenantId.equals(TenantUtil.TENANT_DEFAULT)) {
if (!TenantUtil.validationTenantIdIsNullOrZero(tenantId)) {
return tenantService.selectUsersByTenantId(users, tenantId);
}else {
return tenantService.validationTentIdByTentId(users, tenantId);
}
}
return users;
......
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