|
@@ -11,6 +11,8 @@ import org.apache.commons.lang3.math.NumberUtils;
|
|
|
import org.influxdb.dto.Point;
|
|
import org.influxdb.dto.Point;
|
|
|
import org.springframework.format.annotation.DateTimeFormat;
|
|
import org.springframework.format.annotation.DateTimeFormat;
|
|
|
|
|
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
|
|
+import java.time.ZoneId;
|
|
|
import java.time.ZonedDateTime;
|
|
import java.time.ZonedDateTime;
|
|
|
import java.time.temporal.ChronoUnit;
|
|
import java.time.temporal.ChronoUnit;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -67,11 +69,11 @@ public class ScadaPlatformData {
|
|
|
.findFirst().orElse(null);
|
|
.findFirst().orElse(null);
|
|
|
if (tag == null) return null;
|
|
if (tag == null) return null;
|
|
|
//获取时间戳
|
|
//获取时间戳
|
|
|
- long timestamp = this.t
|
|
|
|
|
|
|
+ long timestamp = LocalDateTime.now()
|
|
|
.truncatedTo(ChronoUnit.MINUTES)
|
|
.truncatedTo(ChronoUnit.MINUTES)
|
|
|
|
|
+ .atZone(ZoneId.systemDefault())
|
|
|
.toInstant()
|
|
.toInstant()
|
|
|
.toEpochMilli();
|
|
.toEpochMilli();
|
|
|
-
|
|
|
|
|
//构建influxdb
|
|
//构建influxdb
|
|
|
return Point
|
|
return Point
|
|
|
//表名
|
|
//表名
|