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;