| | |
| | | public PredictResultVO predict(Date predictTime, ItemVO predictItemDto) |
| | | throws ItemInvokeException{ |
| | | String itemId = predictItemDto.getId(); |
| | | ItemPredictStatus itemStatus = ItemPredictStatus.PREDICTING; |
| | | PredictResultVO finalResult = new PredictResultVO(); |
| | | PredictResultVO predictResult = new PredictResultVO(); |
| | | List<PredictResultVO> predictResultList = new ArrayList<>(); |
| | |
| | | predictResult.setPredictId(itemId); |
| | | predictResultList.add(predictResult); |
| | | } |
| | | itemStatus = ItemPredictStatus.SUCCESS; |
| | | Calendar calendar = Calendar.getInstance(); |
| | | /*Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(predictTime); |
| | | calendar.add(Calendar.MINUTE, predictResult.getPredictMatrix().length - 1); |
| | | Timestamp endTime = new Timestamp(calendar.getTime().getTime()); |
| | | Timestamp endTime = new Timestamp(calendar.getTime().getTime());*/ |
| | | finalResult = predictResultList.get(0); |
| | | |
| | | } catch (Exception ex) { |
| | | ex.printStackTrace(); |
| | | //预测项预测失败的状态 |
| | | itemStatus = ItemPredictStatus.FAILED; |
| | | throw new ItemInvokeException(MessageFormat.format("{0},itemId={1}", |
| | | ItemInvokeException.errorItemFailed, itemId)); |
| | | } |