diff --git a/src/main/java/com/zcloud/controller/inspection/SafetyEnvironmentalInspectorController.java b/src/main/java/com/zcloud/controller/inspection/SafetyEnvironmentalInspectorController.java index c7bc8356..7c2072e9 100644 --- a/src/main/java/com/zcloud/controller/inspection/SafetyEnvironmentalInspectorController.java +++ b/src/main/java/com/zcloud/controller/inspection/SafetyEnvironmentalInspectorController.java @@ -66,8 +66,13 @@ public class SafetyEnvironmentalInspectorController extends BaseController { PageData condition = new PageData(); condition.put("DEPARTMENT_ID",vector.getString("INSPECTED_DEPARTMENT_ID")); List parent_list = departmentService.getGenealogy(condition); - String corp_infos = parent_list.stream().map(n -> n.getString("NAME")).collect(Collectors.joining("-")); - vector.put("INSPECTED_DEPARTMENT_NAMES",corp_infos); + if (parent_list == null || parent_list.size() < 1) { + String corp_infos = ""; + vector.put("INSPECTED_DEPARTMENT_NAMES", corp_infos); + } else { + String corp_infos = parent_list.stream().map(n -> n.getString("NAME")).collect(Collectors.joining("-")); + vector.put("INSPECTED_DEPARTMENT_NAMES",corp_infos); + } } map.put("varList", varList); map.put("page", page);