From d0b261f701c86f55dd04365c620fb6f79cbe5c62 Mon Sep 17 00:00:00 2001
From: jinpengyong <jpy123456>
Date: Thu, 20 Jun 2024 13:11:12 +0800
Subject: [PATCH] fix:盐城热力图接口修改提交

---
 screen-api/src/main/java/com/moral/api/service/impl/DataDisplayServiceImpl.java |  151 +++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 136 insertions(+), 15 deletions(-)

diff --git a/screen-api/src/main/java/com/moral/api/service/impl/DataDisplayServiceImpl.java b/screen-api/src/main/java/com/moral/api/service/impl/DataDisplayServiceImpl.java
index 84c58c2..5646116 100644
--- a/screen-api/src/main/java/com/moral/api/service/impl/DataDisplayServiceImpl.java
+++ b/screen-api/src/main/java/com/moral/api/service/impl/DataDisplayServiceImpl.java
@@ -571,10 +571,11 @@
     }
 
     @Override
-    public List<HeatMapDTO> getHeatMapDataV2(Integer id, String startTime, String type, String form) {
+    public List<HeatMapDTO> getHeatMapDataV2(Integer id, String startTime, String type, String form,Integer monitorId) {
         HashMap<String, Object> map = new HashMap<>();
         map.put("start",startTime);
         map.put("type","$."+ type);
+        map.put("monitorId",monitorId);
         ArrayList<Integer> list = new ArrayList<>();
         list.add(id);
         ArrayList<HeatMapDTO> rsHeatMap = new ArrayList<>();
@@ -685,7 +686,125 @@
                 rsHeatMap.add(heatMapDTO);
             }
         }
-       if (id==73){
+
+        if (!ObjectUtils.isEmpty(monitorId)){
+            if (monitorId==117){
+                double lat =33.35001;
+                double lng =120.142939;
+                for (int i = 0; i <24 ; i++) {
+                    for (int j = 0; j < 20; j++) {
+                        HeatMapDTO heatMapDTO = new HeatMapDTO();
+                        heatMapDTO.setCount(0.0);
+                        heatMapDTO.setLat(lat);
+                        heatMapDTO.setLng(lng);
+                        heatMapDTO.setName("1");
+                        heatMapDTO.setMac(i+"10"+j);
+                        rsHeatMap.add(heatMapDTO);
+                        lng=lng+0.0021;
+                        if (j==19){
+                            lng=120.142939;
+                        }
+                    }
+                    lat =lat-0.0011;
+                }
+            } else if (monitorId==118){
+                double lat =33.375618;
+                double lng =120.14271;
+                for (int i = 0; i <24 ; i++) {
+                    for (int j = 0; j < 17; j++) {
+                        HeatMapDTO heatMapDTO = new HeatMapDTO();
+                        heatMapDTO.setCount(0.0);
+                        heatMapDTO.setLat(lat);
+                        heatMapDTO.setLng(lng);
+                        heatMapDTO.setName("1");
+                        heatMapDTO.setMac(i+"10"+j);
+                        rsHeatMap.add(heatMapDTO);
+                        lng=lng+0.0021;
+                        if (j==16){
+                            lng=120.14271;
+                        }
+                    }
+                    lat =lat-0.0011;
+                }
+            } else if (monitorId==120){
+                double lat =33.410581;
+                double lng =120.108739;
+                for (int i = 0; i <21 ; i++) {
+                    for (int j = 0; j < 15; j++) {
+                        HeatMapDTO heatMapDTO = new HeatMapDTO();
+                        heatMapDTO.setCount(0.0);
+                        heatMapDTO.setLat(lat);
+                        heatMapDTO.setLng(lng);
+                        heatMapDTO.setName("1");
+                        heatMapDTO.setMac(i+"10"+j);
+                        rsHeatMap.add(heatMapDTO);
+                        lng=lng+0.0021;
+                        if (j==14){
+                            lng=120.108739;
+                        }
+                    }
+                    lat =lat-0.001;
+                }
+            }else if (monitorId==121){
+                double lat =33.398466;
+                double lng =120.153462;
+                for (int i = 0; i <13 ; i++) {
+                    for (int j = 0; j < 16; j++) {
+                        HeatMapDTO heatMapDTO = new HeatMapDTO();
+                        heatMapDTO.setCount(0.0);
+                        heatMapDTO.setLat(lat);
+                        heatMapDTO.setLng(lng);
+                        heatMapDTO.setName("1");
+                        heatMapDTO.setMac(i+"10"+j);
+                        rsHeatMap.add(heatMapDTO);
+                        lng=lng+0.00085;
+                        if (j==15){
+                            lng=120.153462;
+                        }
+                    }
+                    lat =lat-0.001;
+                }
+            }else if (monitorId==122){
+                double lat =33.210894;
+                double lng =120.424509;
+                for (int i = 0; i <15 ; i++) {
+                    for (int j = 0; j < 9; j++) {
+                        HeatMapDTO heatMapDTO = new HeatMapDTO();
+                        heatMapDTO.setCount(0.0);
+                        heatMapDTO.setLat(lat);
+                        heatMapDTO.setLng(lng);
+                        heatMapDTO.setName("1");
+                        heatMapDTO.setMac(i+"10"+j);
+                        rsHeatMap.add(heatMapDTO);
+                        lng=lng+0.0021;
+                        if (j==8){
+                            lng=120.424509;
+                        }
+                    }
+                    lat =lat-0.001;
+                }
+            }else if (monitorId==119){
+                double lat =33.384755;
+                double lng =120.20625;
+                for (int i = 0; i <14 ; i++) {
+                    for (int j = 0; j < 12; j++) {
+                        HeatMapDTO heatMapDTO = new HeatMapDTO();
+                        heatMapDTO.setCount(0.0);
+                        heatMapDTO.setLat(lat);
+                        heatMapDTO.setLng(lng);
+                        heatMapDTO.setName("1");
+                        heatMapDTO.setMac(i+"10"+j);
+                        rsHeatMap.add(heatMapDTO);
+                        lng=lng+0.0021;
+                        if (j==11){
+                            lng=120.20625;
+                        }
+                    }
+                    lat =lat-0.001;
+                }
+            }
+        }
+    /*   if (id==73){
            //���������
            double lat =33.414538;
            double lng =120.066616;
@@ -724,7 +843,7 @@
                }
                lat1 =lat1-0.0022;
            }
-       }
+       }*/
         return distrinList(rsHeatMap);
     }
 
