From 9a1ea011e3cb7579058c27eb3e827f24c477fd94 Mon Sep 17 00:00:00 2001 From: liujun Date: Thu, 27 Jun 2024 13:18:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BE=B9=E7=95=8C=E5=85=A5=E4=BE=B5=EF=BC=8C?= =?UTF-8?q?=E4=BC=81=E4=B8=9A=E7=AB=AF=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zcloud/controller/map/MapController.java | 2 +- .../map/MapPlatFormElectronicController.java | 37 ++++++++++++++++++- .../datasource/system/DictionariesMapper.java | 2 + .../service/system/DictionariesService.java | 1 + .../system/impl/DictionariesServiceImpl.java | 5 +++ .../datasource/system/DictionariesMapper.xml | 19 ++++++++++ 6 files changed, 64 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/zcloud/controller/map/MapController.java b/src/main/java/com/zcloud/controller/map/MapController.java index d676c8fe..29985779 100644 --- a/src/main/java/com/zcloud/controller/map/MapController.java +++ b/src/main/java/com/zcloud/controller/map/MapController.java @@ -939,7 +939,7 @@ public class MapController extends BaseController { AlarmGet alarmGet = new AlarmGet(); alarmGet.setPage(new com.zcloud.service.dw.dto.Page()); alarmGet.getPage().setCurrent("1"); - alarmGet.getPage().setSize("12"); + alarmGet.getPage().setSize("5"); alarmGet.setCorpId(pd.getString("corpId")); map.put("result", "success"); map.put("alarmList", dwService.getAlarmList(alarmGet)); diff --git a/src/main/java/com/zcloud/controller/map/MapPlatFormElectronicController.java b/src/main/java/com/zcloud/controller/map/MapPlatFormElectronicController.java index 050c6ff0..be50910a 100644 --- a/src/main/java/com/zcloud/controller/map/MapPlatFormElectronicController.java +++ b/src/main/java/com/zcloud/controller/map/MapPlatFormElectronicController.java @@ -4,12 +4,15 @@ import com.zcloud.controller.base.BaseController; import com.zcloud.entity.PageData; import com.zcloud.service.keyProjects.PlatformvideomanagementService; import com.zcloud.service.map.util.HKPostUtil; +import com.zcloud.service.system.DictionariesService; +import org.apache.commons.lang3.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 com.zcloud.service.map.PlatformelectronicService; +import javax.annotation.Resource; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -55,6 +58,8 @@ public class MapPlatFormElectronicController extends BaseController { return map; } + @Resource + private DictionariesService dictionariesService; /**地图插点 * @throws Exception @@ -66,10 +71,40 @@ public class MapPlatFormElectronicController extends BaseController { String errInfo = "success"; PageData pd = this.getPageData(); if ("bianjieruqin".equals(pd.getString("TYPE"))){ - List varList = platformvideomanagementService.listAll(pd); //列出Platformvideomanagement列表 + if (StringUtils.isEmpty(pd.getString("CORPINFO_ID"))){ + pd.put("CORPINFO_ID",pd.get("corpId")); + } + //列出Platformvideomanagement列表 + PageData condition = new PageData(); + List varList = platformvideomanagementService.listAll(pd); for (PageData data : varList) { data.put("MAP_POINT_NAME", data.getString("NAME")); + condition.clear(); + condition.put("INDEXCODE",data.getString("INDEXCODE")); + //增加容错 + List list = platformelectronicService.listAll(condition); + if (list.size() > 0){ + data.put("FANGQU_IDS",list.get(0).getString("FANGQU_IDS")); + } } + condition.clear(); + condition.put("PARENT_ID","f0bae7becdee4d779a2cb82037948ab4"); + Map> tongJi = new HashMap<>(); + List dic = dictionariesService.findByCondition(condition); + // 找出要统计的图标信息 + for (PageData _dic : dic){ + condition.clear(); + condition.put("PARENT_ID",_dic.getString("DICTIONARIES_ID")); + List dic2 = dictionariesService.findByCondition(condition); + for (PageData _dic2 : dic2){ + _dic2.put("NAME",_dic.getString("NAME") + _dic2.getString("NAME")); + // 统计不同防区中的不同的 + _dic2.put("num",varList.stream().filter(n -> n.getString("FANGQU_IDS").contains(_dic2.getString("DICTIONARIES_ID"))).count()); + } + tongJi.put(_dic.getString("NAME"),dic2); + } + map.put("iconData",tongJi); + // 根据统计的数据 map.put("varList", varList); map.put("result", errInfo); return map; diff --git a/src/main/java/com/zcloud/mapper/datasource/system/DictionariesMapper.java b/src/main/java/com/zcloud/mapper/datasource/system/DictionariesMapper.java index b7c8ad88..fa470a66 100644 --- a/src/main/java/com/zcloud/mapper/datasource/system/DictionariesMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/system/DictionariesMapper.java @@ -106,4 +106,6 @@ public interface DictionariesMapper { */ List getIdsByRecuByParentId(String parentId); List getIdsByParentIds(List parentIds); + + List findByCondition(PageData condition); } diff --git a/src/main/java/com/zcloud/service/system/DictionariesService.java b/src/main/java/com/zcloud/service/system/DictionariesService.java index 8712c5f3..f7a058aa 100644 --- a/src/main/java/com/zcloud/service/system/DictionariesService.java +++ b/src/main/java/com/zcloud/service/system/DictionariesService.java @@ -151,4 +151,5 @@ public interface DictionariesService { */ public List getIdsByParentIds(List parentIds) throws Exception; + List findByCondition(PageData condition) throws Exception; } diff --git a/src/main/java/com/zcloud/service/system/impl/DictionariesServiceImpl.java b/src/main/java/com/zcloud/service/system/impl/DictionariesServiceImpl.java index 367da87b..3638c3f6 100644 --- a/src/main/java/com/zcloud/service/system/impl/DictionariesServiceImpl.java +++ b/src/main/java/com/zcloud/service/system/impl/DictionariesServiceImpl.java @@ -256,4 +256,9 @@ public class DictionariesServiceImpl implements DictionariesService { return dictionariesMapper.getIdsByParentIds(parentIds); } + @Override + public List findByCondition(PageData condition) throws Exception { + return dictionariesMapper.findByCondition(condition); + } + } diff --git a/src/main/resources/mybatis/datasource/system/DictionariesMapper.xml b/src/main/resources/mybatis/datasource/system/DictionariesMapper.xml index 9f5c464d..cc960f73 100644 --- a/src/main/resources/mybatis/datasource/system/DictionariesMapper.xml +++ b/src/main/resources/mybatis/datasource/system/DictionariesMapper.xml @@ -266,4 +266,23 @@ #{PARENT_ID} +