Parcourir la source

实现庚顿数据库的标准接口类,并实现测试和bug修复

shilin il y a 6 mois
Parent
commit
67467f9003
23 fichiers modifiés avec 5041 ajouts et 3054 suppressions
  1. 1968 0
      log/ota.log
  2. 18 23
      pom.xml
  3. 7 0
      src/main/java/com/gyee/generation/init/CacheContext.java
  4. 0 65
      src/main/java/com/gyee/generation/mapper/auto/AlarmTsMapper.java
  5. 56 0
      src/main/java/com/gyee/generation/mapper/auto/TaosMapper.java
  6. 3 3
      src/main/java/com/gyee/generation/model/auto/PointDataTaos.java
  7. 0 66
      src/main/java/com/gyee/generation/model/vo/AlarmVo.java
  8. 46 46
      src/main/java/com/gyee/generation/processors/StandaloneProcessor2Demo.java
  9. 48 48
      src/main/java/com/gyee/generation/processors/StandaloneProcessor3Demo.java
  10. 45 45
      src/main/java/com/gyee/generation/processors/StandaloneProcessor4Demo.java
  11. 51 51
      src/main/java/com/gyee/generation/processors/StandaloneProcessorDemo.java
  12. 1239 0
      src/main/java/com/gyee/generation/service/initialpoint/InitialTaosPointService.java
  13. 253 0
      src/main/java/com/gyee/generation/service/initialpoint/TaosInitalPonitService.java
  14. 0 2073
      src/main/java/com/gyee/generation/util/realtimesource/EdosUtil.java
  15. 0 279
      src/main/java/com/gyee/generation/util/realtimesource/IEdosUtil.java
  16. 185 0
      src/main/java/com/gyee/generation/util/realtimesource/IRealDataUtil.java
  17. 1010 0
      src/main/java/com/gyee/generation/util/realtimesource/TaosUtil.java
  18. 1 1
      src/main/java/com/gyee/generation/util/realtimesource/timeseries/ErrorRequest.java
  19. 0 276
      src/main/java/com/gyee/generation/util/realtimesource/timeseries/JsonObjectHelper.java
  20. 4 51
      src/main/java/com/gyee/generation/util/realtimesource/timeseries/PointData.java
  21. 22 23
      src/main/resources/application-jn.yml
  22. 5 4
      src/test/java/com/gyee/generation/GenerationTest.java
  23. 80 0
      src/test/java/com/gyee/generation/TaosTest.java

Fichier diff supprimé car celui-ci est trop grand
+ 1968 - 0
log/ota.log


+ 18 - 23
pom.xml

@@ -26,7 +26,7 @@
 
         <druid.version>1.2.21</druid.version>
         <mariadb.version>3.4.0</mariadb.version>
-        <taosdata.version>3.2.11</taosdata.version>
+
         <hutool.version>5.8.27</hutool.version>
 
         <netty.version>4.1.110.Final</netty.version>
@@ -34,7 +34,7 @@
         <freemarker.version>2.3.28</freemarker.version>
 
 
-
+        <taosdata.version>3.2.11</taosdata.version>
 
         <dynamic-datasource.version>4.3.0</dynamic-datasource.version>
         <mybatis-plus.version>3.5.5</mybatis-plus.version>
@@ -43,11 +43,6 @@
     </properties>
 
     <dependencies>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-jdbc</artifactId>
-            <version>${springboot.version}</version>
-        </dependency>
 
         <!--mybatis-plus 代码生成器的模板引擎-->
         <dependency>
@@ -74,17 +69,22 @@
             <scope>compile</scope>
         </dependency>
         <!-- powerjob -->
-        <dependency>
-            <groupId>tech.powerjob</groupId>
-            <artifactId>powerjob-worker-spring-boot-starter</artifactId>
-            <version>${powerjob.worker.starter.version}</version>
-        </dependency>
-
-        <dependency>
-        <groupId>tech.powerjob</groupId>
-        <artifactId>powerjob-official-processors</artifactId>
-        <version>${powerjob.worker.starter.version}</version>
-        </dependency>
+<!--        <dependency>-->
+<!--            <groupId>tech.powerjob</groupId>-->
+<!--            <artifactId>powerjob-worker-spring-boot-starter</artifactId>-->
+<!--            <version>${powerjob.worker.starter.version}</version>-->
+<!--        </dependency>-->
+
+<!--        <dependency>-->
+<!--        <groupId>tech.powerjob</groupId>-->
+<!--        <artifactId>powerjob-official-processors</artifactId>-->
+<!--        <version>${powerjob.worker.starter.version}</version>-->
+<!--        </dependency>-->
+<!--        <dependency>-->
+<!--            <groupId>tech.powerjob</groupId>-->
+<!--            <artifactId>powerjob-worker-spring-boot-starter</artifactId>-->
+<!--            <version>${powerjob.worker.starter.version}</version>-->
+<!--        </dependency>-->
 
 
         <!-- SpringBoot -->
@@ -122,11 +122,6 @@
             <scope>test</scope>
         </dependency>
 
-        <dependency>
-            <groupId>tech.powerjob</groupId>
-            <artifactId>powerjob-worker-spring-boot-starter</artifactId>
-            <version>${powerjob.worker.starter.version}</version>
-        </dependency>
 
         <dependency>
             <groupId>com.alibaba</groupId>

+ 7 - 0
src/main/java/com/gyee/generation/init/CacheContext.java

@@ -91,6 +91,10 @@ public class CacheContext implements CommandLineRunner {
     public static Map<String, ProBasicPowerstation> wpmap = new HashMap<>();
     public static Map<String, ProBasicProject> pjmap = new HashMap<>();
     public static Map<String, ProBasicLine> lnmap = new HashMap<>();
+
+    public static Map<String, ProBasicSubStation> submap = new HashMap<>();
+
+    public static Map<String, ProBasicWeatherStation> wsmap = new HashMap<>();
     public static Map<String, ProBasicSquare> sqmap = new HashMap<>();
 
     public static Map<String, ProBasicEquipment> eqmap = new HashMap<>();
@@ -357,6 +361,7 @@ public class CacheContext implements CommandLineRunner {
             });
             subwppointmap.put(sub.getNemCode(), stringWindpowerstationpointnewMap);
 
+            submap.put(sub.getNemCode(),sub);
             List<ProBasicEquipment> collect = wtls.stream().filter(wt -> wt.getSubstationId().equals(sub.getNemCode())).collect(Collectors.toList());
             subWtsMap.put(sub.getNemCode(), collect);
 
