| | |
| | | @Override |
| | | public Map<String, List<Map<String, Object>>> queryPointsHistoryValue(ApiPointsValueQueryDTO queryDto) { |
| | | Map<String, List<Map<String, Object>>> data = new HashMap<>(); |
| | | if (queryDto.getStart() == null) { |
| | | queryDto.setStart(new Date()); |
| | | } |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | if (queryDto.getEnd() == null) { |
| | | queryDto.setEnd(new Date()); |
| | | queryDto.setEnd(calendar.getTime()); |
| | | } |
| | | if (queryDto.getStart() == null) { |
| | | calendar.add(Calendar.HOUR_OF_DAY, -1); |
| | | queryDto.setStart(calendar.getTime()); |
| | | } |
| | | |
| | | Map<String, Object> params = new HashMap<>(1); |
| | | params.put("pointNos", queryDto.getPointNos()); |
| | | List<DaPointDTO> pointList = daPointService.list(params); |
| | |
| | | pojo.setType(daPointDTO.getDataType()); |
| | | Date startTime = queryDto.getStart(); |
| | | Date endTime = queryDto.getEnd(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | if (endTime == null) { |
| | | endTime = calendar.getTime(); |
| | | } |
| | | if (startTime == null) { |
| | | calendar.add(Calendar.HOUR_OF_DAY, -1); |
| | | startTime = calendar.getTime(); |
| | | } |
| | | List<Map<String, Object>> list = influxDBService.queryPointValues(pojo, startTime, endTime); |
| | | List<ApiPointValueDTO> pointValueList = new ArrayList<>(); |
| | | for (int i = 0; list.size() - i >= 1; i++) { |