| | |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(predictResult.getPredictTime()); |
| | | for (Integer i = 0; i < rows; i++) { |
| | | // 从下个时间粒度开始 |
| | | calendar.add(Calendar.SECOND, predictResult.getGranularity()); |
| | | |
| | | DataValueVO predictData = new DataValueVO(); |
| | | predictData.setDataTime(calendar.getTime()); |
| | | predictData.setDataValue(Double.valueOf(entry.getValue()[i])); |
| | | predictDataList.add(predictData); |
| | | |
| | | calendar.add(Calendar.SECOND, predictResult.getGranularity()); |
| | | } |
| | | resultMap.put(entry.getKey().getId(), predictDataList); |
| | | predictLists.put(entry.getKey().getResultstr(), predictDataList); |
| | |
| | | // 时间 预测时间+预测长度*粒度 |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(predictResult.getPredictTime()); |
| | | calendar.add(Calendar.SECOND, predictResult.getGranularity() * (rows - 1)); |
| | | calendar.add(Calendar.SECOND, predictResult.getGranularity() * rows); |
| | | predictData.setDataTime(calendar.getTime()); |
| | | //值 所有值相加/除数 |
| | | BigDecimal sum = BigDecimal.valueOf(Arrays.stream(entry.getValue()).sum()); |
| | |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(predictResult.getPredictTime()); |
| | | for (Integer i = 0; i < rows; i++) { |
| | | // 从下个时间粒度开始 |
| | | calendar.add(Calendar.SECOND, predictResult.getGranularity()); |
| | | |
| | | DataValueVO predictData = new DataValueVO(); |
| | | predictData.setDataTime(calendar.getTime()); |
| | | predictData.setDataValue(Double.valueOf(entry.getValue()[i])); |
| | | predictDataList.add(predictData); |
| | | |
| | | calendar.add(Calendar.SECOND, predictResult.getGranularity()); |
| | | } |
| | | predictLists.put(entry.getKey().getResultstr(), predictDataList); |
| | | } |
| | |
| | | * savePredictAdjustResult |
| | | * |
| | | * @param predictResult |
| | | * @param configId |
| | | */ |
| | | @DSTransactional |
| | | public void savePredictAdjustResult(PredictResultVO predictResult, String adjustValue, String scheduleModelId) { |
| | | public void savePredictAdjustResult(PredictResultVO predictResult, String adjustValue, String scheduleModelId, String configId) { |
| | | Map<String, List<DataValueVO>> resultMap = convertToPredictData(predictResult); |
| | | stAdjustResultService.saveResult(resultMap, predictResult.getPredictTime(), adjustValue, scheduleModelId); |
| | | stAdjustResultService.saveResult(resultMap, predictResult.getPredictTime(), adjustValue, scheduleModelId,configId); |
| | | } |
| | | |
| | | public List<DataValueVO> getPredictValueByItemNo(String itemNo, Date start, Date end) { |