| | |
| | | package com.iailab.module.data.point.collection.utils; |
| | | |
| | | import com.iailab.module.data.common.enums.DataTypeEnum; |
| | | import com.iailab.module.data.enums.DataPointFreqEnum; |
| | | import com.iailab.module.data.point.dto.DaPointDTO; |
| | | import com.iailab.module.data.influxdb.pojo.*; |
| | | |
| | | import java.time.Instant; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | |
| | | return new InfluxPointValueStrPOJO(); |
| | | } |
| | | } |
| | | |
| | | public static Instant getByMin(Date collectTime, DataPointFreqEnum freqEnum) { |
| | | Calendar cal = Calendar.getInstance(); |
| | | cal.setTime(collectTime); |
| | | switch (freqEnum) { |
| | | case NET_1MIN: |
| | | cal.set(Calendar.SECOND, 0); |
| | | break; |
| | | case NET_1H: |
| | | cal.set(Calendar.SECOND, 0); |
| | | cal.set(Calendar.MINUTE, 0); |
| | | break; |
| | | case NET_Day: |
| | | cal.set(Calendar.SECOND, 0); |
| | | cal.set(Calendar.MINUTE, 0); |
| | | cal.set(Calendar.HOUR_OF_DAY, 0); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | return cal.getTime().toInstant(); |
| | | } |
| | | } |