From 02f8e70fcfc40c19d2002da738795b87a3409ea5 Mon Sep 17 00:00:00 2001 From: limingyu Date: Sat, 30 Mar 2024 16:20:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E7=8E=AF=E4=BF=9D=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E6=A3=80=E6=9F=A5=E4=BA=BA=E6=A0=B8=E5=AE=9E=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=88=97=E8=A1=A8=E6=8A=A5=E9=94=99bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SafetyEnvironmentalInspectorController.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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);