| | |
| | | } |
| | | |
| | | @Override |
| | | public List<DataValueVO> getPredictValue(String outputId, Date predictTime) { |
| | | List<DataValueVO> result = new ArrayList<>(); |
| | | QueryWrapper<StAdjustResultEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("output_id", outputId) |
| | | .eq("adjust_time", DateUtils.format(predictTime, DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)); |
| | | StAdjustResultEntity data = baseDao.selectOne(wrapper); |
| | | if (data == null || StringUtils.isBlank(data.getJsonValue())) { |
| | | return result; |
| | | } |
| | | List<Double> valueList = JSONArray.parseArray(data.getJsonValue(), Double.class); |
| | | if (CollectionUtils.isEmpty(valueList)) { |
| | | return result; |
| | | } |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(predictTime); |
| | | for (int i = 1; i < valueList.size() + 1; i++) { |
| | | calendar.add(Calendar.MINUTE, i); |
| | | DataValueVO vo = new DataValueVO(); |
| | | vo.setDataValue(valueList.get(i - 1)); |
| | | vo.setDataTime(calendar.getTime()); |
| | | result.add(vo); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public List<Object[]> getData(String outputId, Date predictTime, String timeFormat) { |
| | | List<Object[]> result = new ArrayList<>(); |
| | | QueryWrapper<StAdjustResultEntity> wrapper = new QueryWrapper<>(); |