| | |
| | | |
| | | Map<String, Object> realDataMap = new HashMap<>(); |
| | | if (StringUtils.isNotBlank(outPut.getPointid())) { |
| | | dataView.setRealData(getHisData(outPut.getPointid(), startTime, endTime, timeFormat)); |
| | | dataView.setRealData(getHisData(outPut.getPointid(), startTime, endTime, timeFormat, decimalPlaces)); |
| | | dataView.getRealData().forEach(item -> { |
| | | realDataMap.put(item[0].toString(), item[1]); |
| | | }); |
| | |
| | | } |
| | | |
| | | // 调整预测值 |
| | | dataView.setAdjData(stAdjustResultService.getData(outPut.getId(),predictTime,timeFormat)); |
| | | dataView.setAdjData(stAdjustResultService.getData(outPut.getId(), predictTime, timeFormat, decimalPlaces)); |
| | | dataView.setLineType(lineType.getCode()); |
| | | switch (lineType) { |
| | | case TN: |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取真实值 |
| | | * |
| | | * @param pointId |
| | | * @param startTime |
| | | * @param endTime |
| | | * @param timeFormat |
| | | * @return |
| | | */ |
| | | private List<Object[]> getHisData(String pointId, Date startTime, Date endTime, String timeFormat, int decimalPlaces) { |
| | | List<Object[]> result = new ArrayList<>(); |
| | | ApiPointDTO pointDTO = dataPointApi.getInfoById(pointId); |
| | | ApiPointValueQueryDTO queryPointDto = new ApiPointValueQueryDTO(); |
| | | queryPointDto.setPointNo(pointDTO.getPointNo()); |
| | | queryPointDto.setStart(startTime); |
| | | queryPointDto.setEnd(endTime); |
| | | List<ApiPointValueDTO> valueDTOS = dataPointApi.queryPointHistoryValue(queryPointDto); |
| | | if (CollectionUtils.isEmpty(valueDTOS)) { |
| | | return result; |
| | | } |
| | | valueDTOS.forEach(item -> { |
| | | Object[] values = new Object[2]; |
| | | values[0] = DateUtils.format(item.getT(), timeFormat); |
| | | values[1] = new BigDecimal(item.getV()).setScale(decimalPlaces, BigDecimal.ROUND_HALF_UP); |
| | | result.add(values); |
| | | }); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 新增预警信息 |
| | | * |
| | | * @param dto |