浏览代码

修改 nullpointerException

qinhouyu 1 年之前
父节点
当前提交
ca497448ab
共有 1 个文件被更改,包括 17 次插入14 次删除
  1. 17 14
      ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/impl/ZEngineeringNodeServiceImpl.java

+ 17 - 14
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/impl/ZEngineeringNodeServiceImpl.java

@@ -950,20 +950,23 @@ public class ZEngineeringNodeServiceImpl implements IZEngineeringNodeService {
 
             });
             List stateList=new ArrayList();
-            sysDictMap.get(item.getEnginType()+"_"+item.getEnginClassification()).stream().forEach(item3 -> {
-                Map<String,Object> map=new HashMap<>();
-                if (nodeList.size()>0&&nodeList.stream().anyMatch(x->x.getType().equals(item3.getDictValue()))){
-                    map.put("Type",item3.getDictValue());
-                    map.put("state",nodeTypeList.stream().anyMatch(y->y.getEngInfoId().equals(nodeList.stream().filter(x->x.getType().equals(item3.getDictValue())).collect(Collectors.toList()).get(0).getId()))?nodeTypeList.stream().filter(y->y.getEngInfoId().equals(nodeList.stream().filter(x->x.getType().equals(item3.getDictValue())).collect(Collectors.toList()).get(0).getId())).collect(Collectors.toList()).get(0).getReviewStatus():"0");
-                    map.put("content",nodeTypeList.stream().anyMatch(y->y.getEngInfoId().equals(nodeList.stream().filter(x->x.getType().equals(item3.getDictValue())).collect(Collectors.toList()).get(0).getId()))?nodeTypeList.stream().filter(y->y.getEngInfoId().equals(nodeList.stream().filter(x->x.getType().equals(item3.getDictValue())).collect(Collectors.toList()).get(0).getId())).collect(Collectors.toList()).get(0).getReviewContent():"暂未审核");
-                }else {
-                    map.put("Type",item3.getDictValue());
-                    map.put("state","0");
-                    map.put("content","暂未审核");
-                }
-                stateList.add(map);
-                ReViewStateMap.set(stateList);;
-            });
+            List<SysDictData> list = sysDictMap.get(item.getEnginType()+"_"+item.getEnginClassification());
+            if (list!=null&&!list.isEmpty()){
+                list.stream().forEach(item3 -> {
+                    Map<String,Object> map=new HashMap<>();
+                    if (nodeList.size()>0&&nodeList.stream().anyMatch(x->x.getType().equals(item3.getDictValue()))){
+                        map.put("Type",item3.getDictValue());
+                        map.put("state",nodeTypeList.stream().anyMatch(y->y.getEngInfoId().equals(nodeList.stream().filter(x->x.getType().equals(item3.getDictValue())).collect(Collectors.toList()).get(0).getId()))?nodeTypeList.stream().filter(y->y.getEngInfoId().equals(nodeList.stream().filter(x->x.getType().equals(item3.getDictValue())).collect(Collectors.toList()).get(0).getId())).collect(Collectors.toList()).get(0).getReviewStatus():"0");
+                        map.put("content",nodeTypeList.stream().anyMatch(y->y.getEngInfoId().equals(nodeList.stream().filter(x->x.getType().equals(item3.getDictValue())).collect(Collectors.toList()).get(0).getId()))?nodeTypeList.stream().filter(y->y.getEngInfoId().equals(nodeList.stream().filter(x->x.getType().equals(item3.getDictValue())).collect(Collectors.toList()).get(0).getId())).collect(Collectors.toList()).get(0).getReviewContent():"暂未审核");
+                    }else {
+                        map.put("Type",item3.getDictValue());
+                        map.put("state","0");
+                        map.put("content","暂未审核");
+                    }
+                    stateList.add(map);
+                    ReViewStateMap.set(stateList);;
+                });
+            }
             if(item.getEnginClassification().contains("indoor_engin")){
                 Map<String,Object> map=new HashMap<>();
                 map.put("Type","开栓");