| | |
| | | calendar.add(Calendar.HOUR_OF_DAY, 1); |
| | | endTime = calendar.getTime(); |
| | | } |
| | | if (endTime.getTime() <= startTime.getTime()) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(startTime); |
| | | calendar.add(Calendar.HOUR_OF_DAY, 1); |
| | | endTime = calendar.getTime(); |
| | | } |
| | | |
| | | List<String> categories = DateUtils.getTimeScale(startTime, endTime, predictItem.getGranularity()); |
| | | List<String> legend = new ArrayList<>(); |
| | | LinkedHashMap<String, PreDataSampleViewRespDTO> viewMap = new LinkedHashMap<>(); |
| | |
| | | valueDTOS.forEach(item -> { |
| | | Object[] values = new Object[2]; |
| | | values[0] = DateUtils.format(item.getDataTime(), DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND); |
| | | values[1] = item.getDataValue(); |
| | | values[1] = new BigDecimal(item.getDataValue()).setScale(2, BigDecimal.ROUND_HALF_UP); |
| | | result.add(values); |
| | | }); |
| | | return result; |