| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Device> getDevicesByMonitorPointId(List<Integer> monitorPointId) { |
| | | QueryWrapper<Device> wrapper = new QueryWrapper(); |
| | | wrapper.in("monitor_point_id", monitorPointId); |
| | | wrapper.eq("is_delete", Constants.NOT_DELETE); |
| | | wrapper.orderByAsc("dev_num"); |
| | | return deviceMapper.selectList(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getSensorsByMac(Map<String, Object> params) { |
| | | List<String> sensorCodes = Arrays.asList(Constants.SENSOR_CODE_PM25 |
| | | , Constants.SENSOR_CODE_PM10 |
| | |
| | | } |
| | | middleDate = DateUtils.addDays(middleDate,1); |
| | | } |
| | | } else if ("monthly".equals(type)){ |
| | | } else if ("month".equals(type)){ |
| | | end = DateUtils.getDateAddMonth(endTime, 1); |
| | | timeUnits = "monthly"; |
| | | dateFormat = "%Y-%m"; |
| | |
| | | Map<String,Object> historyHourlyMap = new HashMap<>(); |
| | | historyHourlyMap.put("mac",mac); |
| | | JSONObject value = JSONObject.parseObject(historyFiveMinutely.getValue()); |
| | | Double sensorValue = Double.parseDouble(value.get(sensorCode).toString()); |
| | | historyHourlyMap.put(sensorCode,sensorValue); |
| | | if (value.get(sensorCode)==null){ |
| | | historyHourlyMap.put(sensorCode,0.0); |
| | | }else { |
| | | Double sensorValue = Double.parseDouble(value.get(sensorCode).toString()); |
| | | historyHourlyMap.put(sensorCode,sensorValue); |
| | | } |
| | | // Double sensorValue = Double.parseDouble(value.get(sensorCode).toString()); |
| | | // historyHourlyMap.put(sensorCode,sensorValue); |
| | | Date time = historyFiveMinutely.getTime(); |
| | | String timeStr = DateUtils.dateToDateString(time, DateUtils.yyyy_MM_dd_HH_mm_ss_EN); |
| | | historyHourlyMap.put("time",timeStr); |