From 4836dc00a01668693659bf6a5a0b3ecd09ce7aef Mon Sep 17 00:00:00 2001
From: puhanshu <a9236326>
Date: 星期五, 31 十二月 2021 11:27:53 +0800
Subject: [PATCH] 大屏事件接口新增

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BigScreenStatisticsServiceImpl.java |   34 +++++++++++++++++++++++-----------
 1 files changed, 23 insertions(+), 11 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BigScreenStatisticsServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BigScreenStatisticsServiceImpl.java
index 6227c0b..0864e7c 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BigScreenStatisticsServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BigScreenStatisticsServiceImpl.java
@@ -265,17 +265,6 @@
             });
         }
         statisticsVO.setVillageStatisticsList(villageStatisticsList);
-        // 查询社区事件列表
-        List<EventGridIncidentStatisticsVO> gridIncidentList = comMngPopulationDAO.getGridsGovernanceEventList(communityId);
-        if (!gridIncidentList.isEmpty()) {
-            gridIncidentList.forEach(e -> {
-                if (e.getEventType().equals(2)) {
-                    String[] lngLatString = e.getLatLng().split(",");
-                    e.setLatLng(lngLatString[1] + "," + lngLatString[0]);
-                }
-            });
-        }
-        statisticsVO.setGridIncidentList(gridIncidentList);
         //事件分析新增折线数据
         Date nowDate = new Date();
         List<StatisticsCommVO> eventAddPolylineData = comPropertyDao.getEventAddPolylineData(communityId);
@@ -833,6 +822,29 @@
         return R.ok(comActActivityDAO.indexActList(page, pageBaseDTO, false));
     }
 
+    /**
+     * 清网治格-根据事件分类获取近1月的社区事件数据
+     * @param type
+     * @param communityId
+     * @return
+     */
+    @Override
+    public R getEventList(Integer type, Long communityId) {
+        // 查询社区事件列表
+        List<EventGridIncidentStatisticsVO> gridIncidentList = comMngPopulationDAO.getGridsGovernanceEventList(communityId);
+        List<EventGridIncidentStatisticsVO> returnGridIncidentList = new ArrayList<>();
+        if (!gridIncidentList.isEmpty()) {
+            gridIncidentList.forEach(e -> {
+                if (e.getEventType().equals(2)) {
+                    String[] lngLatString = e.getLatLng().split(",");
+                    e.setLatLng(lngLatString[1] + "," + lngLatString[0]);
+                }
+            });
+            returnGridIncidentList = gridIncidentList.stream().filter(e -> type.equals(e.getType())).collect(Collectors.toList());
+        }
+        return R.ok(returnGridIncidentList);
+    }
+
     private Page retrievePage(PageBaseDTO pageBaseDTO) {
         Long pageNum = pageBaseDTO.getPageNum();
         Long size = pageBaseDTO.getPageSize();

--
Gitblit v1.7.1