| | |
| | | start = calendar.getTime(); |
| | | apiPointValueQueryDTO.setStart(start); |
| | | apiPointValueQueryDTO.setEnd(new Date()); |
| | | List<ApiPointValueDTO> monthChartData = dataPointApi.queryPointHistoryValue(apiPointValueQueryDTO); |
| | | List<Double> monthValues = new ArrayList<>(); |
| | | if (!CollectionUtils.isEmpty(monthChartData)) { |
| | | monthValues = monthChartData.stream().map(item -> item.getV()).collect(Collectors.toList()); |
| | | result.setMax(monthValues.stream().max(Double::compareTo).get()); |
| | | result.setMin(monthValues.stream().min(Double::compareTo).get()); |
| | | Map<String, Object> maxV = dataPointApi.queryPointMaxValueRange(apiPointValueQueryDTO); |
| | | Map<String, Object> minV = dataPointApi.queryPointMaxValueRange(apiPointValueQueryDTO); |
| | | if (maxV != null && maxV.containsKey(pointNo)) { |
| | | result.setMax(new BigDecimal(maxV.get(pointNo).toString())); |
| | | } |
| | | if (minV != null && minV.containsKey(pointNo)) { |
| | | result.setMin(new BigDecimal(minV.get(pointNo).toString())); |
| | | } |
| | | return success(result); |
| | | } |
| | |
| | | apiPointValueQueryDTO1.setStart(start1); |
| | | apiPointValueQueryDTO1.setEnd(new Date()); |
| | | apiPointValueQueryDTO1.setPointNo(pointNo); |
| | | List<ApiPointValueDTO> monthChartData = dataPointApi.queryPointHistoryValue(apiPointValueQueryDTO1); |
| | | if (!CollectionUtils.isEmpty(monthChartData)) { |
| | | List<Double> monthValues = monthChartData.stream().map(item -> item.getV()).collect(Collectors.toList()); |
| | | powerHistoryDTO.setMax(monthValues.stream().max(Double::compareTo).get()); |
| | | powerHistoryDTO.setMin(monthValues.stream().min(Double::compareTo).get()); |
| | | Map<String, Object> maxV = dataPointApi.queryPointMaxValueRange(apiPointValueQueryDTO1); |
| | | Map<String, Object> minV = dataPointApi.queryPointMaxValueRange(apiPointValueQueryDTO1); |
| | | if (maxV != null && maxV.containsKey(pointNo)) { |
| | | powerHistoryDTO.setMax(new BigDecimal(maxV.get(pointNo).toString())); |
| | | } |
| | | |
| | | if (minV != null && minV.containsKey(pointNo)) { |
| | | powerHistoryDTO.setMin(new BigDecimal(minV.get(pointNo).toString())); |
| | | } |
| | | result.put(nodeCode, powerHistoryDTO); |
| | | } |
| | | return success(result); |