处理部分公司不存在行业问题
This commit is contained in:
@@ -111,7 +111,7 @@ public class IndustryService {
|
|||||||
private Set<Long> getActiveIndustryIds(List<Industry> allIndustries) {
|
private Set<Long> getActiveIndustryIds(List<Industry> allIndustries) {
|
||||||
// 1. 查询有公司关联的末级行业ID
|
// 1. 查询有公司关联的末级行业ID
|
||||||
List<Company> companies = companyMapper.selectList(new LambdaQueryWrapper<Company>().select(Company::getIndustryId).eq(Company::getStatus, 1).groupBy(Company::getIndustryId));
|
List<Company> companies = companyMapper.selectList(new LambdaQueryWrapper<Company>().select(Company::getIndustryId).eq(Company::getStatus, 1).groupBy(Company::getIndustryId));
|
||||||
Set<Long> leafActiveIds = companies.stream().map(Company::getIndustryId).filter(Objects::nonNull).collect(Collectors.toSet());
|
Set<Long> leafActiveIds = companies.stream().filter(Objects::nonNull).map(Company::getIndustryId).filter(Objects::nonNull).collect(Collectors.toSet());
|
||||||
|
|
||||||
// 2. 查全量行业,构建id->parentId映射
|
// 2. 查全量行业,构建id->parentId映射
|
||||||
if (allIndustries == null) {
|
if (allIndustries == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user