| | |
| | | parameters.put("sensors", Arrays.asList(sensorKey)); |
| | | // monitorPointService.isCompensateCalculation(parameters); |
| | | list = historyMinutelyService.getMonitorPointOrDeviceAvgData(parameters); |
| | | list.remove(0); |
| | | if (list.size() == 23) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd"); |
| | | //获取全格式时间yyyy-MM-dd HH:mm:ss |
| | | time1 = time1 + " 00:00:00"; |
| | | Date date = sdf.parse(time1); |
| | | date = DateUtil.rollDay(date, 1); |
| | | //将全格式时间截取 |
| | | String time2 = sdf2.format(date); |
| | | parameters.put("time", time2); |
| | | List<Map<String, Object>> nextDayList = historyMinutelyService.getMonitorPointOrDeviceAvgData(parameters); |
| | | if(!ObjectUtils.isEmpty(nextDayList)){ |
| | | time1=time1.replaceAll(" 00:00:00"," 24"); |
| | | Map<String, Object> datas = nextDayList.get(0); |
| | | datas.put("time",time1); |
| | | list.add(datas); |
| | | } |
| | | } |
| | | for (Map<String, Object> map : list) { |
| | | String time = map.get("time").toString(); |
| | | time = time.substring(time.length() - 2); |
| | | map.put("time", Integer.valueOf(time)); |
| | | if (parameters.get("type").equals("day")) { |
| | | /* if (parameters.get("type").equals("day")) { |
| | | map.put("time", Integer.valueOf(time) + 1); |
| | | } |
| | | }*/ |
| | | map.put("value", map.remove(sensorKey)); |
| | | } |
| | | } |