| | |
| | | switch (ModelParamType.getEumByCode(paramType)) { |
| | | case NORMALITEM: |
| | | case MERGEITEM: |
| | | // 预测值 |
| | | oneMin = granularity * 1000L; |
| | | // 设置时间偏移量 |
| | | if (granularity >= 24*60*60) { |
| | | // 如果时间粒度大于等于一天,因为时区问题,特殊处理,否则时间为8:00,而非0:00 |
| | | start = start - ((start+8*60*60*1000) % oneMin); |
| | | end = end - ((end+8*60*60*1000) % oneMin); |
| | | } else { |
| | | start = start - (start % oneMin); |
| | | end = end - (end % oneMin); |
| | | } |
| | | mins = ((end - start) / oneMin); |
| | | mins = calMins(start, end, granularity); |
| | | break; |
| | | case DATAPOINT: |
| | | case PLAN: |
| | | // 测点值 |
| | | oneMin = 1000L * granularity; |
| | | // 设置时间偏移量 |
| | | if (granularity >= 24*60*60) { |
| | | // 如果时间粒度大于等于一天,因为时区问题,特殊处理,否则时间为8:00,而非0:00 |
| | | start = start - ((start+8*60*60*1000) % oneMin); |
| | | end = end - ((end+8*60*60*1000) % oneMin); |
| | | } else { |
| | | start = start - (start % oneMin); |
| | | end = end - (end % oneMin); |
| | | } |
| | | mins = ((end - start) / oneMin); |
| | | mins = calMins(start, end, granularity); |
| | | break; |
| | | case IND: |
| | | case IND_ASCII: |
| | | // 测点值 |
| | | oneMin = 1000L * granularity; |
| | | // 设置时间偏移量 |
| | | if (granularity >= 24*60*60) { |
| | | // 如果时间粒度大于等于一天,因为时区问题,特殊处理,否则时间为8:00,而非0:00 |
| | | start = start - ((start+8*60*60*1000) % oneMin); |
| | | end = end - ((end+8*60*60*1000) % oneMin); |
| | | } else { |
| | | start = start - (start % oneMin); |
| | | end = end - (end % oneMin); |
| | | } |
| | | mins = ((end - start) / oneMin) + 1; |
| | | mins = calMins(start, end, granularity) + 1; |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | return completionDataEntityList; |
| | | } |
| | | |
| | | private long calMins(long start, long end, Integer granularity) { |
| | | long oneMin = granularity * 1000L; |
| | | // 设置时间偏移量 |
| | | if (granularity >= 24 * 60 * 60) { |
| | | // 如果时间粒度大于等于一天,因为时区问题,特殊处理,否则时间为8:00,而非0:00 |
| | | start = start - ((start + 8 * 60 * 60 * 1000) % oneMin); |
| | | end = end - ((end + 8 * 60 * 60 * 1000) % oneMin); |
| | | } else { |
| | | start = start - (start % oneMin); |
| | | end = end - (end % oneMin); |
| | | } |
| | | return ((end - start) / oneMin); |
| | | } |
| | | |
| | | /** |
| | | * getFirstValue |
| | | * |