From 90e3420dc0dd15281dc680b11c11b35afc945cb2 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期一, 16 十二月 2024 09:24:22 +0800
Subject: [PATCH] daPointCollectStatusService

---
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointCollectStatusServiceImpl.java |   10 ++++++++++
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/DaPointCollectStatusService.java          |    2 ++
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java              |    4 ++++
 3 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/DaPointCollectStatusService.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/DaPointCollectStatusService.java
index d48270d..7948ab6 100644
--- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/DaPointCollectStatusService.java
+++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/DaPointCollectStatusService.java
@@ -15,6 +15,8 @@
  */
 public interface DaPointCollectStatusService extends BaseService<DaPointCollectStatusEntity> {
 
+    void add(String pointNo);
+
     @Async
     void recordStatus(String pointNo, String collectValue, Date collectTime);
 
diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointCollectStatusServiceImpl.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointCollectStatusServiceImpl.java
index 23c9df6..c426c92 100644
--- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointCollectStatusServiceImpl.java
+++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointCollectStatusServiceImpl.java
@@ -26,6 +26,15 @@
 public class DaPointCollectStatusServiceImpl extends BaseServiceImpl<DaPointCollectStatusDao, DaPointCollectStatusEntity>
         implements DaPointCollectStatusService {
 
+    @Override
+    public void add(String pointNo) {
+        DaPointCollectStatusEntity entity = new DaPointCollectStatusEntity();
+        entity.setId(UUID.randomUUID().toString());
+        entity.setPointNo(pointNo);
+        baseDao.insert(entity);
+    }
+
+    @Override
     public void recordStatus(String pointNo, String collectValue, Date collectTime) {
         QueryWrapper<DaPointCollectStatusEntity> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("point_no", pointNo);
@@ -47,6 +56,7 @@
 
     }
 
+    @Override
     public void recordStatusList(List<InfluxPointValuePOJO> pointValues, Date collectTime) {
         List<String> listGood = new ArrayList<>();
         List<String> listBad = new ArrayList<>();
diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java
index 86304da..00380e0 100644
--- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java
+++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java
@@ -64,6 +64,9 @@
     @Resource
     private ChannelSourceService channelSourceService;
 
+    @Resource
+    private DaPointCollectStatusService daPointCollectStatusService;
+
     private static Map<String, DaPointDTO> pointIdMap = new ConcurrentHashMap<>();
 
     private static Map<String, DaPointDTO> pointNoMap = new ConcurrentHashMap<>();
@@ -182,6 +185,7 @@
         daPointEntity.setCreateTime(new Date());
         daPointDao.insert(daPointEntity);
 
+        daPointCollectStatusService.add(daPointEntity.getPointNo());
         // 清空缓存
         clearCache();
     }

--
Gitblit v1.9.3