From 84080f7498a3c6ba1e2754641a57d0dcc595549e Mon Sep 17 00:00:00 2001 From: liujun Date: Tue, 23 Apr 2024 14:36:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E5=85=AC=E5=8F=B8=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E5=AE=9A=E4=BD=8D=E5=8A=9F=E8=83=BD=E6=8E=A5=E5=8F=A3=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/ApiHomeMajorDangerSourceController.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/main/java/com/zcloud/controller/api/ApiHomeMajorDangerSourceController.java b/src/main/java/com/zcloud/controller/api/ApiHomeMajorDangerSourceController.java index 4f8ecaef..dd88384a 100644 --- a/src/main/java/com/zcloud/controller/api/ApiHomeMajorDangerSourceController.java +++ b/src/main/java/com/zcloud/controller/api/ApiHomeMajorDangerSourceController.java @@ -11,12 +11,14 @@ import com.zcloud.service.majordangersource.MajordangersourceStoragetankService; import com.zcloud.util.DateUtil; import com.zcloud.util.Jurisdiction; import com.zcloud.util.Tools; +import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import java.util.*; +import java.util.stream.Collectors; /** * 说明:可视化-重大危险源 @@ -266,6 +268,21 @@ public class ApiHomeMajorDangerSourceController extends BaseController { pd = this.getPageData(); pd.put("CORPINFO_ID", "035958e685cf4850bc40151c5e0617a6"); // 企业 List varList = majordangersourceService.findAllSourceAndVideo(pd); //获取重大危险源和视频监控 + // 将摄像头和灌区区分开 + if (pd.get("TYPE") != null && StringUtils.isNotEmpty(pd.getString("TYPE"))){ + PageData finalPd = pd; + varList = varList.stream().filter(n -> finalPd.getString("TYPE").equals(n.getString("TYPE"))).collect(Collectors.toList()); + for(PageData pageData:varList){ + if(StringUtils.isBlank(pageData.getString("NAME"))){ + pageData.put("MAP_POINT_NAME",""); + }else { + pageData.put("MAP_POINT_NAME",pageData.getString("NAME")); + } + } + map.put("varList", varList); + }else { + map.put("varList", new ArrayList<>()); + } map.put("varList", varList); map.put("result", errInfo); return map;