@@ -367,6 +372,8 @@ public class CacheContext implements CommandLineRunner {
         if (!wsls.isEmpty()) {
 
             for (ProBasicWeatherStation ws : wsls) {
+
+                wsmap.put(ws.getName(),ws);
                 if (poWsStationMap.containsKey(ws.getWindpowerstationId())) {
                     List<ProBasicWeatherStation> ls = poWsStationMap.get(ws.getWindpowerstationId());
                     ls.add(ws);

+ 0 - 65
src/main/java/com/gyee/generation/mapper/auto/AlarmTsMapper.java

@@ -1,65 +0,0 @@
-//package com.gyee.generation.mapper.auto;
-//
-//
-//import com.baomidou.dynamic.datasource.annotation.DS;
-//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-//import com.gyee.generation.model.auto.PointDataTaos;
-//import com.gyee.generation.model.vo.AlarmSimpleVo;
-//import com.gyee.generation.model.vo.AlarmTsVo;
-//import com.gyee.generation.model.vo.AlarmVo;
-//import org.apache.ibatis.annotations.Insert;
-//import org.apache.ibatis.annotations.Param;
-//import org.apache.ibatis.annotations.Select;
-//import org.apache.ibatis.annotations.Update;
-//
-//import java.util.List;
-//
-//
-//@DS("slave")
-//public interface AlarmTsMapper extends BaseMapper<PointDataTaos> {
-//
-//
-//    @Update("CREATE STABLE if not exists ${superTableName} (ts TIMESTAMP,val DOUBLE,metric BIGINT) );")
-//    int createAlarmSuperTable(@Param("superTableName") String superTableName);
-//
-//
-//
-//    @Update("create table if not exists ${tbName} using ${superTableName} ")
-//    int createTable(@Param("tbName") String tbName, @Param("superTableName") String superTableName
-//
-//    );
-//
-//
-//    @Update("drop table if exists ${superTableName}")
-//    void dropSuperTable(@Param("superTableName")String superTableName);
-//
-//    @Insert("insert into ${tbName} (ts, val,metric,confirmed) values(#{ts}, #{val}, #{metric})")
-//    int insertOne(PointDataTaos one);
-//
-//
-//
-//    @Insert("${sql}")
-//    int insertList(@Param("sql") String sql);
-//
-//    @Select("SELECT LAST_ROW(*)  FROM from #{tbname} ")
-//    List<AlarmVo> getRealData(@Param("tbname") String tbname);
-//
-//
-//    @Select("select deviceid,description,count(*) as val,sum(timeLong) as timeLong from #{superTableName} where ts>=#{begin} and ts<=#{end}  stationid=#{stationid}  group by description,deviceid  ")
-//    List<AlarmTsVo> selectByGroup(@Param("superTableName") String superTableName, @Param("stationid") String stationid, @Param("begin")long begin, @Param("end") long end);
-//
-//
-//    @Select("select ts,val,confirmed,endts,timeLong,alarmid,alarmtype,characteristic,components,confirmed,description,deviceid,devicename,devicetype,enabled,lineid,linename," +
-//            "modelId,projectid,projectname,rank,resettable,stationid,stationname,subcomponents,suffix,tagid,triggertype,uniformcode from #{tbName}   limit #{limit} offset #{offset} ")
-//    List<AlarmVo> selectByTbName(@Param("tbName") String tbName,@Param("limit") long limit,@Param("offset") long offset);
-//
-//
-//    @Select("select last_row(*),tbname from #{superTableName} where tbname in( #{tbnames} ) group by tbname")
-//    List<AlarmSimpleVo> selectLastRowByTbname(@Param("superTableName") String superTableName, @Param("tbnames") String tbnames);
-//
-//    @Select("select last_row(*),alarmid,alarmtype,characteristic,components,confirmed,description,deviceid,devicename,devicetype,enabled,lineid,linename," +
-//            "modelId,projectid,projectname,rank,resettable,stationid,stationname,subcomponents,suffix,tagid,triggertype,uniformcode,nemCode ,faultCause,resolvent from #{superTableName}" +
-//            " where deviceid=#{deviceid} order by rank desc,ts desc limit 0,1")
-//    List<AlarmVo> selectLastRowByDeviceid(@Param("superTableName") String superTableName, @Param("deviceid") String deviceid);
-//
-//}

+ 56 - 0
src/main/java/com/gyee/generation/mapper/auto/TaosMapper.java

@@ -0,0 +1,56 @@
+package com.gyee.generation.mapper.auto;
+
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.generation.model.auto.PointDataTaos;
+
+import org.apache.ibatis.annotations.Insert;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+
+import java.util.List;
+
+
+@DS("slave")
+public interface TaosMapper extends BaseMapper<PointDataTaos> {
+
+
+    @Update("CREATE STABLE if not exists ${superTableName} (ts TIMESTAMP,val DOUBLE,metric INT) TAGS (name NCHAR(100))  ")
+    int createSuperTable(@Param("superTableName") String superTableName);
+
+
+
+    @Update("create table if not exists ${tbName} using ${superTableName} TAGS( #{tbName} ) ")
+    int createTable(@Param("tbName") String tbName, @Param("superTableName") String superTableName
+
+    );
+
+
+    @Update("drop table if exists ${superTableName}")
+    void dropSuperTable(@Param("superTableName")String superTableName);
+
+    @Insert("insert into ${tbName} (ts, val,metric) values(#{ts}, #{val}, #{metric})")
+    int insertOne(PointDataTaos one);
+
+
+
+    @Insert("${sql}")
+    int insertList(@Param("sql") String sql);
+
+
+
+    @Select("SELECT LAST_ROW(ts) as ts,LAST_ROW(val) as val,LAST_ROW(metric) as metric  FROM  #{tbname} ")
+    List<PointDataTaos> getRealData(@Param("tbname") String tbname);
+
+    @Select("${sql} ")
+    List<PointDataTaos> getHistoryDatasSnap(@Param("sql") String sql);
+
+    @Select("${sql} ")
+    List<PointDataTaos> getHistoryDatasRaw(@Param("sql") String sql);
+
+    @Select("${sql} ")
+    List<PointDataTaos> getHistMatrix(@Param("sql") String sql);
+
+}

+ 3 - 3
src/main/java/com/gyee/generation/model/auto/PointDataTaos.java

@@ -6,11 +6,11 @@ import lombok.ToString;
 import java.sql.Timestamp;
 
 @Data
-@ToString
 public class PointDataTaos {
 
+    private String id;
     private Timestamp ts;
-    private Integer val;
-    private Long metric;
+    private Double val;
+    private Integer metric;
 
 }

+ 0 - 66
src/main/java/com/gyee/generation/model/vo/AlarmVo.java

@@ -1,66 +0,0 @@
-package com.gyee.generation.model.vo;
-
-
-import lombok.Data;
-
-import java.sql.Timestamp;
-
-@Data
-public class AlarmVo {
-
-    private  String tbName;
-    private String alarmid;
-    private String alarmtype;
-    private String characteristic;
-    private String components;
-    private Boolean confirmed;
-    private String description;
-    private String deviceid;
-    private String devicename;
-    private String devicetype;
-    private Boolean enabled;
-    private String lineid;
-    private String linename;
-    private String modelId;
-    private String projectid;
-    private String projectname;
-    private Integer rank;
-    private Boolean resettable;
-    private String stationid;
-    private String stationname;
-    private String subcomponents;
-    private String suffix;
-    private String tagid;
-    private Integer triggertype;
-    private String uniformcode;
-    private String superTableName;
-
-    private Timestamp ts;
-    private Integer val;
-    private Integer oval;
-
-    private Timestamp endts;
-
-    private Double timelong;
-
-    /**
-     * 故障名称
-     */
-    private String name;
-
-    /**
-     *故障码
-     */
-    private String nemCode;
-
-    /**
-     * 故障原因
-     */
-    private String faultCause;
-
-    /**
-     * 排查方法
-     */
-    private String resolvent;
-
-}

+ 46 - 46
src/main/java/com/gyee/generation/processors/StandaloneProcessor2Demo.java

@@ -1,46 +1,46 @@
-package com.gyee.generation.processors;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Component;
-import tech.powerjob.official.processors.CommonBasicProcessor;
-import tech.powerjob.worker.core.processor.ProcessResult;
-import tech.powerjob.worker.core.processor.TaskContext;
-import tech.powerjob.worker.core.processor.WorkflowContext;
-import tech.powerjob.worker.log.OmsLogger;
-
-import java.util.Map;
-
-/**
- * @description: 工作流调度任务测试
- * @author: shilin
- * @date: 2024/5/29 9:19
- * @param:
- * @return:
- **/
-@Slf4j
-@Component("testBaseProcessor2")
-public class StandaloneProcessor2Demo extends CommonBasicProcessor {
-
-    @Override
-    protected ProcessResult process0(TaskContext taskContext) {
-
-        String jobParams = taskContext.getJobParams();
-        OmsLogger omsLogger = taskContext.getOmsLogger();
-        try {
-
-            WorkflowContext workflowContext = taskContext.getWorkflowContext();
-            workflowContext.appendData2WfContext("test2", "2");
-
-            Map<String, String> map=  workflowContext.fetchWorkflowContext();
-
-            for (Map.Entry<String, String> entry : map.entrySet()) {
-                workflowContext.appendData2WfContext(entry.getKey(), entry.getValue());
-                omsLogger.info("inject context, {}:{}", entry.getKey(), entry.getValue());
-            }
-        } catch (Exception e) {
-            omsLogger.error("Fail to parse job params:{},it is not a valid json string!", jobParams, e);
-            return new ProcessResult(false);
-        }
-        return new ProcessResult(true);
-    }
-}
+//package com.gyee.generation.processors;
+//
+//import lombok.extern.slf4j.Slf4j;
+//import org.springframework.stereotype.Component;
+//import tech.powerjob.official.processors.CommonBasicProcessor;
+//import tech.powerjob.worker.core.processor.ProcessResult;
+//import tech.powerjob.worker.core.processor.TaskContext;
+//import tech.powerjob.worker.core.processor.WorkflowContext;
+//import tech.powerjob.worker.log.OmsLogger;
+//
+//import java.util.Map;
+//
+///**
+// * @description: 工作流调度任务测试
+// * @author: shilin
+// * @date: 2024/5/29 9:19
+// * @param:
+// * @return:
+// **/
+//@Slf4j
+//@Component("testBaseProcessor2")
+//public class StandaloneProcessor2Demo extends CommonBasicProcessor {
+//
+//    @Override
+//    protected ProcessResult process0(TaskContext taskContext) {
+//
+//        String jobParams = taskContext.getJobParams();
+//        OmsLogger omsLogger = taskContext.getOmsLogger();
+//        try {
+//
+//            WorkflowContext workflowContext = taskContext.getWorkflowContext();
+//            workflowContext.appendData2WfContext("test2", "2");
+//
+//            Map<String, String> map=  workflowContext.fetchWorkflowContext();
+//
+//            for (Map.Entry<String, String> entry : map.entrySet()) {
+//                workflowContext.appendData2WfContext(entry.getKey(), entry.getValue());
+//                omsLogger.info("inject context, {}:{}", entry.getKey(), entry.getValue());
+//            }
+//        } catch (Exception e) {
+//            omsLogger.error("Fail to parse job params:{},it is not a valid json string!", jobParams, e);
+//            return new ProcessResult(false);
+//        }
+//        return new ProcessResult(true);
+//    }
+//}

+ 48 - 48
src/main/java/com/gyee/generation/processors/StandaloneProcessor3Demo.java

@@ -1,48 +1,48 @@
-package com.gyee.generation.processors;
-
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Component;
-import tech.powerjob.official.processors.CommonBasicProcessor;
-import tech.powerjob.worker.core.processor.ProcessResult;
-import tech.powerjob.worker.core.processor.TaskContext;
-import tech.powerjob.worker.core.processor.WorkflowContext;
-import tech.powerjob.worker.log.OmsLogger;
-
-import java.util.Date;
-import java.util.Map;
-
-/**
- * @description: 工作流调度任务测试
- * @author: shilin
- * @date: 2024/5/29 9:19
- * @param:
- * @return:
- **/
-@Slf4j
-@Component("testBaseProcessor3")
-public class StandaloneProcessor3Demo extends CommonBasicProcessor {
-
-    @Override
-    protected ProcessResult process0(TaskContext taskContext) {
-
-        String jobParams = taskContext.getJobParams();
-        OmsLogger omsLogger = taskContext.getOmsLogger();
-        try {
-
-            WorkflowContext workflowContext = taskContext.getWorkflowContext();
-
-            workflowContext.appendData2WfContext("test3", new Date());
-
-            Map<String, String> map=  workflowContext.fetchWorkflowContext();
-            for (Map.Entry<String, String> entry : map.entrySet()) {
-                workflowContext.appendData2WfContext(entry.getKey(), entry.getValue());
-                omsLogger.info("inject context, {}:{}", entry.getKey(), entry.getValue());
-            }
-        } catch (Exception e) {
-            omsLogger.error("Fail to parse job params:{},it is not a valid json string!", jobParams, e);
-            return new ProcessResult(false);
-        }
-        return new ProcessResult(true);
-    }
-}
+//package com.gyee.generation.processors;
+//
+//
+//import lombok.extern.slf4j.Slf4j;
+//import org.springframework.stereotype.Component;
+//import tech.powerjob.official.processors.CommonBasicProcessor;
+//import tech.powerjob.worker.core.processor.ProcessResult;
+//import tech.powerjob.worker.core.processor.TaskContext;
+//import tech.powerjob.worker.core.processor.WorkflowContext;
+//import tech.powerjob.worker.log.OmsLogger;
+//
+//import java.util.Date;
+//import java.util.Map;
+//
+///**
+// * @description: 工作流调度任务测试
+// * @author: shilin
+// * @date: 2024/5/29 9:19
+// * @param:
+// * @return:
+// **/
+//@Slf4j
+//@Component("testBaseProcessor3")
+//public class StandaloneProcessor3Demo extends CommonBasicProcessor {
+//
+//    @Override
+//    protected ProcessResult process0(TaskContext taskContext) {
+//
+//        String jobParams = taskContext.getJobParams();
+//        OmsLogger omsLogger = taskContext.getOmsLogger();
+//        try {
+//
+//            WorkflowContext workflowContext = taskContext.getWorkflowContext();
+//
+//            workflowContext.appendData2WfContext("test3", new Date());
+//
+//            Map<String, String> map=  workflowContext.fetchWorkflowContext();
+//            for (Map.Entry<String, String> entry : map.entrySet()) {
+//                workflowContext.appendData2WfContext(entry.getKey(), entry.getValue());
+//                omsLogger.info("inject context, {}:{}", entry.getKey(), entry.getValue());
+//            }
+//        } catch (Exception e) {
+//            omsLogger.error("Fail to parse job params:{},it is not a valid json string!", jobParams, e);
+//            return new ProcessResult(false);
+//        }
+//        return new ProcessResult(true);
+//    }
+//}

+ 45 - 45
src/main/java/com/gyee/generation/processors/StandaloneProcessor4Demo.java

@@ -1,45 +1,45 @@
-package com.gyee.generation.processors;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Component;
-import tech.powerjob.official.processors.CommonBasicProcessor;
-import tech.powerjob.worker.core.processor.ProcessResult;
-import tech.powerjob.worker.core.processor.TaskContext;
-import tech.powerjob.worker.core.processor.WorkflowContext;
-import tech.powerjob.worker.log.OmsLogger;
-
-import java.util.Map;
-
-/**
- * @description: 工作流调度任务测试
- * @author: shilin
- * @date: 2024/5/29 9:19
- * @param:
- * @return:
- **/
-@Slf4j
-@Component("testBaseProcessor4")
-public class StandaloneProcessor4Demo extends CommonBasicProcessor {
-
-    @Override
-    protected ProcessResult process0(TaskContext taskContext) {
-
-        String jobParams = taskContext.getJobParams();
-        OmsLogger omsLogger = taskContext.getOmsLogger();
-        try {
-
-            WorkflowContext workflowContext = taskContext.getWorkflowContext();
-
-            workflowContext.appendData2WfContext("test4", true);
-            Map<String, String> map=  workflowContext.fetchWorkflowContext();
-            for (Map.Entry<String, String> entry : map.entrySet()) {
-                workflowContext.appendData2WfContext(entry.getKey(), entry.getValue());
-                omsLogger.info("inject context, {}:{}", entry.getKey(), entry.getValue());
-            }
-        } catch (Exception e) {
-            omsLogger.error("Fail to parse job params:{},it is not a valid json string!", jobParams, e);
-            return new ProcessResult(false);
-        }
-        return new ProcessResult(true);
-    }
-}
+//package com.gyee.generation.processors;
+//
+//import lombok.extern.slf4j.Slf4j;
+//import org.springframework.stereotype.Component;
+//import tech.powerjob.official.processors.CommonBasicProcessor;
+//import tech.powerjob.worker.core.processor.ProcessResult;
+//import tech.powerjob.worker.core.processor.TaskContext;
+//import tech.powerjob.worker.core.processor.WorkflowContext;
+//import tech.powerjob.worker.log.OmsLogger;
+//
+//import java.util.Map;
+//
+///**
+// * @description: 工作流调度任务测试
+// * @author: shilin
+// * @date: 2024/5/29 9:19
+// * @param:
+// * @return:
+// **/
+//@Slf4j
+//@Component("testBaseProcessor4")
+//public class StandaloneProcessor4Demo extends CommonBasicProcessor {
+//
+//    @Override
+//    protected ProcessResult process0(TaskContext taskContext) {
+//
+//        String jobParams = taskContext.getJobParams();
+//        OmsLogger omsLogger = taskContext.getOmsLogger();
+//        try {
+//
+//            WorkflowContext workflowContext = taskContext.getWorkflowContext();
+//
+//            workflowContext.appendData2WfContext("test4", true);
+//            Map<String, String> map=  workflowContext.fetchWorkflowContext();
+//            for (Map.Entry<String, String> entry : map.entrySet()) {
+//                workflowContext.appendData2WfContext(entry.getKey(), entry.getValue());
+//                omsLogger.info("inject context, {}:{}", entry.getKey(), entry.getValue());
+//            }
+//        } catch (Exception e) {
+//            omsLogger.error("Fail to parse job params:{},it is not a valid json string!", jobParams, e);
+//            return new ProcessResult(false);
+//        }
+//        return new ProcessResult(true);
+//    }
+//}

+ 51 - 51
src/main/java/com/gyee/generation/processors/StandaloneProcessorDemo.java

@@ -1,51 +1,51 @@
-package com.gyee.generation.processors;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.TypeReference;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Component;
-import tech.powerjob.official.processors.CommonBasicProcessor;
-import tech.powerjob.worker.core.processor.ProcessResult;
-import tech.powerjob.worker.core.processor.TaskContext;
-import tech.powerjob.worker.core.processor.WorkflowContext;
-import tech.powerjob.worker.log.OmsLogger;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @description: 工作流调度任务测试
- * @author: shilin
- * @date: 2024/5/29 9:19
- * @param:
- * @return:
- **/
-@Slf4j
-@Component("testBaseProcessor")
-public class StandaloneProcessorDemo extends CommonBasicProcessor {
-
-    @Override
-    protected ProcessResult process0(TaskContext taskContext) {
-
-        String jobParams = taskContext.getJobParams();
-        OmsLogger omsLogger = taskContext.getOmsLogger();
-        try {
-            HashMap<String, Object> data = JSON.parseObject(jobParams, new TypeReference<HashMap<String, Object>>() {
-            });
-            WorkflowContext workflowContext = taskContext.getWorkflowContext();
-            for (Map.Entry<String, Object> entry : data.entrySet()) {
-                workflowContext.appendData2WfContext(entry.getKey(), entry.getValue());
-                omsLogger.info("inject context, {}:{}", entry.getKey(), entry.getValue());
-            }
-
-            workflowContext.appendData2WfContext("test1", 1);
-//            workflowContext.appendData2WfContext("test2", "2");
-//            workflowContext.appendData2WfContext("test3", new Date());
-//            workflowContext.appendData2WfContext("test4", true);
-        } catch (Exception e) {
-            omsLogger.error("Fail to parse job params:{},it is not a valid json string!", jobParams, e);
-            return new ProcessResult(false);
-        }
-        return new ProcessResult(true);
-    }
-}
+//package com.gyee.generation.processors;
+//
+//import com.alibaba.fastjson.JSON;
+//import com.alibaba.fastjson.TypeReference;
+//import lombok.extern.slf4j.Slf4j;
+//import org.springframework.stereotype.Component;
+//import tech.powerjob.official.processors.CommonBasicProcessor;
+//import tech.powerjob.worker.core.processor.ProcessResult;
+//import tech.powerjob.worker.core.processor.TaskContext;
+//import tech.powerjob.worker.core.processor.WorkflowContext;
+//import tech.powerjob.worker.log.OmsLogger;
+//
+//import java.util.HashMap;
+//import java.util.Map;
+//
+///**
+// * @description: 工作流调度任务测试
+// * @author: shilin
+// * @date: 2024/5/29 9:19
+// * @param:
+// * @return:
+// **/
+//@Slf4j
+//@Component("testBaseProcessor")
+//public class StandaloneProcessorDemo extends CommonBasicProcessor {
+//
+//    @Override
+//    protected ProcessResult process0(TaskContext taskContext) {
+//
+//        String jobParams = taskContext.getJobParams();
+//        OmsLogger omsLogger = taskContext.getOmsLogger();
+//        try {
+//            HashMap<String, Object> data = JSON.parseObject(jobParams, new TypeReference<HashMap<String, Object>>() {
+//            });
+//            WorkflowContext workflowContext = taskContext.getWorkflowContext();
+//            for (Map.Entry<String, Object> entry : data.entrySet()) {
+//                workflowContext.appendData2WfContext(entry.getKey(), entry.getValue());
+//                omsLogger.info("inject context, {}:{}", entry.getKey(), entry.getValue());
+//            }
+//
+//            workflowContext.appendData2WfContext("test1", 1);
+////            workflowContext.appendData2WfContext("test2", "2");
+////            workflowContext.appendData2WfContext("test3", new Date());
+////            workflowContext.appendData2WfContext("test4", true);
+//        } catch (Exception e) {
+//            omsLogger.error("Fail to parse job params:{},it is not a valid json string!", jobParams, e);
+//            return new ProcessResult(false);
+//        }
+//        return new ProcessResult(true);
+//    }
+//}

Fichier diff supprimé car celui-ci est trop grand
+ 1239 - 0
src/main/java/com/gyee/generation/service/initialpoint/InitialTaosPointService.java


+ 253 - 0
src/main/java/com/gyee/generation/service/initialpoint/TaosInitalPonitService.java

@@ -0,0 +1,253 @@
+package com.gyee.generation.service.initialpoint;
+
+
+import cn.hutool.core.util.ObjectUtil;
+import com.gyee.generation.init.CacheContext;
+import com.gyee.generation.mapper.auto.TaosMapper;
+import com.gyee.generation.model.auto.*;
+import com.gyee.generation.model.vo.AlarmSuperTalbeType;
+import com.gyee.generation.util.realtimesource.IRealDataUtil;
+import jakarta.annotation.Resource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+
+import java.util.*;
+
+@Service
+public class TaosInitalPonitService {
+    @Resource
+    private TaosMapper taosMapper;
+
+
+
+    private static Logger logger = LoggerFactory.getLogger(TaosInitalPonitService.class);
+
+    public void dropSuperTable() {
+        taosMapper.dropSuperTable(AlarmSuperTalbeType.WT.getCode());
+    }
+
+    public void createSuperTable(String  subperTable) {
+
+        taosMapper.createSuperTable(subperTable);
+    }
+
+    public void initalTaosPointTable() throws Exception {
+
+
+        taosMapper.createSuperTable("JT_STA");
+
+        List<ProBasicPowerstation> wpls=CacheContext.wpls;
+
+        if(!wpls.isEmpty())
+        {
+            for (ProBasicPowerstation wp : wpls) {
+
+                StringBuilder sb=new StringBuilder();
+                sb.append(wp.getNemCode());
+
+                createSuperTable(String.valueOf(sb));
+
+                sb=new StringBuilder();
+                sb.append(wp.getNemCode()).append("_SBS");
+
+                createSuperTable(String.valueOf(sb));
+
+                sb=new StringBuilder();
+                sb.append(wp.getNemCode()).append("_WPF");
+
+                createSuperTable(String.valueOf(sb));
+                sb=new StringBuilder();
+                sb.append(wp.getNemCode()).append("_EQ");
+
+                createSuperTable(String.valueOf(sb));
+            }
+        }
+
+        //集团测点建表
+        Map<String, Map<String, ProBasicPowerstationPoint>> grouppointmap = CacheContext.grouppointmap;
+
+        if(!grouppointmap.isEmpty())
+        {
+            for (Map.Entry<String, Map<String, ProBasicPowerstationPoint>> entry : grouppointmap.entrySet()) {
+
+                for (Map.Entry<String, ProBasicPowerstationPoint> map : entry.getValue().entrySet()) {
+
+                    System.out.println("Key = " + map.getKey() + ", Value = " + map.getValue());
+                    taosMapper.createTable(map.getValue().getNemCode(),  "JT_STA");
+                }
+
+            }
+        }
+
+        //区域测点建表
+        Map<String, Map<String, ProBasicPowerstationPoint>> regionpointmap = CacheContext.regionpointmap;
+
+        if(!regionpointmap.isEmpty())
+        {
+            for (Map.Entry<String, Map<String, ProBasicPowerstationPoint>> entry : regionpointmap.entrySet()) {
+
+                for (Map.Entry<String, ProBasicPowerstationPoint> map : entry.getValue().entrySet()) {
+
+                    System.out.println("Key = " + map.getKey() + ", Value = " + map.getValue());
+                    taosMapper.createTable(map.getValue().getNemCode(),  "JT_STA");
+                }
+
+            }
+        }
+
+        //公司测点建表
+        Map<String, Map<String, ProBasicPowerstationPoint>> companypointmap = CacheContext.companypointmap;
+
+        if(!companypointmap.isEmpty())
+        {
+            for (Map.Entry<String, Map<String, ProBasicPowerstationPoint>> entry : companypointmap.entrySet()) {
+
+                for (Map.Entry<String, ProBasicPowerstationPoint> map : entry.getValue().entrySet()) {
+
+                    System.out.println("Key = " + map.getKey() + ", Value = " + map.getValue());
+                    taosMapper.createTable(map.getValue().getNemCode(),  "JT_STA");
+                }
+
+            }
+        }
+
+
+        //气象测点建表
+        Map<String, Map<String, ProBasicPowerstationPoint>> wswppointmap = CacheContext.wswppointmap;
+
+        if(!wswppointmap.isEmpty())
+        {
+            for (Map.Entry<String, Map<String, ProBasicPowerstationPoint>> entry : wswppointmap.entrySet()) {
+
+                for (Map.Entry<String, ProBasicPowerstationPoint> map : entry.getValue().entrySet()) {
+
+
+                    if(CacheContext.wsmap.containsKey(map.getValue().getWindpowerstationId()))
+                    {
+                        ProBasicWeatherStation ws=CacheContext.wsmap.get(map.getValue().getWindpowerstationId());
+                        StringBuilder sb=new StringBuilder();
+                        sb.append(ws.getWindpowerstationId()).append("_WPF");
+                        System.out.println("Key = " + map.getKey() + ", Value = " + map.getValue());
+                        taosMapper.createTable(map.getValue().getNemCode(),  String.valueOf(sb));
+                    }
+
+                }
+            }
+        }
+
+        //升压站测点建表
+        Map<String, Map<String, ProBasicPowerstationPoint>> subwppointmap = CacheContext.subwppointmap;
+
+        if(!subwppointmap.isEmpty())
+        {
+            for (Map.Entry<String, Map<String, ProBasicPowerstationPoint>> entry : subwppointmap.entrySet()) {
+
+                if(ObjectUtil.isNotEmpty(entry.getValue()))
+                {
+                    for (Map.Entry<String, ProBasicPowerstationPoint> map : entry.getValue().entrySet()) {
+                        if(CacheContext.submap.containsKey(map.getValue().getWindpowerstationId()))
+                        {
+                            ProBasicSubStation sub=CacheContext.submap.get(map.getValue().getWindpowerstationId());
+                            StringBuilder sb=new StringBuilder();
+                            sb.append(sub.getWindpowerstationId()).append("_SBS");
+                            System.out.println("Key = " + map.getKey() + ", Value = " + map.getValue());
+                            taosMapper.createTable(map.getValue().getNemCode(),  String.valueOf(sb));
+                        }
+
+                    }
+                }
+
+            }
+        }
+
+        //场站测点建表
+        Map<String, Map<String, ProBasicPowerstationPoint>> wppointmap = CacheContext.wppointmap;
+
+        if(!wppointmap.isEmpty())
+        {
+            for (Map.Entry<String, Map<String, ProBasicPowerstationPoint>> entry : wppointmap.entrySet()) {
+
+                for (Map.Entry<String, ProBasicPowerstationPoint> map : entry.getValue().entrySet()) {
+
+
+
+                        StringBuilder sb=new StringBuilder();
+                        sb.append(map.getValue().getWindpowerstationId());
+                        System.out.println("Key = " + map.getKey() + ", Value = " + map.getValue());
+                        taosMapper.createTable(map.getValue().getNemCode(),  String.valueOf(sb));
+
+
+                }
+            }
+        }
+        //项目测点建表
+        Map<String, Map<String, ProBasicPowerstationPoint>> propointmap = CacheContext.propointmap;
+
+        if(!propointmap.isEmpty())
+        {
+            for (Map.Entry<String, Map<String, ProBasicPowerstationPoint>> entry : propointmap.entrySet()) {
+
+                for (Map.Entry<String, ProBasicPowerstationPoint> map : entry.getValue().entrySet()) {
+
+                    if(CacheContext.pjmap.containsKey(map.getValue().getWindpowerstationId())) {
+                        ProBasicProject pj = CacheContext.pjmap.get(map.getValue().getWindpowerstationId());
+                        StringBuilder sb=new StringBuilder();
+                        sb.append(pj.getWindpowerstationId());
+                        System.out.println("Key = " + map.getKey() + ", Value = " + map.getValue());
+                        taosMapper.createTable(map.getValue().getNemCode(),  String.valueOf(sb));
+                    }
+
+                }
+            }
+        }
+
+        //线路测点建表
+        Map<String, Map<String, ProBasicPowerstationPoint>> linepointmap = CacheContext.linepointmap;
+
+        if(!linepointmap.isEmpty())
+        {
+            for (Map.Entry<String, Map<String, ProBasicPowerstationPoint>> entry : linepointmap.entrySet()) {
+
+                for (Map.Entry<String, ProBasicPowerstationPoint> map : entry.getValue().entrySet()) {
+
+                    if(CacheContext.lnmap.containsKey(map.getValue().getWindpowerstationId())) {
+                        ProBasicLine ln = CacheContext.lnmap.get(map.getValue().getWindpowerstationId());
+                        if(CacheContext.pjmap.containsKey(ln.getProjectId())) {
+                            ProBasicProject pj = CacheContext.pjmap.get(ln.getProjectId());
+
+                            StringBuilder sb=new StringBuilder();
+                            sb.append(pj.getWindpowerstationId());
+                            System.out.println("Key = " + map.getKey() + ", Value = " + map.getValue());
+                            taosMapper.createTable(map.getValue().getNemCode(),  String.valueOf(sb));
+                        }
+                    }
+
+                }
+            }
+        }
+
+        //设备测点建表
+        Map<String, Map<String, ProBasicEquipmentPoint>> eqpointmap = CacheContext.eqpointmap;
+
+        if(!eqpointmap.isEmpty())
+        {
+            for (Map.Entry<String, Map<String, ProBasicEquipmentPoint>> entry : eqpointmap.entrySet()) {
+
+                for (Map.Entry<String, ProBasicEquipmentPoint> map : entry.getValue().entrySet()) {
+
+                    StringBuilder sb=new StringBuilder();
+                    sb.append(map.getValue().getWindpowerstationId()).append("_EQ");
+                    System.out.println("Key = " + map.getKey() + ", Value = " + map.getValue());
+                    taosMapper.createTable(map.getValue().getNemCode(),  String.valueOf(sb));
+                }
+            }
+        }
+
+    }
+
+
+
+}

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 2073
src/main/java/com/gyee/generation/util/realtimesource/EdosUtil.java


+ 0 - 279
src/main/java/com/gyee/generation/util/realtimesource/IEdosUtil.java

@@ -1,279 +0,0 @@
-package com.gyee.generation.util.realtimesource;
-
-
-
-import com.gyee.generation.model.auto.ProBasicEquipmentPoint;
-import com.gyee.generation.model.auto.ProBasicPowerstationPoint;
-import com.gyee.generation.model.vo.RealTimeParameterVo;
-import com.gyee.generation.util.realtimesource.timeseries.DNAStatVal;
-import com.gyee.generation.util.realtimesource.timeseries.DNAVal;
-import com.gyee.generation.util.realtimesource.timeseries.PointData;
-
-import java.util.List;
-import java.util.Map;
-
-
-public interface IEdosUtil {
-
-	/**
-	 * 通过风场测点获得测点实时数据
-	 * @param point 只是用了code字段,作为唯一标识
-	 * @return
-	 * @throws Exception
-	 */
-    public PointData getRealData(ProBasicPowerstationPoint point) throws Exception;
-
-
-    /**
-     * 通过风场测点获得测点切面数据
-     * @param point 只是用了code字段,作为唯一标识
-     * @param date 时间
-     * @return
-     * @throws Exception
-     */
-    public PointData getSectionData(String point,Long date) throws Exception;
-
-
-    /**
-     * 通过风场测点获得测点切面数据
-     * @param point 只是用了code字段,作为唯一标识
-     * @param date 时间
-     * @return
-     * @throws Exception
-     */
-    public PointData getSectionData(ProBasicPowerstationPoint point, Long date) throws Exception;
-
-    /**
-     * 通过风机测点获得测点切面数据
-     * @param point 只是用了code字段,作为唯一标识
-     * @param date 时间
-     * @return
-     * @throws Exception
-     */
-    public PointData getSectionData(ProBasicEquipmentPoint point, Long date) throws Exception;
-
-    /**
-     * 通过风场测点获得测点历史快照数据
-     * @param point 只是用了code字段,作为唯一标识
-     * @param beginDate 开始时间(秒级)
-     * @param endDate 结束时间(秒级)
-     * @param count  点数
-     * @param pried  时间间隔
-     * @return
-     * @throws Exception
-     */
-    public List<PointData> getHistoryDatasSnap(ProBasicPowerstationPoint point, Long beginDate, Long endDate, Long count, Long pried) throws Exception;
-
-    /**
-     * 通过风场测点获得测点历史存储数据,存多少取多少
-     * @param point 只是用了code字段,作为唯一标识
-     * @param beginDate 开始时间(秒级)
-     * @param endDate 结束时间(秒级)
-     * @return
-     * @throws Exception
-     */
-    public List<PointData> getHistoryDatasRaw(ProBasicPowerstationPoint point, Long beginDate, Long endDate) throws Exception;
-
-    /**
-     * 通过风机测点获得测点实时数据
-     * @param point 只是用了id字段,作为唯一标识
-     * @return
-     * @throws Exception
-     */
-    public PointData getRealData(ProBasicEquipmentPoint point) throws Exception;
-
-    /**
-     * 通过风机测点获得历史快照
-     * @param point  只是用了id字段,作为唯一标识
-     * @param  beginDate 开始时间(秒级)
-     * @param endDate 结束时间(秒级)
-     * @param count  点数
-     * @param pried  时间间隔
-     * @return
-     * @throws Exception
-     */
-    public List<PointData> getHistoryDatasSnap(ProBasicEquipmentPoint point, Long beginDate, Long endDate, Long count, Long pried) throws Exception;
-
-    /**
-     * 通过风机测点获得测点历史存储数据,存多少取多少
-     * @param point 只是用了id字段,作为唯一标识
-     * @param  beginDate 开始时间(秒级)
-     * @param endDate 结束时间(秒级)
-     * @return
-     * @throws Exception
-     */
-    public List<PointData> getHistoryDatasRaw(ProBasicEquipmentPoint point, Long beginDate, Long endDate) throws Exception;
-
-
-    /**
-     * 通过风机测点获得测点实时数据
-     * @param pointid 测点编号
-     * @return
-     * @throws Exception
-     */
-    public PointData getRealData(String pointid) throws Exception;
-
-    /**
-     * 通过全局点名获得测点实时数据 读取多个点
-     * @param pointids 测点的数组
-     * @return 列表集合
-     * @throws Exception
-     */
-    public List<PointData> getRealData(String... pointids) throws Exception;
-    /**
-     * 通过全局点名获得测点实时数据 读取多个点
-     * @param pointids 测点的列表
-     * @return 列表集合
-     * @throws Exception
-     */
-    public List<PointData> getRealData(List<String> pointids) throws Exception;
-    /**
-     * 通过全局点名获得测点实时数据 读取多个点
-     * @param pointids 测点的数组
-     * @return Map集合
-     * @throws Exception
-     */
-    public Map<String,Double> getRealDataMap(String... pointids) throws Exception;
-
-    /**
-     * 通过全局点名获得历史数据快照
-     * @param pointid  全局点名
-     * @param beginDate 开始时间(秒级)
-     * @param endDate 结束时间(秒级)
-     * @param count  点数
-     * @param pried  时间间隔
-     * @return
-     * @throws Exception
-     */
-    public List<PointData> getHistoryDatasSnap(String pointid, Long beginDate, Long endDate, Long count, Long pried) throws Exception;
-
-    /**
-     * 通过风机测点获得测点历史存储数据,存多少取多少
-     * @param pointid 全局点名
-     * @param  beginDate 开始时间(秒级)
-     * @param endDate 结束时间(秒级)
-     * @return
-     * @throws Exception
-     */
-    public List<PointData> getHistoryDatasRaw(String pointid, Long beginDate, Long endDate) throws Exception;
-
-
-    /**
-     * 通过风机测点获得测点指定时间周期的统计数据
-     * @param point 只是用了id字段,作为唯一标识
-     * @param  beginDate 开始时间(秒级)
-     * @param endDate 结束时间(秒级)
-     * @param count  点数
-     * @param pried  时间间隔
-     * @type 0、最大值。1、最小值。、平均值
-     * @return
-     * @throws Exception
-     */
-    public List<PointData> getHistStat(ProBasicEquipmentPoint point, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception;
-
-    /**
-     * 通过风场测点获得测点指定时间周期的统计数据
-     * @param point 只是用了code字段,作为唯一标识
-     * @param  beginDate 开始时间(秒级)
-     * @param endDate 结束时间(秒级)
-     * @param count  点数
-     * @param pried  时间间隔
-     * @type 0、最大值。1、最小值。、平均值
-     * @return
-     * @throws Exception
-     */
-    public List<PointData> getHistStat(ProBasicPowerstationPoint point, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception;
-
-    /**
-     * 通过全局点名获得测点指定时间周期的统计数据
-     * @param pointid 全局点名
-     * @param  beginDate 开始时间(秒级)
-     * @param endDate 结束时间(秒级)
-     * @param count  点数
-     * @param pried  时间间隔
-     * @type 0、最大值。1、最小值。、平均值
-     * @return
-     * @throws Exception
-     */
-    public List<PointData> getHistStat(String pointid, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception;
-
-    /**
-     * 通过全局点名获得测点指定时间周期的统计数据 同时返回max、min、avg数据
-     * @param point 全局点名
-     * @param  beginDate 开始时间(秒级)
-     * @param endDate 结束时间(秒级)
-     * @param pried  时间间隔
-     * @return
-     * @throws Exception
-     */
-    public DNAStatVal[] getHistStat(String point, Long beginDate, Long endDate, Integer pried) throws Exception;
-    /**
-     * 补录单点历史数据
-     * @param point 测点对象
-     * @return
-     * @throws Exception
-     */
-    public void updatePoint(PointData point) throws Exception;
-
-    /**
-     * 批量查询实时数据
-     * @param tagNames 测点字符串数组
-     * @return
-     * @throws Exception
-     */
-
-    public DNAVal[] getRealtimeTagValues(String... tagNames) throws Exception;
-
-    /**
-     * 批量插入历史数据
-     * @param pointls 测点对象集合
-     * @throws Exception
-     */
-    public void updatePoint(List<PointData> pointls) throws Exception;
-
-    /**
-     * 单点写入实时数据
-     * @param point 测点对象
-     * @throws Exception
-     */
-    public void sendSinglePoint(PointData point) throws Exception ;
-    /**
-     * 批量写入实时数据
-     * @param pointls 测点对象列表
-     * @throws Exception
-     */
-    public void sendMultiPoint(List<PointData> pointls) throws Exception ;
-
-    /**
-     * 通过两个字符串数组对象批量写入实时数据
-     * @param realvalue 插入值字符串数组
-     * @param pointls 存储对象数组对象
-     * @throws Exception
-     */
-
-    public void sendMultiPoint(String[] realvalue,DNAVal[] pointls) throws Exception;
-    /**
-     *
-     * @param nameList 测点名称列表集合
-     * @param tTime  时间点(秒级)
-     * @return
-     * @throws Exception
-     */
-    public DNAVal[] getHistMatrix(String[] nameList, int tTime) throws Exception;
-
-
-    public void sendMultiRealTimeParamete(List<RealTimeParameterVo> pointls) throws Exception;
-
-    public List<PointData> getHistoryDatasSnap(String pointid, Long beginDate, Long endDate) throws Exception;
-
-
-    /**
-     *
-     * @param nameList 测点名称列表集合
-     * @param tTime  时间点(秒级)
-     * @return
-     * @throws Exception
-     */
-    public List<PointData> getHistMatrix(List<String> nameList, long tTime) throws Exception;
-    public PointData getHistMatrix(String id, long tTime) throws Exception;
-}

+ 185 - 0
src/main/java/com/gyee/generation/util/realtimesource/IRealDataUtil.java

@@ -0,0 +1,185 @@
+package com.gyee.generation.util.realtimesource;
+
+
+
+
+import com.gyee.generation.model.auto.PointDataTaos;
+import com.gyee.generation.model.auto.ProBasicEquipmentPoint;
+import com.gyee.generation.model.auto.ProBasicPowerstationPoint;
+import com.gyee.generation.util.realtimesource.timeseries.PointData;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @description:
+ * @author: shilin
+ * @date: 2024/5/31 9:06
+ * @param: 
+ * @return: 
+ **/
+public interface IRealDataUtil {
+
+
+   /**
+    * @description: 实时数据读取
+    * @author: shilin
+    * @date: 2024/6/5 10:15
+    * @param: [point] 场站测点
+    * @return: com.gyee.generation.util.realtimesource.timeseries.PointData
+    **/
+    public  PointData getRealData(ProBasicPowerstationPoint point) throws Exception;
+    /**
+     * @description: 实时数据读取
+     * @author: shilin
+     * @date: 2024/6/5 10:15
+     * @param: [point] 设备测点
+     * @return: com.gyee.generation.util.realtimesource.timeseries.PointData
+     **/
+    public PointData getRealData(ProBasicEquipmentPoint point) throws Exception ;
+    /**
+     * @description: 实时数据读取
+     * @author: shilin
+     * @date: 2024/6/5 10:15
+     * @param: [point] 测点字符串
+     * @return: com.gyee.generation.util.realtimesource.timeseries.PointData
+     **/
+    public PointData getRealData(String pointid) throws Exception ;
+    /**
+     * @description: 实时数据读取
+     * @author: shilin
+     * @date: 2024/6/5 10:15
+     * @param: [point] 测点字符串数组
+     * @return: com.gyee.generation.util.realtimesource.timeseries.PointData
+     **/
+    public List<PointData> getRealData(String... pointids) throws Exception ;
+
+    /**
+     * @description: 实时数据读取
+     * @author: shilin
+     * @date: 2024/6/5 10:15
+     * @param: [point] 测点字符串集合
+     * @return: com.gyee.generation.util.realtimesource.timeseries.PointData
+     **/
+
+    public List<PointData> getRealData(List<String> pointids) throws Exception;
+
+    /**
+     * @description: 实时数据读取,返回Map集合
+     * @author: shilin
+     * @date: 2024/6/5 10:15
+     * @param: [point] 测点字符串数组
+     * @return: com.gyee.generation.util.realtimesource.timeseries.PointData
+     **/
+    public Map<String, Double> getRealDataMap(String... pointids) throws Exception ;
+    /**
+     * @description: 快照查询
+     * @author: shilin
+     * @date: 2024/6/5 10:20
+     * @param: [point 场站测点, beginDate 开始时间,单位是秒, endDate 结束时间,单位是秒, count 返回结果数量, pried 间隔步长,单位是秒]
+     * @return: java.util.List<com.gyee.generation.util.realtimesource.timeseries.PointData>
+     **/
+    public List<PointData> getHistoryDatasSnap(ProBasicPowerstationPoint point, Long beginDate, Long endDate, Long count, Long pried) throws Exception ;
+    /**
+     * @description: 快照查询
+     * @author: shilin
+     * @date: 2024/6/5 10:20
+     * @param: [point 设备测点, beginDate 开始时间,单位是秒, endDate 结束时间,单位是秒, count 返回结果数量, pried 间隔步长,单位是秒]
+     * @return: java.util.List<com.gyee.generation.util.realtimesource.timeseries.PointData>
+     **/
+    public List<PointData> getHistoryDatasSnap(ProBasicEquipmentPoint point, Long beginDate, Long endDate, Long count, Long pried) throws Exception ;
+    /**
+     * @description: 快照查询
+     * @author: shilin
+     * @date: 2024/6/5 10:20
+     * @param: [point 测点, beginDate 开始时间,单位是秒, endDate 结束时间,单位是秒, count 返回结果数量, pried 间隔步长,单位是秒]
+     * @return: java.util.List<com.gyee.generation.util.realtimesource.timeseries.PointData>
+     **/
+    public List<PointData> getHistoryDatasSnap(String pointid, Long beginDate, Long endDate, Long count, Long pried) throws Exception;
+
+
+    /**
+     * @description: 快照历史数据
+     * @author: shilin
+     * @date: 2024/6/5 10:26
+     * @param: [point 场站测点, beginDate 开始时间,单位是秒, endDate 结束时间,单位是秒]
+     * @return: java.util.List<com.gyee.generation.util.realtimesource.timeseries.PointData>
+     **/
+    public List<PointData> getHistoryDatasRaw(ProBasicPowerstationPoint point, Long beginDate, Long endDate) throws Exception ;
+    /**
+     * @description: 快照历史数据
+     * @author: shilin
+     * @date: 2024/6/5 10:26
+     * @param: [point 设备测点, beginDate 开始时间,单位是秒, endDate 结束时间,单位是秒]
+     * @return: java.util.List<com.gyee.generation.util.realtimesource.timeseries.PointData>
+     **/
+    public List<PointData> getHistoryDatasRaw(ProBasicEquipmentPoint point, Long beginDate, Long endDate) throws Exception ;
+
+    /**
+     * @description: 快照历史数据
+     * @author: shilin
+     * @date: 2024/6/5 10:26
+     * @param: [point 测点, beginDate 开始时间,单位是秒, endDate 结束时间,单位是秒]
+     * @return: java.util.List<com.gyee.generation.util.realtimesource.timeseries.PointData>
+     **/
+    public List<PointData> getHistoryDatasRaw(String pointid, Long beginDate, Long endDate) throws Exception ;
+
+
+    /**
+     * @description: 统计数据
+     * @author: shilin
+     * @date: 2024/6/5 10:28
+     * @param: [point 测点, beginDate 开始时间,单位是秒, endDate 结束时间,单位是秒, count 返回结果数量, pried 间隔步长,单位是秒,type 0 最大,1 最小,2 平均值 ]
+     * @return: java.util.List<com.gyee.generation.util.realtimesource.timeseries.PointData>
+     **/
+    public List<PointData> getHistStat(ProBasicPowerstationPoint point, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception ;
+
+    /**
+     * @description: 统计数据
+     * @author: shilin
+     * @date: 2024/6/5 10:28
+     * @param: [point 测点, beginDate 开始时间,单位是秒, endDate 结束时间,单位是秒, count 返回结果数量, pried 间隔步长,单位是秒,type 0 最大,1 最小,2 平均值 ]
+     * @return: java.util.List<com.gyee.generation.util.realtimesource.timeseries.PointData>
+     **/
+    public List<PointData> getHistStat(ProBasicEquipmentPoint point, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception ;
+    /**
+     * @description: 统计数据
+     * @author: shilin
+     * @date: 2024/6/5 10:28
+     * @param: [point 测点, beginDate 开始时间,单位是秒, endDate 结束时间,单位是秒, count 返回结果数量, pried 间隔步长,单位是秒,type 0 最大,1 最小,2 平均值 ]
+     * @return: java.util.List<com.gyee.generation.util.realtimesource.timeseries.PointData>
+     **/
+    public List<PointData> getHistStat(String pointid, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception ;
+
+
+    /**
+     * @description: 添加和修改
+     * @author: shilin
+     * @date: 2024/6/5 10:32
+     * @param: [taosList] 测点内容
+     * @return: void
+     **/
+    public void sendSinglePoint(List<PointDataTaos>  taosList )  ;
+
+    public void createSql(List<PointDataTaos>  taosList )   ;
+
+    //多点切面数据
+
+
+   /**
+    * @description: 切面查询
+    * @author: shilin
+    * @date: 2024/6/5 10:33
+    * @param: [pointids 测点编号集合, tTime 时间,单位是秒]
+    * @return: java.util.List<com.gyee.generation.util.realtimesource.timeseries.PointData>
+    **/
+    public List<PointData> getHistMatrix(List<String> pointids, long tTime) throws Exception ;
+    /**
+     * @description: 切面查询
+     * @author: shilin
+     * @date: 2024/6/5 10:33
+     * @param: [id 测点编号, tTime 时间,单位是秒]
+     * @return: com.gyee.generation.util.realtimesource.timeseries.PointData
+     **/
+    public PointData getHistMatrix(String id, long tTime) throws Exception;
+}

Fichier diff supprimé car celui-ci est trop grand
+ 1010 - 0
src/main/java/com/gyee/generation/util/realtimesource/TaosUtil.java


+ 1 - 1
src/main/java/com/gyee/generation/util/realtimesource/timeseries/ErrorRequest.java

@@ -27,7 +27,7 @@ public class ErrorRequest {
     public static PointData RequestError(String pointId) {
         PointData data = new PointData();
         data.setPointValueInDouble(0);
-        data.setPointName("0");
+
         return data;
     }
 

+ 0 - 276
src/main/java/com/gyee/generation/util/realtimesource/timeseries/JsonObjectHelper.java

@@ -1,276 +0,0 @@
-package com.gyee.generation.util.realtimesource.timeseries;
-
-
-import cn.hutool.core.util.NumberUtil;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-
-/**
- * @descrition:JSONObject转实体辅助类
- * @author:Wanghs
- * @date:2018-05-10
- */
-public class JsonObjectHelper {
-    public static List<PointData> phrasePointData(JSONArray jsonArray, String tagName) {
-        List<PointData> result = new ArrayList<>();
-
-        for (int i = 0; i < jsonArray.size(); i++) {
-            JSONObject tsData = jsonArray.getJSONObject(i);
-
-            Long ts = tsData.getLong("ts");
-            String pointValue = null;
-            if (tsData.containsKey("doubleValue")) {
-                pointValue = tsData.getString("doubleValue");
-            } else if (tsData.containsKey("booleanValue")) {
-                pointValue = tsData.getString("booleanValue");
-            } else if (tsData.containsKey("longValue")) {
-                pointValue = tsData.getString("longValue");
-            } else if (tsData.containsKey("stringValue")) {
-                pointValue = tsData.getString("stringValue");
-            }
-            PointData pointData = new PointData();
-            pointData.setEdnaId(tagName);
-            pointData.setPointName("1");
-            pointData.setPointTime(ts);
-            pointData.setPointValue(pointValue);
-            pointData.setPointValueInDouble(NumberUtil.round(Double.parseDouble(pointValue),4).doubleValue());
-            //System.out.println("key= " + tagName + ", ts = " + ts + ", value = " + pointValue);
-            result.add(pointData);
-        }
-        return result;
-    }
-
-    public static List<PointData> phrasePointData(JSONObject jsonObject, List<String> tagName) {
-        List<PointData> result = new ArrayList<>();
-
-        if(tagName.size()==jsonObject.keySet().size())
-        {
-
-            for (int i = 0; i < tagName.size(); i++) {
-
-                // 获得key
-                String key = tagName.get(i);
-                JSONObject tsData = jsonObject.getJSONObject(key);
-                Long ts = tsData.getLong("ts");
-                String pointValue = null;
-                if (tsData.containsKey("doubleValue")) {
-                    pointValue = tsData.getString("doubleValue");
-                } else if (tsData.containsKey("booleanValue")) {
-                    pointValue = tsData.getString("booleanValue");
-                } else if (tsData.containsKey("longValue")) {
-                    pointValue = tsData.getString("longValue");
-                } else if (tsData.containsKey("stringValue")) {
-                    pointValue = tsData.getString("stringValue");
-                }
-                PointData pointData = new PointData();
-                pointData.setEdnaId(tagName.get(i));
-                pointData.setPointName("1");
-                pointData.setPointTime(ts);
-                pointData.setPointValue(pointValue);
-                pointData.setPointValueInDouble(NumberUtil.round(Double.parseDouble(pointValue),4).doubleValue());
-                //System.out.println("key= " + tagName + ", ts = " + ts + ", value = " + pointValue);
-                result.add(pointData);
-            }
-
-        }
-
-        return result;
-    }
-
-
-    public static PointData phrasePointData(JSONObject jsonObject, String tagName) {
-        PointData pointData = new PointData();
-
-        if(jsonObject.keySet().size()>0)
-        {
-
-                // 获得key
-                String key = tagName;
-                JSONObject tsData = jsonObject.getJSONObject(key);
-                Long ts = tsData.getLong("ts");
-                String pointValue = null;
-                if (tsData.containsKey("doubleValue")) {
-                    pointValue = tsData.getString("doubleValue");
-                } else if (tsData.containsKey("booleanValue")) {
-                    pointValue = tsData.getString("booleanValue");
-                } else if (tsData.containsKey("longValue")) {
-                    pointValue = tsData.getString("longValue");
-                } else if (tsData.containsKey("stringValue")) {
-                    pointValue = tsData.getString("stringValue");
-                }
-
-                pointData.setEdnaId(tagName);
-                pointData.setPointName("1");
-                pointData.setPointTime(ts);
-                pointData.setPointValue(pointValue);
-                pointData.setPointValueInDouble(NumberUtil.round(Double.parseDouble(pointValue),4).doubleValue());
-                //System.out.println("key= " + tagName + ", ts = " + ts + ", value = " + pointValue);
-
-            }
-
-
-
-        return pointData;
-    }
-    public static List<PointData> phrasePointData(JSONObject jsonObject) {
-        List<PointData> result = new ArrayList<>();
-        Iterator<String> sIterator = jsonObject.keySet().iterator();
-        while (sIterator.hasNext()) {
-            // 获得key
-            String key = sIterator.next();
-            // 根据key获得value, value也可以是JSONObject,JSONArray,使用对应的参数接收即可
-            JSONObject jsonData = jsonObject.getJSONObject(key);
-            Long ts = 0l;
-
-            if (jsonData!=null){
-                ts  = jsonData.getLong("ts");
-                String pointValue = null;
-                if (jsonData.containsKey("doubleValue")) {
-                    pointValue = jsonData.getString("doubleValue");
-                } else if (jsonData.containsKey("booleanValue")) {
-                    pointValue = jsonData.getString("booleanValue");
-                } else if (jsonData.containsKey("longValue")) {
-                    pointValue = jsonData.getString("longValue");
-                } else if (jsonData.containsKey("stringValue")) {
-                    pointValue = jsonData.getString("stringValue");
-                }
-                PointData pointData = new PointData();
-                pointData.setEdnaId(key);
-                pointData.setPointName(key);
-                pointData.setPointValue(pointValue);
-                pointData.setPointTime(ts);
-                if(pointValue.equals("false")  )
-                {
-                    pointData.setPointValueInDouble(0.0);
-                }else  if(pointValue.equals("true") )
-                {
-                    pointData.setPointValueInDouble(1.0);
-                }else
-                {
-                    pointData.setPointValueInDouble(NumberUtil.round(Double.parseDouble(pointValue),4).doubleValue());
-                }
-
-                //  System.out.println("key= " + key + ", ts = " + ts + ", value = " + pointValue);
-                result.add(pointData);
-            }
-        }
-        return result;
-    }
-    /**
-     * @param arry    DoubleStatData集合
-     * @param tagName 标签点名
-     * @param type    0、最大值。1、最小值。2、平均值
-     */
-    public static List<PointData> GeneralTsDataToPointDataByStat(JSONArray arry, String tagName, int type) {
-        List<PointData> result = new ArrayList<>();
-        for (int i = 0; i < arry.size(); i++) {
-            JSONObject jsonData = arry.getJSONObject(i);
-            PointData data = new PointData();
-            data.setEdnaId(tagName);
-            data.setPointName("1");
-            JSONObject avgData = null;
-            JSONObject maxData = null;
-            JSONObject minData = null;
-            if (jsonData.containsKey("avg")) {
-                avgData = jsonData.getJSONObject("avg");
-            }
-            if (jsonData.containsKey("max")) {
-                maxData = jsonData.getJSONObject("max");
-            }
-            if (jsonData.containsKey("min")) {
-                minData = jsonData.getJSONObject("min");
-            }
-            switch (type) {
-                case 0:
-                    data.setPointValue(String.valueOf(maxData.getString("doubleValue")));
-                    data.setPointValueInDouble(Double.valueOf(maxData.getString("doubleValue")));
-                    data.setPointTime(Long.valueOf(maxData.getString("ts")) );
-                    break;
-                case 1:
-                    data.setPointValue(String.valueOf(minData.getString("doubleValue")));
-                    data.setPointValueInDouble(Double.valueOf(minData.getString("doubleValue")));
-                    data.setPointTime(Long.valueOf(minData.getString("ts")) );
-                    break;
-                case 2:
-                    data.setPointValue(String.valueOf(avgData.getString("doubleValue")));
-                    data.setPointValueInDouble(Double.valueOf(avgData.getString("doubleValue")));
-                    data.setPointTime(Long.valueOf(avgData.getString("ts")) );
-                    break;
-                default:
-                    break;
-            }
-            result.add(data);
-        }
-        return result;
-    }
-
-    public static DNAVal[] phraseDNAVal(JSONObject jsonObject, String[] tagName) {
-        DNAVal[] arr = new DNAVal[jsonObject.size()];
-        List<DNAVal> list = new ArrayList<>();
-        Iterator<String> sIterator = jsonObject.keySet().iterator();
-
-        for (int i = 0; i < tagName.length; i++) {
-            // 获得key
-            String key = tagName[i];
-            // 根据key获得value, value也可以是JSONObject,JSONArray,使用对应的参数接收即可
-            JSONObject jsonData = jsonObject.getJSONObject(key);
-            DNAVal data = new DNAVal();
-            data.Time = Integer.parseInt(String.valueOf(Long.valueOf(jsonData.getString("ts")) ));
-            data.Status = (short) jsonData.getShortValue("status");
-            data.DValue = (Double.valueOf(jsonData.getDoubleValue("doubleValue")));
-            list.add(data);
-        }
-
-        return list.toArray(arr);
-    }
-
-    public static DNAStatVal[] phraseDNAVal(JSONArray jsonArray) {
-
-        DNAStatVal[] arr = new DNAStatVal[jsonArray.size()];
-        List<DNAStatVal> list = new ArrayList<>();
-        for (int i = 0; i < jsonArray.size(); i++) {
-            JSONObject jsonData = jsonArray.getJSONObject(i);
-            JSONObject avgData = null;
-            JSONObject maxData = null;
-            JSONObject minData = null;
-            if (jsonData.containsKey("avg")) {
-                avgData = jsonData.getJSONObject("avg");
-            }
-            if (jsonData.containsKey("max")) {
-                maxData = jsonData.getJSONObject("max");
-            }
-            if (jsonData.containsKey("min")) {
-                minData = jsonData.getJSONObject("min");
-            }
-            DNAStatVal statVal = new DNAStatVal();
-
-            DNAVal avgVal = new DNAVal();
-            DNAVal maxVal = new DNAVal();
-            DNAVal minVal = new DNAVal();
-
-            avgVal.Time = Integer.valueOf(String.valueOf(Long.valueOf(avgData.getString("ts")) ));
-            avgVal.DValue = Double.valueOf(avgData.getString("doubleValue"));
-
-            maxVal.Time =  Integer.valueOf(String.valueOf(Long.valueOf(maxData.getString("ts")) ));
-            maxVal.DValue = Double.valueOf(maxData.getString("doubleValue"));
-
-            minVal.Time =  Integer.valueOf(String.valueOf(Long.valueOf(minData.getString("ts")) ));
-            minVal.DValue = Double.valueOf(minData.getString("doubleValue"));
-
-            statVal.max = maxVal;
-            statVal.min = minVal;
-            statVal.avg = avgVal;
-
-            list.add(statVal);
-        }
-
-        return list.toArray(arr);
-    }
-
-}

+ 4 - 51
src/main/java/com/gyee/generation/util/realtimesource/timeseries/PointData.java

@@ -1,65 +1,18 @@
 package com.gyee.generation.util.realtimesource.timeseries;
 
+import lombok.Data;
+
+@Data
 public class PointData {
 
 	private double pointValueInDouble;
 
-	private double pointValueInDouble2;
 
 	private Long pointTime;
 
 	private String pointValue;
 
-	private String pointName;// z自定义名称
-
 	private String ednaId;// edna全局id
 
-	public double getPointValueInDouble2() {
-		return pointValueInDouble2;
-	}
-
-	public void setPointValueInDouble2(double pointValueInDouble2) {
-		this.pointValueInDouble2 = pointValueInDouble2;
-	}
-
-	public String getEdnaId() {
-		return ednaId;
-	}
-
-	public String getPointName() {
-		return pointName;
-	}
-
-	public Long getPointTime() {
-		return pointTime;
-	}
-
-	public String getPointValue() {
-		return pointValue;
-	}
-
-	public  double getPointValueInDouble() {
-		return pointValueInDouble;
-	}
-
-	public void setEdnaId(String ednaId) {
-		this.ednaId = ednaId;
-	}
-
-	public void setPointName(String pointName) {
-		this.pointName = pointName;
-	}
-
-	public void setPointTime(Long pointTime) {
-		this.pointTime = pointTime;
-	}
-
-	public void setPointValue(String pointValue) {
-		this.pointValue = pointValue;
-	}
-
-	public void setPointValueInDouble(double pointValueInDouble) {
-		this.pointValueInDouble = pointValueInDouble;
-	}
-
+	private Integer metric;
 }

+ 22 - 23
src/main/resources/application-jn.yml

@@ -37,7 +37,7 @@ spring:
           driver-class-name: org.mariadb.jdbc.Driver
         slave:
           driver-class-name: com.taosdata.jdbc.TSDBDriver
-          url: jdbc:TAOS://10.81.3.154:6030/test?charset=UTF-8&locale=en_US.UTF-8&timezone=UTC-8
+          url: jdbc:TAOS://124.70.56.8:6030/test?charset=UTF-8&locale=en_US.UTF-8&timezone=UTC-8
           username: root
           password: taosdata
         #配置初始化连接数大小
@@ -132,28 +132,27 @@ frequency:
   powerrationing: 1
   #切入切出
   cutinandout: 1
-#不参与单机电量计算的场站
-notCalculatePower: SXJ_KGDL_YTY_FDC_STA
-powerjob:
-  worker:
-    #打开测试模式,不强制验证服务器连接
-    allow-lazy-connect-server: false
-    #应用程序名称,用于对应用程序进行分组。建议设置与项目名称相同的值。
-    app-name: powerjob-worker-sample
-    #是否启用PowerJob Worker,默认为true
-    enabled: true
-    #附加的工作流上下文的最大长度。将忽略比该值长的附加工作流上下文值。
-    max-appended-wf-context-length: 4096
-    #结果的最大长度。超过该值的结果将被截断。
-    max-result-length: 4096
-    #传输端口,默认为27777
-    port: 27777
-    #服务器和工作程序之间的传输协议
-    protocol: http
-    #PowerJob服务器节点的地址。Ip:端口或域。多个地址应使用逗号分隔。
-    server-address: 120.46.128.147:7700,120.46.128.147:7701
-    #H2数据库的存储策略。磁盘或内存。默认值为磁盘。
-    store-strategy: disk
+
+#powerjob:
+#  worker:
+#    #打开测试模式,不强制验证服务器连接
+#    allow-lazy-connect-server: false
+#    #应用程序名称,用于对应用程序进行分组。建议设置与项目名称相同的值。
+#    app-name: powerjob-worker-sample
+#    #是否启用PowerJob Worker,默认为true
+#    enabled: true
+#    #附加的工作流上下文的最大长度。将忽略比该值长的附加工作流上下文值。
+#    max-appended-wf-context-length: 4096
+#    #结果的最大长度。超过该值的结果将被截断。
+#    max-result-length: 4096
+#    #传输端口,默认为27777
+#    port: 27777
+#    #服务器和工作程序之间的传输协议
+#    protocol: http
+#    #PowerJob服务器节点的地址。Ip:端口或域。多个地址应使用逗号分隔。
+#    server-address: 120.46.128.147:7700,120.46.128.147:7701
+#    #H2数据库的存储策略。磁盘或内存。默认值为磁盘。
+#    store-strategy: disk
 
 
 

+ 5 - 4
src/test/java/com/gyee/generation/GenerationTest.java

@@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUtil;
 import com.gyee.generation.service.initalcache.CacheService;
 import com.gyee.generation.service.initialpoint.InitialPointService;
 
+import com.gyee.generation.service.initialpoint.InitialTaosPointService;
 import com.gyee.generation.util.SpringUtils;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
@@ -40,10 +41,10 @@ public class GenerationTest {
         SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         System.out.println(df.format(c.getTime()).toString());
 
-        InitialPointService initialPointService = SpringUtils.getBean("initialPointService");
-
-//     initialPointService.initalFc();
-//        initialPointService.initalFj();
+//        InitialTaosPointService initialTaosPointService = SpringUtils.getBean("initialTaosPointService");
+//
+//        initialTaosPointService.initalFc();
+//        initialTaosPointService.initalFj();
 
         CacheService cacheService = SpringUtils.getBean("cacheService");
 

+ 80 - 0
src/test/java/com/gyee/generation/TaosTest.java

@@ -0,0 +1,80 @@
+package com.gyee.generation;
+
+
+
+import com.gyee.generation.model.auto.PointDataTaos;
+import com.gyee.generation.model.auto.ProBasicPowerstationPoint;
+import com.gyee.generation.service.initialpoint.TaosInitalPonitService;
+import com.gyee.generation.util.SpringUtils;
+import com.gyee.generation.util.realtimesource.IRealDataUtil;
+import com.gyee.generation.util.realtimesource.timeseries.PointData;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+@SpringBootApplication
+public class TaosTest
+{
+    public static void main(String[] args) throws Exception {
+        SpringApplication.run(TaosTest.class, args);
+
+        TaosInitalPonitService taosInitalPonitService= SpringUtils.getBean("taosInitalPonitService");
+
+
+//        taosInitalPonitService.initalTaosPointTable();
+//
+//        alarmCtService.createSuperTable();
+//        alarmCtService.initalCtAlarm();
+//
+//
+        IRealDataUtil taosUtil= SpringUtils.getBean("taosUtil");
+//
+//        String[] points={"SXJ_KGDL_FLFD_BHB_F_P1_L1_0001_AI0061",
+//                "SXJ_KGDL_FLFD_BHB_F_P1_L1_0001_AI0062",
+//                "SXJ_KGDL_FLFD_BHB_F_P1_L1_0001_AI0063",
+//                "SXJ_KGDL_FLFD_BHB_F_P1_L1_0001_AI0064"
+//                };
+//        List<PointData> ls= taosUtil.getRealData(points);
+//
+//
+//
+//
+//        List<PointDataTaos>  taosList=new ArrayList();
+//        PointDataTaos taos1=new PointDataTaos();
+//        taos1.setId("SXJ_KGDL_FLFD_BHB_F_P1_L1_0001_AI0064");
+//        taos1.setTs(new Timestamp(new Date().getTime()));
+//        taos1.setVal(12.6);
+//        taos1.setMetric(1);
+//        taosList.add(taos1);
+//        PointDataTaos taos2=new PointDataTaos();
+//        taos2.setId("SXJ_KGDL_FLFD_BHB_F_P1_L1_0001_AI0064");
+//        taos2.setTs(new Timestamp(new Date().getTime()+3000l));
+//        taos2.setVal(18.6);
+//        taos2.setMetric(1);
+//        taosList.add(taos2);
+//
+//        taosUtil.sendSinglePoint(taosList);
+//        List<PointData> ls=taosUtil.getHistoryDatasSnap( "SXJ_KGDL_FLFD_BHB_F_P1_L1_0001_AI0064",1717430400l,new Date().getTime()/1000,null,600l);
+//
+
+//        List<PointData> ls=taosUtil.getHistoryDatasRaw( "SXJ_KGDL_FLFD_BHB_F_P1_L1_0001_AI0064",1717430400l,1717468230l);
+
+        List<PointData> ls=taosUtil.getHistStat( "SXJ_KGDL_FLFD_BHB_F_P1_L1_0001_AI0064",1717430400l,new Date().getTime()/1000,null,600l,0);
+        for(int i=0;i<ls.size();i++)
+        {
+
+            PointData value= ls.get(i);
+            System.out.println(value.getPointValueInDouble());
+        }
+
+
+
+        System.out.println("完成!");
+
+
+    }
+}