@@ -743,21 +862,23 @@
             ArrayList<Double> doubleArrayList = new ArrayList<>();
             ArrayList<GeoCoordinate> geoCoordinates = new ArrayList<>();
             List<HeatMapDTO> heatMapDTOS = collect.get(integer);
-            for (HeatMapDTO heatMapDTO : heatMapDTOS) {
-                GeoCoordinate geoCoordinate = new GeoCoordinate();
-                doubleArrayList.add(heatMapDTO.getCount());
+            if (heatMapDTOS.size()>1){
+                for (HeatMapDTO heatMapDTO : heatMapDTOS) {
+                    GeoCoordinate geoCoordinate = new GeoCoordinate();
+                    doubleArrayList.add(heatMapDTO.getCount());
 //                heatMapDTO.setCount(heatMapDTO.getCount());
-                if (type.equals("a21026")){
-                    heatMapDTO.setCount(1.0);
-                }else {
-                    heatMapDTO.setCount(0.0);
-                }
+                    if (type.equals("a21026")){
+                        heatMapDTO.setCount(1.0);
+                    }else {
+                        heatMapDTO.setCount(0.0);
+                    }
 
-                geoCoordinate.setLongitude(heatMapDTO.getLng());
-                geoCoordinate.setLatitude(heatMapDTO.getLat());
-                geoCoordinates.add(geoCoordinate);
+                    geoCoordinate.setLongitude(heatMapDTO.getLng());
+                    geoCoordinate.setLatitude(heatMapDTO.getLat());
+                    geoCoordinates.add(geoCoordinate);
+                }
             }
-            if (!ObjectUtils.isEmpty(doubleArrayList)){
+            if (!ObjectUtils.isEmpty(doubleArrayList) &&doubleArrayList.size()>1){
                 HeatMapDTO heatMapDTO = new HeatMapDTO();
                 //������������������
                 double asDouble = doubleArrayList.stream().mapToDouble(Double::valueOf).max().getAsDouble();

--
Gitblit v1.8.0