From 730d1944e3a13c517c77df2b0712df05645a38dd Mon Sep 17 00:00:00 2001
From: dengzedong <dengzedong@email>
Date: 星期一, 06 一月 2025 16:00:58 +0800
Subject: [PATCH] chartParamList api

---
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/api/point/DataPointApiImpl.java |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/api/point/DataPointApiImpl.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/api/point/DataPointApiImpl.java
index c62c369..a576a68 100644
--- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/api/point/DataPointApiImpl.java
+++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/api/point/DataPointApiImpl.java
@@ -1,9 +1,11 @@
 package com.iailab.module.data.api.point;
 
+import com.iailab.framework.common.util.date.DateUtils;
 import com.iailab.framework.common.util.object.ConvertUtils;
 import com.iailab.module.data.api.point.dto.*;
 import com.iailab.module.data.influxdb.pojo.InfluxPointValuePOJO;
 import com.iailab.module.data.influxdb.service.InfluxDBService;
+import com.iailab.module.data.influxdb.service.impl.InfluxDBServiceImpl;
 import com.iailab.module.data.point.collection.PointCollector;
 import com.iailab.module.data.point.dto.DaPointDTO;
 import com.iailab.module.data.point.dto.DaPointWriteValueDTO;
@@ -36,7 +38,16 @@
 
     @Override
     public ApiPointDTO getInfoById(String pointId) {
-        return ConvertUtils.sourceToTarget(daPointService.getSimpleInfoById(pointId), ApiPointDTO.class);
+        return daPointService.getSimpleInfoById(pointId);
+    }
+
+    @Override
+    public List<ApiPointDTO> getInfoByIds(Set<String> pointIds) {
+        List<ApiPointDTO> result = new ArrayList<>(pointIds.size());
+        for (String pointId : pointIds) {
+            result.add(daPointService.getSimpleInfoById(pointId));
+        }
+        return result;
     }
 
     @Override
@@ -86,8 +97,8 @@
         List<ApiPointValueDTO> pointValueList = new ArrayList<>();
         for (int i = 0; list.size() - i >= 1; i++) {
             ApiPointValueDTO pointValue = new ApiPointValueDTO();
-            pointValue.setDataValue(Double.parseDouble(list.get(i).get("value").toString()));
-            pointValue.setDataTime((Date) (list.get(i).get("time")));
+            pointValue.setV(Double.parseDouble(list.get(i).get(InfluxDBServiceImpl.VALUE).toString()));
+            pointValue.setT(DateUtils.parse(list.get(i).get(InfluxDBServiceImpl.TIME).toString(), DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND));
             pointValueList.add(pointValue);
         }
         return pointValueList;
@@ -102,6 +113,7 @@
             pointCollector.setValue(wr);
             return true;
         } catch (Exception ex) {
+            ex.printStackTrace();
             return false;
         }
     }

--
Gitblit v1.9.3