| | |
| | | } |
| | | |
| | | @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<>(); |
| | |
| | | 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; |
| | |
| | | } |
| | | lat1 =lat1-0.0022; |
| | | } |
| | | } |
| | | }*/ |
| | | return distrinList(rsHeatMap); |
| | | } |
| | | |
| | |
| | | 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(); |