Browse Source

Merge branch 'develop' of gitadmin/tuoheng_oidc into release

tags/v2.4.0
xuziqing 1 year ago
parent
commit
4ae1e7e1d8
1 changed files with 21 additions and 20 deletions
  1. +21
    -20
      tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/ClientUserServiceImpl.java

+ 21
- 20
tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/ClientUserServiceImpl.java View File

IPage<TenantPo> pageData = tenantMapper.findList(page, query); IPage<TenantPo> pageData = tenantMapper.findList(page, query);
pageData.convert(x -> { pageData.convert(x -> {
TenantVo vo = Convert.convert(TenantVo.class, x); TenantVo vo = Convert.convert(TenantVo.class, x);
Long userId = x.getUserId();
List<AuthoritiesPo> poList = authoritiesMapper.selectByUserId(userId);
UserPo userPo = clientUserMapper.selectByUserId(userId);
if (null != userPo) {
vo.setUsername(userPo.getUsername());
}
List<BusinessSystemVo> businessSystemVoList = new ArrayList<>();
for (AuthoritiesPo authoritiesPo : poList) {
BusinessSystemVo businessSystemVo = new BusinessSystemVo();
//TODO 后期维护各个业务平台
if (authoritiesPo.getAuthority().contains("hhz")) {
businessSystemVo.setClientId(HhzUrlConstant.HHZ_CLIENT);
businessSystemVo.setName(HhzUrlConstant.HHZ_NAME);
businessSystemVoList.add(businessSystemVo);
if (ObjectUtil.isNotEmpty(vo.getCode())) {
Long userId = x.getUserId();
List<AuthoritiesPo> poList = authoritiesMapper.selectByUserId(userId);
UserPo userPo = clientUserMapper.selectByUserId(userId);
if (null != userPo) {
vo.setUsername(userPo.getUsername());
}
List<BusinessSystemVo> businessSystemVoList = new ArrayList<>();
for (AuthoritiesPo authoritiesPo : poList) {
BusinessSystemVo businessSystemVo = new BusinessSystemVo();
//TODO 后期维护各个业务平台
if (authoritiesPo.getAuthority().contains("hhz")) {
businessSystemVo.setClientId(HhzUrlConstant.HHZ_CLIENT);
businessSystemVo.setName(HhzUrlConstant.HHZ_NAME);
businessSystemVoList.add(businessSystemVo);
}
} }
businessSystemVoList = businessSystemVoList.stream().distinct().collect(Collectors.toList());
vo.setList(businessSystemVoList);
return vo;
} else {
return null;
} }
businessSystemVoList = businessSystemVoList.stream().distinct().collect(Collectors.toList());
vo.setList(businessSystemVoList);
return vo;
}); });
//过滤出测试租户数据
List<TenantPo> collect = pageData.getRecords().stream().filter(t -> ObjectUtil.isNotEmpty(t.getCode())).collect(Collectors.toList());
pageData.setRecords(collect);
return JsonResult.success(pageData); return JsonResult.success(pageData);
} }



Loading…
Cancel
Save