From 5bf42aa9950058f391805e6fb8d7376f4378924b Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期一, 23 十二月 2024 16:16:55 +0800
Subject: [PATCH] cumulateHandle.getCurrent

---
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/PointCollector.java |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/PointCollector.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/PointCollector.java
index a97d9cc..043d3bb 100644
--- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/PointCollector.java
+++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/PointCollector.java
@@ -3,10 +3,13 @@
 import com.iailab.module.data.common.enums.DataSourceType;
 import com.iailab.module.data.common.utils.R;
 import com.iailab.module.data.channel.kio.collector.KingIOCollector;
+import com.iailab.module.data.influxdb.pojo.InfluxPointValueDigPOJO;
+import com.iailab.module.data.influxdb.pojo.InfluxPointValueSimPOJO;
 import com.iailab.module.data.point.collection.handler.CalculateHandle;
 import com.iailab.module.data.point.collection.handler.CumulateHandle;
 import com.iailab.module.data.point.common.PointTypeEnum;
 import com.iailab.module.data.point.dto.DaPointDTO;
+import com.iailab.module.data.point.service.DaPointCollectStatusService;
 import com.iailab.module.data.point.service.DaPointService;
 import com.iailab.module.data.influxdb.pojo.InfluxPointValuePOJO;
 import com.iailab.module.data.channel.modbus.collector.ModBusCollector;
@@ -16,7 +19,10 @@
 import com.iailab.module.data.point.dto.DaPointWriteValueDTO;
 import com.iailab.module.data.influxdb.service.InfluxDBService;
 import lombok.extern.slf4j.Slf4j;
+
 import javax.annotation.Resource;
+
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.util.CollectionUtils;
 
@@ -59,6 +65,9 @@
     @Resource
     private CumulateHandle cumulateHandle;
 
+    @Autowired
+    private DaPointCollectStatusService daPointCollectStatusService;
+
     /**
      * 采集
      *
@@ -89,8 +98,10 @@
             log.info("存入数据库");
             influxDBService.asyncWritePointValues(pointValues);
 
+            log.info("更新采集状态");
+            daPointCollectStatusService.recordStatusList(pointValues, collectTime);
             log.info("采集完成");
-        } catch (Exception ex)  {
+        } catch (Exception ex) {
             log.info("采集异常!");
             ex.printStackTrace();
         }
@@ -105,6 +116,7 @@
             data.putAll(constantHandle.getCurrent(pointNos));
             data.putAll(measureHandle.getCurrent(pointNos));
             data.putAll(calculateHandle.getCurrent(pointNos));
+            data.putAll(cumulateHandle.getCurrent(pointNos));
             return data;
         } catch (Exception ex) {
             return R.error(ex.getMessage());

--
Gitblit v1.9.3