| | |
| | | * @param dataEntityList |
| | | * @param startTime |
| | | * @param endTime |
| | | * @param planMap |
| | | * @return |
| | | */ |
| | | public List<DataValueVO> completionData(int length, List<DataValueVO> dataEntityList, Date startTime, Date endTime, |
| | | String paramId, String paramType, Map<String, ApiPointDTO> pointMap, Map<String, ApiPlanItemDTO> planMap) { |
| | | public List<DataValueVO> completionData(int length, List<DataValueVO> dataEntityList, Date startTime, Date endTime, String paramType, Integer granularity) { |
| | | if (CollectionUtils.isEmpty(dataEntityList) || length == dataEntityList.size()) { |
| | | return dataEntityList; |
| | | } else if (length < dataEntityList.size()) { |
| | |
| | | case NORMALITEM: |
| | | case MERGEITEM: |
| | | // 预测值 |
| | | oneMin = PredGranularityEnum.MIN1.getCode() * 1000L; |
| | | oneMin = granularity * 1000L; |
| | | start = start - (start % oneMin); |
| | | end = end - (end % oneMin); |
| | | mins = ((end - start) / oneMin) + 1; |
| | | mins = ((end - start) / oneMin); |
| | | break; |
| | | case DATAPOINT: |
| | | case PLAN: |
| | | // 测点值 |
| | | ApiPointDTO dataPoint = pointMap.get(paramId); |
| | | oneMin = 1000L * DataPointFreqEnum.getEumByCode(dataPoint.getMinfreqid()).getValue(); |
| | | oneMin = 1000L * granularity; |
| | | // 设置时间偏移量 |
| | | start = start - (start % oneMin) + oneMin; |
| | | end = end - (end % oneMin) + oneMin; |
| | |
| | | calendar2.set(Calendar.MINUTE, 0); |
| | | calendar2.set(Calendar.SECOND, 0); |
| | | end = calendar2.getTime().getTime(); |
| | | mins = ((end - start) / oneMin); |
| | | break; |
| | | case PLAN: |
| | | // 计划数据 |
| | | ApiPlanItemDTO planItem = planMap.get(paramId); |
| | | oneMin = 1000L * TimeGranularitySecEnum.getEumByCode(planItem.getTimeGranularity()).getValue(); |
| | | // 设置时间偏移量 |
| | | start = start - (start % oneMin) + oneMin; |
| | | end = end - (end % oneMin) + oneMin; |
| | | mins = ((end - start) / oneMin); |
| | | break; |
| | | default: |