| | |
| | | * @param predictTime |
| | | * @return |
| | | */ |
| | | public SampleInfo prepareSampleInfo(String modelId, Date predictTime) { |
| | | protected SampleInfo prepareSampleInfo(String modelId, Date predictTime) { |
| | | SampleInfo sampleInfo = new SampleInfo(); |
| | | //调用样本列数的方法 |
| | | sampleInfo.setSampleColumn(getSampleColumn(modelId)); |
| | | // sampleInfo.setSampleColumn(getSampleColumn(modelId)); |
| | | //样本的列信息 |
| | | sampleInfo.setColumnInfo(getColumnInfo(modelId, predictTime)); |
| | | //样本的采样周期 |
| | | sampleInfo.setSampleCycle(getSampleCycle(modelId)); |
| | | // sampleInfo.setSampleCycle(getSampleCycle(modelId)); |
| | | return sampleInfo; |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | protected abstract Integer getSampleColumn(String modelId); |
| | | |
| | | |
| | | /** |
| | | * 样本的列信息 |
| | | * |
| | | * @param modelId |
| | | * @param predictTime |
| | | * @return |
| | | */ |
| | | protected abstract List<ColumnItemPort> getColumnInfo(String modelId, Date predictTime); |
| | | |
| | | /** |
| | | * 样本的采样周期 |
| | | * |
| | | * @param modelId |
| | | * @return |
| | | */ |
| | | protected abstract Integer getSampleCycle(String modelId); |
| | | |
| | | /** |
| | | * 获取开始时间 |
| | |
| | | } |
| | | dateTime = calculateTime(originalTime, true, columnItem.getDataLength(), DataPointFreqEnum.getEumByCode(dataPoint.getMinfreqid()).getValue()); |
| | | break; |
| | | case PREDICTITEM: |
| | | case NORMALITEM: |
| | | case MERGEITEM: |
| | | dateTime = calendar.getTime(); |
| | | break; |
| | | case IND: |
| | |
| | | } |
| | | dateTime = calendar.getTime(); |
| | | break; |
| | | case PREDICTITEM: |
| | | case NORMALITEM: |
| | | case MERGEITEM: |
| | | dateTime = calendar.getTime(); |
| | | break; |
| | | case IND: |
| | |
| | | ApiPointDTO dataPoint = dataPointApi.getInfoById(columnItem.getParamId()); |
| | | granularity = DataPointFreqEnum.getEumByCode(dataPoint.getMinfreqid()).getValue(); |
| | | break; |
| | | case PREDICTITEM: |
| | | granularity = mmPredictItemService.getItemById(columnItem.getParamId()).getGranularity(); |
| | | case NORMALITEM: |
| | | granularity = mmPredictItemService.getItemByOutPutId(columnItem.getParamId()).getGranularity(); |
| | | break; |
| | | case MERGEITEM: |
| | | granularity = mmPredictItemService.getItemByIdFromCache(columnItem.getParamId()).getGranularity(); |
| | | break; |
| | | case IND: |
| | | ApiIndItemDTO indItemDTO = indItemApi.getInfoById(columnItem.getParamId()); |
| | |
| | | } |
| | | return granularity; |
| | | } |
| | | |
| | | /** |
| | | * 样本的列信息 |
| | | * |
| | | * @param modelId |
| | | * @param predictTime |
| | | * @return |
| | | */ |
| | | protected abstract List<ColumnItemPort> getColumnInfo(String modelId, Date predictTime); |
| | | |
| | | /** |
| | | * 样本的采样周期 |
| | | * |
| | | * @param modelId |
| | | * @return |
| | | */ |
| | | protected abstract Integer getSampleCycle(String modelId); |
| | | |
| | | /** |
| | | * 计算取值的时间 |