|
|
|
@ -264,29 +264,60 @@ public class SsoLoginServiceImpl implements SsoLoginService { |
|
|
|
|
return roleIds; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// public List<SysUserOrgEntity> toUserOrg(SsoUser user) {
|
|
|
|
|
// SysUserOrgEntity userOrg;
|
|
|
|
|
// List<SysUserOrgEntity> listUserOrg = new ArrayList<>();
|
|
|
|
|
// List<Long> dataPerm = user.getDataPerm();
|
|
|
|
|
// List<com.xxl.sso.core.entity.SysDeptEntity> taxplayercodeDeptList = user.getTaxplayercodeDeptList();
|
|
|
|
|
// if (dataPerm != null && dataPerm.size() > 0) {
|
|
|
|
|
// for (Long deptId : dataPerm) {
|
|
|
|
|
// if (dataPerm.size() > 0) {
|
|
|
|
|
// for (com.xxl.sso.core.entity.SysDeptEntity sysDeptEntity : taxplayercodeDeptList) {
|
|
|
|
|
// log.debug("deptId : " + deptId + " sysDetp: " + sysDeptEntity.getDeptId());
|
|
|
|
|
// if (deptId.longValue() == sysDeptEntity.getDeptId().longValue()) {
|
|
|
|
|
// userOrg = new SysUserOrgEntity();
|
|
|
|
|
// userOrg.setCompany(AdminConfig.company);
|
|
|
|
|
// userOrg.setDeptId(sysDeptEntity.getDeptId());
|
|
|
|
|
// userOrg.setTaxname(sysDeptEntity.getName());
|
|
|
|
|
// userOrg.setTaxno(sysDeptEntity.getTaxpayerCode());
|
|
|
|
|
// listUserOrg.add(userOrg);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// log.debug("listUserOrg : " + listUserOrg.size() + " listUserOrgJson: " + JSON.toJSONString(listUserOrg));
|
|
|
|
|
// return listUserOrg;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
public List<SysUserOrgEntity> toUserOrg(SsoUser user) { |
|
|
|
|
SysUserOrgEntity userOrg; |
|
|
|
|
Map<Long, com.xxl.sso.core.entity.SysDeptEntity> detpCollect = null; |
|
|
|
|
List<SysUserOrgEntity> listUserOrg = new ArrayList<>(); |
|
|
|
|
List<Long> dataPerm = user.getDataPerm(); |
|
|
|
|
List<com.xxl.sso.core.entity.SysDeptEntity> taxplayercodeDeptList = user.getTaxplayercodeDeptList(); |
|
|
|
|
if(taxplayercodeDeptList != null && taxplayercodeDeptList.size() > 0){ |
|
|
|
|
detpCollect = taxplayercodeDeptList.stream().collect(Collectors.toMap(com.xxl.sso.core.entity.SysDeptEntity::getDeptId, tri -> tri)); |
|
|
|
|
} |
|
|
|
|
if(detpCollect == null){ |
|
|
|
|
return listUserOrg; |
|
|
|
|
} |
|
|
|
|
if (dataPerm != null && dataPerm.size() > 0) { |
|
|
|
|
|
|
|
|
|
for (Long deptId : dataPerm) { |
|
|
|
|
if (dataPerm.size() > 0) { |
|
|
|
|
for (com.xxl.sso.core.entity.SysDeptEntity sysDeptEntity : taxplayercodeDeptList) { |
|
|
|
|
log.debug("deptId : " + deptId + " sysDetp: " + sysDeptEntity.getDeptId()); |
|
|
|
|
if (deptId.longValue() == sysDeptEntity.getDeptId().longValue()) { |
|
|
|
|
com.xxl.sso.core.entity.SysDeptEntity deptEntity = detpCollect.get(deptId); |
|
|
|
|
if(deptEntity != null){ |
|
|
|
|
userOrg = new SysUserOrgEntity(); |
|
|
|
|
userOrg.setCompany(AdminConfig.company); |
|
|
|
|
userOrg.setDeptId(sysDeptEntity.getDeptId()); |
|
|
|
|
userOrg.setTaxname(sysDeptEntity.getName()); |
|
|
|
|
userOrg.setTaxno(sysDeptEntity.getTaxpayerCode()); |
|
|
|
|
userOrg.setDeptId(deptEntity.getDeptId()); |
|
|
|
|
userOrg.setTaxname(deptEntity.getName()); |
|
|
|
|
userOrg.setTaxno(deptEntity.getTaxpayerCode()); |
|
|
|
|
listUserOrg.add(userOrg); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
log.debug("listUserOrg : " + listUserOrg.size() + " listUserOrgJson: " + JSON.toJSONString(listUserOrg)); |
|
|
|
|
log.info("listUserOrg : " + listUserOrg.size() + " listUserOrgJson: " + JSON.toJSONString(listUserOrg)); |
|
|
|
|
return listUserOrg; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|