| | |
| | | } else if (PredGranularityEnum.D1.getCode().equals(predictItem.getGranularity())) { |
| | | calendar.set(Calendar.MINUTE, 0); |
| | | calendar.set(Calendar.HOUR_OF_DAY, 0); |
| | | // calendar.add(Calendar.DAY_OF_YEAR, 1);//天粒度数据23:58分插入,运行时间改为第二天 |
| | | } |
| | | PredictResultVO predictResult; |
| | | if (!predictItem.getStatus().equals(ItemStatus.STATUS1.getCode())) { |
| | |
| | | } |
| | | } |
| | | |
| | | public void predictAdjust(ItemVO predictItem, Date predictTime, List<StAdjustDeviationDTO> deviationList, String scheduleModelId) { |
| | | public void predictAdjust(ItemVO predictItem, Date predictTime, List<StAdjustDeviationDTO> deviationList, String scheduleModelId, String configId) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(predictTime); |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | |
| | | try { |
| | | PredictItemHandler predictItemHandler = predictItemFactory.create(predictItem.getId()); |
| | | PredictResultVO predictResult = predictItemHandler.predictAdjust(calendar.getTime(), predictItem, deviationList); |
| | | predictResult.setGranularity(predictItem.getGranularity()); |
| | | predictResult.setSaveIndex(predictItem.getSaveIndex()); |
| | | |
| | | // 保存预测结果 |
| | | predictResultHandler.savePredictAdjustResult(predictResult, JSONArray.toJSONString(deviationList), scheduleModelId); |
| | | predictResultHandler.savePredictAdjustResult(predictResult, JSONArray.toJSONString(deviationList), scheduleModelId,configId); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error(MessageFormat.format("预测项编号:{0},预测项名称:{1},预测失败:{2} 预测时刻:{3}", |