|  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private HistoryHourlyMapper historyHourlyMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private HistoryHourlyService historyHourlyService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public List<Map<String, Object>> getDateByOrgIdAndCondition(Map map) { | 
|---|
|  |  |  | int orgId = Integer.parseInt(map.get("organization_id").toString()); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (type.equals("hourly")){ | 
|---|
|  |  |  | Date houtly_time = DateUtils.getDate(time+":00:00",DateUtils.yyyy_MM_dd_HH_mm_ss_EN); | 
|---|
|  |  |  | Date hourly_time = DateUtils.getDate(time+":00:00",DateUtils.yyyy_MM_dd_HH_mm_ss_EN); | 
|---|
|  |  |  | QueryWrapper<HistoryHourly> wrapper = new QueryWrapper<>(); | 
|---|
|  |  |  | wrapper.in("mac", deviceMacs); | 
|---|
|  |  |  | wrapper.eq("time", houtly_time); | 
|---|
|  |  |  | List<HistoryHourly> historyHourlies = historyHourlyMapper.selectList(wrapper); | 
|---|
|  |  |  | wrapper.eq("time", hourly_time); | 
|---|
|  |  |  | List<HistoryHourly> historyHourlies = historyHourlyService.getHourlyDataByMacs(deviceMacs,time); | 
|---|
|  |  |  | for (HistoryHourly historyHourly : historyHourlies) { | 
|---|
|  |  |  | historyDataMap.put(historyHourly.getMac(), JSON.parseObject(JSON.toJSONString(historyHourly), Map.class)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | Device device = devicesMap.get(key); | 
|---|
|  |  |  | double getmeter1 = LongitudeAndLatitudeUtils.getmeter(point_lon, point_lat, device.getLongitude(), device.getLatitude()); | 
|---|
|  |  |  | if (getmeter1<getmeter){ | 
|---|
|  |  |  | getmeter=getmeter1; | 
|---|
|  |  |  | near_mac = device.getMac(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Map<String, Object> map = historyDataMap.get(near_mac); | 
|---|
|  |  |  | String value = map.get("value").toString(); | 
|---|
|  |  |  | JSONObject jsonObject = JSONObject.parseObject(value); | 
|---|
|  |  |  | Double sensorValue = Double.parseDouble(jsonObject.get(sensorCode).toString()); | 
|---|
|  |  |  | resultMap.put("lon",point_lon); | 
|---|
|  |  |  | resultMap.put("lat",point_lat); | 
|---|
|  |  |  | resultMap.put("value",sensorValue); | 
|---|
|  |  |  | resultList.add(resultMap); | 
|---|
|  |  |  | if (map != null){ | 
|---|
|  |  |  | String value = map.get("value").toString(); | 
|---|
|  |  |  | JSONObject jsonObject = JSONObject.parseObject(value); | 
|---|
|  |  |  | Double sensorValue = Double.parseDouble(jsonObject.get(sensorCode).toString()); | 
|---|
|  |  |  | resultMap.put("lon",point_lon); | 
|---|
|  |  |  | resultMap.put("lat",point_lat); | 
|---|
|  |  |  | resultMap.put("value",sensorValue); | 
|---|
|  |  |  | resultList.add(resultMap); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | point_lat = DoubleUtils.add(point_lat,lat_ontShare); | 
|---|
|  |  |  | } | 
|---|