| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | protected Date getStartTime(ColumnItem columnItem, Date originalTime, Map<String, ApiPointDTO> pointMap, Map<String, ApiPlanItemDTO> planMap) { |
| | | protected Date getStartTime(ColumnItem columnItem, Date originalTime) { |
| | | Date dateTime = new Date(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(originalTime); |
| | | switch (ModelParamType.getEumByCode(columnItem.getParamType())) { |
| | | case DATAPOINT: |
| | | ApiPointDTO dataPoint = pointMap.get(columnItem.getParamId()); |
| | | if (dataPoint == null) { |
| | | return null; |
| | | } |
| | | dateTime = calculateTime(originalTime, true, columnItem.getDataLength(), DataPointFreqEnum.getEumByCode(dataPoint.getMinfreqid()).getValue()); |
| | | case IND: |
| | | case PLAN: |
| | | dateTime = calculateTime(originalTime, true, columnItem.getDataLength(), columnItem.getGranularity()); |
| | | break; |
| | | case NORMALITEM: |
| | | case MERGEITEM: |
| | | dateTime = calendar.getTime(); |
| | | break; |
| | | case IND: |
| | | dateTime = calculateTime(originalTime, true, columnItem.getDataLength(), 60); |
| | | break; |
| | | case PLAN: |
| | | ApiPlanItemDTO apiPlanItemDTO = planMap.get(columnItem.getParamId()); |
| | | if (apiPlanItemDTO == null) { |
| | | return null; |
| | | } |
| | | dateTime = calculateTime(originalTime, true, columnItem.getDataLength(), TimeGranularitySecEnum.getEumByCode(apiPlanItemDTO.getTimeGranularity()).getValue()); |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | protected Date getEndTime(ColumnItem columnItem, Date originalTime,Map<String, ApiPointDTO> pointMap, Map<String, ApiPlanItemDTO> planMap) { |
| | | protected Date getEndTime(ColumnItem columnItem, Date originalTime) { |
| | | Date dateTime = new Date(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(originalTime); |
| | | switch (ModelParamType.getEumByCode(columnItem.getParamType())) { |
| | | case DATAPOINT: |
| | | case IND: |
| | | case PLAN: |
| | | dateTime = calendar.getTime(); |
| | | break; |
| | | case NORMALITEM: |
| | | case MERGEITEM: |
| | | dateTime = calculateTime(originalTime, false, columnItem.getDataLength(), 60); |
| | | break; |
| | | case IND: |
| | | dateTime = calendar.getTime(); |
| | | break; |
| | | case PLAN: |
| | | dateTime = calendar.getTime(); |
| | | dateTime = calculateTime(originalTime, false, columnItem.getDataLength(), columnItem.getGranularity()); |
| | | break; |
| | | default: |
| | | break; |