From aa0382e44311f9f7e62a688c8fcaa9c69a512e0f Mon Sep 17 00:00:00 2001
From: dengzedong <dengzedong@email>
Date: 星期二, 24 十二月 2024 15:15:10 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/influxdb/service/impl/InfluxDBServiceImpl.java |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/influxdb/service/impl/InfluxDBServiceImpl.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/influxdb/service/impl/InfluxDBServiceImpl.java
index be08f61..9a96695 100644
--- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/influxdb/service/impl/InfluxDBServiceImpl.java
+++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/influxdb/service/impl/InfluxDBServiceImpl.java
@@ -62,9 +62,9 @@
 
     private InfluxQLQueryApi influxQLQueryApi;
 
-    private String VALUE = "value";
+    public static final String VALUE = "value";
 
-    private String TIME = "time";
+    public static final String TIME = "time";
 
     private int rawOffset = TimeZone.getDefault().getRawOffset();
 
@@ -118,7 +118,8 @@
         }
         if (!CollectionUtils.isEmpty(pointValues)) {
             pointValues.forEach(item -> {
-                writeApi.writeMeasurement(influxDBInstance.bucket, influxDBInstance.org, WritePrecision.MS, item);
+                String bucket = influxDBInstance.getBucket();
+                writeApi.writeMeasurement(bucket, influxDBInstance.org, WritePrecision.MS, item);
             });
         }
         writeApi.flush();
@@ -131,6 +132,7 @@
         }
         if (!CollectionUtils.isEmpty(tagValues)) {
             tagValues.forEach(item -> {
+                log.info("bucket==="+ influxDBInstance.getBucket() + ",org===" + influxDBInstance.org);
                 writeApi.writeMeasurement(influxDBInstance.getBucket(), influxDBInstance.org, WritePrecision.MS, item);
             });
         }
@@ -367,7 +369,7 @@
             InfluxPointValuePOJO point = influxParams.get(i);
             String measurement = PointValueUtils.getMeasurement(point.getType());
             StringBuilder sb = new StringBuilder();
-            sb.append("from(bucket:\"" + influxDBInstance.bucket + "\") ");
+            sb.append("from(bucket:\"" + influxDBInstance.getBucket() + "\") ");
             sb.append("|> range(start: ").append(start).append(", stop: ").append(stop).append(") ");
             sb.append("|> filter(fn: (r) => r[\"_measurement\"] == \"" + measurement + "\")");
             sb.append("|> filter(fn: (r) => r[\"_field\"] == \"value\")");

--
Gitblit v1.9.3