| | |
| | | // list.add(id); |
| | | // } |
| | | |
| | | |
| | | ArrayList<HeatMapDTO> rsHeatMap = new ArrayList<>(); |
| | | |
| | | if (form.equals("hour")){ //小时 |
| | | log.info(""+startTime); |
| | | // log.info(""+startTime); |
| | | String dateString = DateUtils.stringToDateString(startTime, DateUtils.yyyy_MM_dd_HH_EN, DateUtils.yyyyMM_EN); |
| | | // Date date1 = DateUtils.getDate(startTime, DateUtils.yyyy_MM_dd_HH_EN); |
| | | log.info(""+dateString); |
| | | // log.info(""+dateString); |
| | | map.put("organizationIds",list); |
| | | map.put("tableName","_"+dateString); |
| | | |
| | | List<HeatMapDTO> heatMap = deviceMapper.getHeatMapV1(map); |
| | | log.info(heatMap.size()+""); |
| | | // log.info(heatMap.size()+""); |
| | | |
| | | List<HeatMapDTO> collect1 = heatMap.stream().filter(d -> d.getTime() != null).collect(Collectors.toList()); |
| | | if (ObjectUtils.isEmpty(collect1)){ |
| | |
| | | GeoCoordinate geoCoordinate = new GeoCoordinate(); |
| | | doubleArrayList.add(heatMapDTO.getCount()); |
| | | // heatMapDTO.setCount(heatMapDTO.getCount()); |
| | | |
| | | heatMapDTO.setCount(0.0); |
| | | geoCoordinate.setLongitude(heatMapDTO.getLng()); |
| | | geoCoordinate.setLatitude(heatMapDTO.getLat()); |
| | |
| | | double asDouble = doubleArrayList.stream().mapToDouble(Double::valueOf).max().getAsDouble(); |
| | | //获取中心点 |
| | | GeoCoordinate centerPoint = GetCenterPointFromListOfCoordinates.getCenterPoint(geoCoordinates); |
| | | heatMapDTO.setCount(asDouble); |
| | | double rsCode = asDouble - doubleArrayList.size()-1; |
| | | // log.info(asDouble+"-----"+rsCode); |
| | | heatMapDTO.setCount(rsCode<=0.0?0.0:rsCode); |
| | | // heatMapDTO.setSum(asDouble); |
| | | heatMapDTO.setLng(centerPoint.getLongitude()); |
| | | heatMapDTO.setLat(centerPoint.getLatitude()); |
| | | heatMapDTO.setMac(i+""); |
| | | heatMapDTO.setName(integer+""); |
| | | heatMap.add(heatMapDTO); |
| | | i++; |
| | | } |