Quellcode durchsuchen

1、优化解决求职意向空指针问题

rayson vor 7 Monaten
Ursprung
Commit
3fb077799c

+ 6 - 4
menduner/menduner-system-biz/src/main/java/com/citu/module/menduner/system/controller/admin/job/JobInterestedController.java

@@ -99,6 +99,7 @@ public class JobInterestedController {
 
         // 行业
         Set<Long> industryIds = result.getList().stream()
+                .filter(c -> null != c.getIndustryIdList())
                 .flatMap(resp -> resp.getIndustryIdList().stream())
                 .map(s -> {
                     try {
@@ -115,6 +116,7 @@ public class JobInterestedController {
 
         // 区域
         Set<Long> areaIds = result.getList().stream()
+                .filter(c -> null != c.getInterestedAreaIdList())
                 .flatMap(resp -> Stream.concat(
                         resp.getInterestedAreaIdList().stream()
                                 .map(s -> {
@@ -146,16 +148,16 @@ public class JobInterestedController {
                     }
                 }
 
-                if(!item.getIndustryIdList().isEmpty()) {
+                if (!item.getIndustryIdList().isEmpty()) {
                     item.setIndustryNameList(item.getIndustryIdList().stream()
-                            .map(industry-> industryMap.get(Long.valueOf(industry)))
+                            .map(industry -> industryMap.get(Long.valueOf(industry)))
                             .filter(Objects::nonNull)
                             .collect(Collectors.toList()));
                 }
 
-                if(!item.getInterestedAreaIdList().isEmpty()) {
+                if (!item.getInterestedAreaIdList().isEmpty()) {
                     item.setInterestedAreaNameList(item.getInterestedAreaIdList().stream()
-                            .map(area-> areaMap.get(Long.valueOf(area)))
+                            .map(area -> areaMap.get(Long.valueOf(area)))
                             .filter(Objects::nonNull)
                             .collect(Collectors.toList()));
                 }