【7.6.0】【sys】获取公司列表接口去重

dev-7.6.0-portal
fengshuonan 2023-06-14 16:44:27 +08:00
parent 4e55b6c4b9
commit 60b4029219
1 changed files with 11 additions and 1 deletions

View File

@ -236,7 +236,17 @@ public class SysUserOrgServiceServiceImpl extends ServiceImpl<SysUserOrgMapper,
if (companyInfo == null) {
continue;
}
results.add(companyInfo);
// 判断是否已经加了这个公司
boolean alreadyHave = false;
for (HrOrganizationDTO dtoItem : results) {
if (dtoItem.getOrgId().equals(companyInfo.getOrgId())) {
alreadyHave = true;
}
}
if (!alreadyHave) {
results.add(companyInfo);
}
}
return results;