Browse Source

适配器taoscz更新

xushili 1 year ago
parent
commit
8a93323f41

+ 1 - 1
dao/dao-taoscz/build.gradle

@@ -22,7 +22,7 @@ dependencies {
     implementation project(":dao:dao-interface")
     implementation fileTree(dir: 'src/main/lib', include: '*.jar')
     implementation("$bootGroup:spring-boot-starter-log4j2")
-    implementation ("com.taosdata.jdbc:taos-jdbcdriver:2.0.35"){
+    implementation ("com.taosdata.jdbc:taos-jdbcdriver:$taosVersion"){
         exclude group: 'com.alibaba', module: 'fastjson'
     }
 }

+ 3 - 12
dao/dao-taoscz/src/main/java/com/gyee/wisdom/dao/taoscz/TaosConfig.java

@@ -5,10 +5,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Configuration;
 
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.ResultSet;
-import java.sql.Statement;
+import java.sql.*;
 import java.util.Date;
 import java.util.Properties;
 import java.util.Random;
@@ -49,7 +46,7 @@ public class TaosConfig {
 
     private Connection connection = null;
 
-    public Connection getInstance() {
+    public Connection getInstance() throws Exception {
         if (null == connection)
             connection = getConnection();
 
@@ -57,11 +54,9 @@ public class TaosConfig {
     }
 
 
-    private Connection getConnection() {
+    private Connection getConnection() throws Exception {
         Connection connection = null;
 
-        try {
-
             Class.forName(driverType);
             String jdbcUrl = "jdbc:TAOS-RS://" + serverIp + ":" + serverPort + "/" + dbName + "?user=" + userName + "&password=" + password;
             if (driverType.equals("com.taosdata.jdbc.TSDBDriver"))
@@ -71,10 +66,6 @@ public class TaosConfig {
             connProps.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8");
             connProps.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8");
             connection = DriverManager.getConnection(jdbcUrl, connProps);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
 
         return connection;
     }

+ 12 - 13
dao/dao-taoscz/src/main/java/com/gyee/wisdom/dao/taoscz/TaosHistoryDao.java

@@ -58,11 +58,11 @@ public class TaosHistoryDao implements IHistoryDao {
         Statement st = taosConfig.getInstance().createStatement();
         String point = tsQuery.getTsPoint().getId();
         StringBuilder sb = new StringBuilder();
-        sb.append("select avg(value),max(value),min(value) from ");
+        sb.append("select avg(val),max(val),min(val) from ");
         sb.append(taosConfig.getTableName(tsQuery.getTsPoint().getId()));
-        sb.append(" where ts>='").append(DateFormatUtils.format(tsQuery.getStartTs(), "yyyy-MM-dd HH:mm:ss:SSS"));
-        sb.append("' and ts<='").append(DateFormatUtils.format(tsQuery.getEndTs(), "yyyy-MM-dd HH:mm:ss:SSS"));
-        sb.append("' interval(").append(tsQuery.getInterval()).append("s)");
+        sb.append(" where ts between").append(tsQuery.getStartTs());
+        sb.append(" and ").append(tsQuery.getEndTs());
+        sb.append(" interval(").append(tsQuery.getInterval()).append("s)");
         ResultSet rs = st.executeQuery(sb.toString());
         while (rs.next()) {
             DoubleTsData avgData = new DoubleTsData(rs.getLong(1), (short) 1, rs.getDouble(2));
@@ -104,13 +104,13 @@ public class TaosHistoryDao implements IHistoryDao {
             String[] tagNames = entry.getValue().stream().map(TsPoint::getId).toArray(String[]::new);
             if (entry.getKey() == TsDataType.DOUBLE)
                 for (String tag : tagNames) {
-                    TaskCallable task = new TaskCallable(taosConfig.getInstance(), ts, tag, TsDataType.DOUBLE);
+                    TaskCallable task = new TaskCallable(taosConfig, ts, tag, TsDataType.DOUBLE);
                     Future<Map<String, TsData>> submit = taskConfig.getInstance().submit(task);
                     results.add(submit);
                 }
             if (entry.getKey() == TsDataType.BOOLEAN) {
                 for (String tag : tagNames) {
-                    TaskCallable task = new TaskCallable(taosConfig.getInstance(), ts, tag, TsDataType.BOOLEAN);
+                    TaskCallable task = new TaskCallable(taosConfig, ts, tag, TsDataType.BOOLEAN);
                     Future<Map<String, TsData>> submit = taskConfig.getInstance().submit(task);
                     results.add(submit);
                 }
@@ -223,16 +223,15 @@ public class TaosHistoryDao implements IHistoryDao {
         if (tsQuery.getInterpolation() == Interpolation.RAW) {
             sb.append("select * from ");
             sb.append(taosConfig.getTableName(point));
-            sb.append(" where ts>='").append(DateFormatUtils.format(tsQuery.getStartTs(), "yyyy-MM-dd HH:mm:ss:SSS"));
-            sb.append("' and ts<='").append(DateFormatUtils.format(tsQuery.getEndTs(), "yyyy-MM-dd HH:mm:ss:SSS"));
-            sb.append("'");
+            sb.append(" where ts between ").append(tsQuery.getStartTs());
+            sb.append(" and ").append(tsQuery.getEndTs());
         } else if (tsQuery.getInterpolation() == Interpolation.SNAP) {
             if (tsQuery.getDateArray() != null && tsQuery.getDateArray().length > 0) {
-                sb.append("select last(value) from ");
+                sb.append("select interp(val) from ");
                 sb.append(taosConfig.getTableName(point));
-                sb.append(" where ts>='").append(DateFormatUtils.format(tsQuery.getStartTs(), "yyyy-MM-dd HH:mm:ss:SSS"));
-                sb.append("' and ts<'").append(DateFormatUtils.format(tsQuery.getEndTs(), "yyyy-MM-dd HH:mm:ss:SSS"));
-                sb.append("' interval(").append(tsQuery.getInterval()).append("s) fill(prev)");
+                sb.append(" where ts between ").append(tsQuery.getStartTs());
+                sb.append(" and ").append(tsQuery.getEndTs());
+                sb.append(" every(").append(tsQuery.getInterval()).append("s) fill(prev)");
             } else {
                 throw new WisdomException("无效的查询条件!");
             }

+ 17 - 19
dao/dao-taoscz/src/main/java/com/gyee/wisdom/dao/taoscz/TaosLatestDao.java

@@ -12,7 +12,9 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
 import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
 import java.sql.Statement;
+import java.sql.Timestamp;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
@@ -38,10 +40,10 @@ public class TaosLatestDao implements ILatestDao {
             String[] tagNames = entry.getValue().stream().map(TsPoint::getId).toArray(String[]::new);
             if (entry.getKey() == TsDataType.DOUBLE) {
                 result.putAll(getDoubleTsDataSnapshots(tagNames));
-            } else if (entry.getKey() == TsDataType.LONG) {
-                result.putAll(getLongTsDataSnapshots(tagNames));
             } else if (entry.getKey() == TsDataType.BOOLEAN) {
                 result.putAll(getBooleanTsDataSnapshots(tagNames));
+            } else if (entry.getKey() == TsDataType.LONG) {
+                result.putAll(getLongTsDataSnapshots(tagNames));
             } else {
                 throw new WisdomException("Taos不支持数据类型:" + entry.getKey());
             }
@@ -55,16 +57,16 @@ public class TaosLatestDao implements ILatestDao {
     public int writeDoubleLatest(List<TsPointData> list) throws Exception {
         Statement st = config.getInstance().createStatement();
         StringBuilder sb = new StringBuilder();
-        sb.append("insert into ");
+        sb.append("INSERT INTO ");
         for (TsPointData obj : list) {
             long time = obj.getTsData().getTs();
             String point = config.getTableName(obj.getTagName());
             double value = obj.getTsData().getDoubleValue().get();
             // sb.append(TaosCovertUtil.coverStationPrefix(point)).append(".");
-            sb.append(point).append(" values (");
-            sb.append(time).append(",").append(value).append(")");
+            sb.append(point).append(" VALUES (");
+            sb.append(time).append(",").append(value).append(") ");
         }
-
+        sb.append(";");
         val i = st.executeUpdate(sb.toString());
 
         return i == list.size() ? list.size() : 0;
@@ -99,11 +101,12 @@ public class TaosLatestDao implements ILatestDao {
             boolean value = obj.getTsData().getBooleanValue().get();
             // sb.append(TaosCovertUtil.coverStationPrefix(point)).append(".");
             sb.append(point).append(" values (");
-            sb.append(time).append(",").append(value).append(")");
+            sb.append(time).append(",").append(value).append(") ");
         }
-        boolean flag = st.execute(sb.toString());
+        sb.append(";");
+        int i = st.executeUpdate(sb.toString());
 
-        return flag == true ? list.size() : 0;
+        return i;
     }
 
     @Override
@@ -174,17 +177,11 @@ public class TaosLatestDao implements ILatestDao {
     public Map<String, TsData> getDoubleTsDataSnapshots(String... tagNames) throws Exception {
         Map<String, TsData> tsDataMap = new HashMap<>();
         Statement st = config.getInstance().createStatement();
-//        for (String tag : tagNames) {
-//            String tableName = config.getTableName(tag);
-//
-//            ResultSet rs = st.executeQuery("select last_row(*) from " + tableName);
-//            while (rs.next()) {
-//                tsDataMap.put(tag, new DoubleTsData(rs.getTimestamp(1).getTime(), (short) 0, rs.getDouble(2)));
-//            }
-//        }
 
         String inString = Arrays.stream(tagNames).map(s -> "'" + s + "'").collect(Collectors.joining(","));
-        ResultSet rs = st.executeQuery("select last_row(*) from " + config.getDbName() + "." + config.getAIStableName() + " where point in (" + inString + ") group by tbname;");
+        inString = "select last_row(*),tbname from " + config.getDbName() + "." + config.getAIStableName()
+                + " where tbname in (" + inString + ") group by tbname;";
+        ResultSet rs = st.executeQuery(inString);
 
         while (rs.next()) {
             tsDataMap.put(rs.getString(3).toUpperCase(), new DoubleTsData(rs.getTimestamp(1).getTime(), (short) 0, rs.getDouble(2)));
@@ -210,7 +207,8 @@ public class TaosLatestDao implements ILatestDao {
         Statement st = config.getInstance().createStatement();
 
         String inString = Arrays.stream(tagNames).map(s -> "'" + s + "'").collect(Collectors.joining(","));
-        ResultSet rs = st.executeQuery("select last_row(*) from " + config.getDbName() + "." + config.getDIStableName() + " where point in (" + inString + ") group by tbname;");
+        ResultSet rs = st.executeQuery("select last_row(*),tbname from " + config.getDbName() + "." + config.getDIStableName() +
+                " where tbname in (" + inString + ") group by tbname;");
 
         while (rs.next()) {
             tsDataMap.put(rs.getString(3).toUpperCase(), new BooleanTsData(rs.getTimestamp(1).getTime(), (short) 0, rs.getBoolean(2)));

+ 9 - 9
dao/dao-taoscz/src/main/java/com/gyee/wisdom/dao/taoscz/TaskCallable.java

@@ -18,7 +18,7 @@ import java.util.concurrent.Callable;
 @Slf4j
 public class TaskCallable implements Callable<Map<String, TsData>> {
 
-    private Connection connection;
+    private TaosConfig taosConfig;
     private long time;
     private String tagName;
     private TsDataType type;
@@ -26,8 +26,8 @@ public class TaskCallable implements Callable<Map<String, TsData>> {
     private long day_time = 86400000L;
     private long year_time = 8640000000L;
 
-    public TaskCallable(Connection connection, long time, String tagName, TsDataType type) {
-        this.connection = connection;
+    public TaskCallable(TaosConfig taosConfig, long time, String tagName, TsDataType type) {
+        this.taosConfig = taosConfig;
         this.time = time;
         this.tagName = tagName;
         this.type = type;
@@ -45,14 +45,14 @@ public class TaskCallable implements Callable<Map<String, TsData>> {
             return result;
 
         try {
-            st = this.connection.createStatement();
+            st = taosConfig.getInstance().createStatement();
 //            String point = TaosCovertUtil.coverStationPrefix(this.tagName) + "." + this.tagName.replace(".", "_");
 //            String tableName = dbName+ "." + this.tagName;
-            String sql = "select last_row(*) from " + "tst" + " where point_time>='"
-                    + DateFormatUtils.format(this.time - year_time, "yyyy-MM-dd HH:mm:ss:SSS") + "'"
-                    + " and point_time <='" + DateFormatUtils.format(this.time, "yyyy-MM-dd HH:mm:ss:SSS") + "'";
-            log.info(sql);
-            rs = st.executeQuery(sql);
+            StringBuilder sb = new StringBuilder();
+            sb.append("select last_row(*) from ").append(taosConfig.getDbName()).append(".")
+                    .append(tagName).append(" where ts>=").append(time);
+            //log.info(sql);
+            rs = st.executeQuery(sb.toString());
             if (rs.next()) {
                 if (this.type == TsDataType.DOUBLE)
                     tsData = new DoubleTsData(this.time, (short) 0, rs.getDouble(2));

+ 4 - 3
data-adapter/build.gradle

@@ -22,9 +22,9 @@ dependencies {
     implementation project(":dao:dao-sql")
     //compile project(":dao:dao-redis")
    // compile project(":dao:dao-simulator")
-    implementation project(":dao:dao-golden")
+    //implementation project(":dao:dao-golden")
     //compile project(":dao:dao-taos")
-   // implementation project(":dao:dao-taoscz")
+    implementation project(":dao:dao-taoscz")
     //compile project(":dao:dao-hive")
     //compile project(":dao:dao-hadoop")
     implementation fileTree(dir: 'src/main/lib', include: '*.jar') //// oracle连接驱动       2区使用
@@ -43,7 +43,8 @@ dependencies {
     //implementation "org.springframework.boot:spring-boot-starter-redis:1.3.5.RELEASE"
     //compile('io.moquette:moquette-broker:0.10')
     implementation('com.fasterxml.jackson.datatype:jackson-datatype-jdk8')
-    implementation ("com.taosdata.jdbc:taos-jdbcdriver:2.0.35")
+    implementation ("com.taosdata.jdbc:taos-jdbcdriver:$taosVersion")
+    implementation 'org.postgresql:postgresql:42.4.0'
 
 }
 

+ 2 - 2
data-adapter/src/main/java/com/gyee/wisdom/dataadapter/runner/SpringStartAfter.java

@@ -24,7 +24,7 @@ import java.sql.Statement;
 import java.util.*;
 import java.util.stream.Collectors;
 
-@Component
+//@Component
 @Slf4j
 public class SpringStartAfter implements ApplicationRunner {
 
@@ -60,7 +60,7 @@ public class SpringStartAfter implements ApplicationRunner {
         //牛首山风电场 taos库创建,taos库保存数据为90天
         //initDatabase("FS_FDC", 90);
 //        //牛首山风电场 ai测点表创建,超级表名为windturbineai,风机型号为UP82
-        initTableAI("FS_FDC", "pointai", "UP82-1500");
+        //initTableAI("FS_FDC", "pointai", "UP82-1500");
 //        //牛首山风电场 di测点表创建,超级表名为windturbinedi,风机型号为UP82
         //initTableDI("FS_FDC", "pointdi", "UP82-1500");
 

+ 2 - 3
data-adapter/src/main/resources/application-hf.yaml

@@ -1,6 +1,5 @@
 server:
   port: 8012
-  connection-timeout: 3000
   max-http-header-size: 128KB
 
 
@@ -116,9 +115,9 @@ taoscz:
   driver_type: com.taosdata.jdbc.rs.RestfulDriver
   #driver_type: com.taosdata.jdbc.TSDBDriver
   #taos中ai测点的超级表名
-  di_stable_name: windturbinedi
+  di_stable_name: pointdi
   #taos中di测点的超级表名
-  ai_stable_name: windturbineai
+  ai_stable_name: pointai
 
 #EDOS 数据库信息
 edos:

+ 162 - 0
data-adapter/src/main/resources/application-nx.yaml

@@ -0,0 +1,162 @@
+server:
+  port: 8012
+  max-http-header-size: 128KB
+
+
+spring:
+  application:
+    name: data-adapter
+  jpa:
+    show-sql: false
+  cache:
+    type: SIMPLE
+  datasource:
+    # -------------------------1区mysql/2区oracle---------------------------------------
+    driver-class-name: oracle.jdbc.OracleDriver
+    url: jdbc:oracle:thin:@192.168.1.105:1521:gdnxfd
+    username: nxfdprod
+    password: gdnxfd123
+    # -------------------------1区mysql/2区oracle---------------------------------------
+#    driver-class-name: oracle.jdbc.OracleDriver
+#    url: jdbc:oracle:thin:@123.60.213.70:1521:gdnxfd
+#    username: nxfdprod
+#    password: gdnxfd123
+    # ----------------------------------------------------------------
+#    driver-class-name: com.mysql.jdbc.Driver
+#    url: jdbc:mysql://123.60.219.66/wisdom_cs_hnj?useUnicode=true&characterEncoding=UTF-8
+#    username: root
+#    password: gyeepd@123
+    # ----------------------------------------------------------------
+    type: com.alibaba.druid.pool.DruidDataSource
+    druid:
+          max-active: 20
+          initial-size: 1
+          min-idle: 3
+          max-wait: 60000
+          time-between-eviction-runs-millis: 60000
+          min-evictable-idle-time-millis: 300000
+          test-while-idle: true
+          test-on-borrow: false
+          test-on-return: false
+  config:
+    activate:
+      on-profile: nx
+#  redis:
+#    database: 2
+#    host: 192.168.2.5
+#    password:
+#    port: 6379
+#    timeout: 60000
+#    jedis:
+#      pool:
+#        maxTotal: 20
+#        maxIdle: 20
+#        maxwait: 60000
+#        minIdle: 10
+# 此处Key不可改变
+knife4j:
+  redis:
+    # 是否采用json序列化方式,若不采用jackson序列化
+    jsonSerialType: 'Fastjson'
+    host: 114.55.105.194
+    password: wanghs123
+    port: 6379
+    databases: [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] # 要使用的库,会根据此处填写的库生成redisTemplate
+    timeout: 60s
+    lettuce: # lettuce基于netty,线程安全,支持并发
+      pool:
+        max-active: 50
+        max-wait: -1ms
+        max-idle: 8
+        min-idle: 0
+  cache:
+    type: Simple
+
+timeseries:
+  db-type: taoscz #"${DATABASE_TYPE:sql}" # cassandra/kairosDB/hbase/opentsDB/influxDB/TiDB
+  #db-type: hadoop #"${DATABASE_TYPE:sql}" # cassandra/kairosDB/hbase/opentsDB/influxDB/TiDB
+#golden 数据库信息
+golden:
+  server_ip: 10.155.32.1
+  #server_ip: 172.168.1.3
+  server_port: 6327
+  user_name: sa
+  password: golden
+  pool_size: 10
+  max_pool_size: 100
+  #单次查询历史原始数据的数量上限
+  query_history_limit: 100000
+
+#hadoop数据库信息
+hadoop:
+#查询上一个值的最多访问次数  2的8次方,增加步长为60分钟,如:t0-60,t0-120,t0-240....
+ lastValueSearch: 8
+ urlMap:
+   DJL: http://192.168.1.61:4242/api/
+   DQ: http://192.168.1.62:4242/api/
+   GF: http://192.168.1.63:4242/api/
+   GGL: http://192.168.1.64:4242/api/
+   FGL: http://192.168.1.66:4242/api/
+   FJ: http://192.168.1.69:4243/api/
+   JSFW: http://192.168.1.67:4242/api/
+   #仅限于查询NSSDQN,NXDQDI,SBQNWDQ,SBQXLDQ
+   DQ2: http://192.168.1.62:10001/api/
+
+#taos数据库
+taos:
+  server_ip: 192.168.2.252
+  server_port: 6030
+  user_name: root
+  password: taosdata
+  pool_size: 10
+  max_pool_size: 100
+
+#适配器链接taos数据库配置信息
+taoscz:
+  server_ip: 192.168.23.128
+  server_port: 6030
+  db_name: nxxny
+  user_name: root
+  password: taosdata
+  pool_size: 10
+  max_pool_size: 100
+  #driver_type: com.taosdata.jdbc.rs.RestfulDriver
+  driver_type: com.taosdata.jdbc.TSDBDriver
+  #taos中ai测点的超级表名
+  di_stable_name: pointdi
+  #taos中di测点的超级表名
+  ai_stable_name: pointai
+
+#EDOS 数据库信息
+edos:
+  server_ip: 192.168.1.100
+  server_port: 10010
+  default_connections: 1
+  incremental_connections: 1
+  max_connections: 10
+# Publish 发布服务配置
+publish:
+  rtdb_scan_interval: 1000
+  publish_interval: 5000
+
+#是否缓存所有风机测点
+isLoadAllTag: true
+#是否启动websocket推送
+websocket_start: false
+#websocket推送风机基本信息统一编码
+uniformcode:
+ wind_speed_code: AI022
+ roll_speed_code: AI128
+ power_code: AI130
+ status_code: FJZT8
+ lock_code: XDSL
+ pv_I: AIG060     #电流-A相
+ pv_U: AIG061     #电压-A相
+ pv_P: AI130      #功率-有功功率
+ pv_statue: FJZT  #状态
+
+
+
+
+
+

+ 11 - 10
data-adapter/src/main/resources/application.yaml

@@ -1,7 +1,8 @@
 server:
   port: 8012
-  connection-timeout: 3000
   max-http-header-size: 128KB
+  tomcat:
+    connection-timeout: 3000
 
 
 spring:
@@ -13,15 +14,15 @@ spring:
     type: SIMPLE
   datasource:
     # -------------------------1区mysql/2区oracle---------------------------------------
-#    driver-class-name: oracle.jdbc.OracleDriver
-#    url: jdbc:oracle:thin:@123.60.213.70:1521:gdnxfd
-#    username: nxfdprod
-#    password: gdnxfd123
+    driver-class-name: oracle.jdbc.OracleDriver
+    url: jdbc:oracle:thin:@123.60.213.70:1521:gdnxfd
+    username: nxfdprod
+    password: gdnxfd123
     # ----------------------------------------------------------------
-    driver-class-name: com.mysql.jdbc.Driver
-    url: jdbc:mysql://123.60.219.66/wisdom_cs_hnj?useUnicode=true&characterEncoding=UTF-8
-    username: root
-    password: gyeepd@123
+#    driver-class-name: com.mysql.jdbc.Driver
+#    url: jdbc:mysql://123.60.219.66/wisdom_cs_hnj?useUnicode=true&characterEncoding=UTF-8
+#    username: root
+#    password: gyeepd@123
     # ----------------------------------------------------------------
     type: com.alibaba.druid.pool.DruidDataSource
     druid:
@@ -35,7 +36,7 @@ spring:
           test-on-borrow: false
           test-on-return: false
   profiles:
-    active: hf
+    active: nxxnj
 #  redis:
 #    database: 2
 #    host: 192.168.2.5

+ 3 - 1
gradle.properties

@@ -37,4 +37,6 @@ commonsBeanUtilsVersion=1.9.4
 alibabaDruidVersion=1.2.9
 groovyVersion=3.0.9
 openFeignVersion=11.8
-postgresqlDriverVersion=42.4.0
+postgresqlDriverVersion=42.4.0
+#taosVersion=2.0.35
+taosVersion=3.0.3

+ 86 - 0
transport/redis2taos/src/main/resources/application-nx1q.yaml

@@ -0,0 +1,86 @@
+server:
+  port: 8085
+
+spring:
+  application:
+    name: transport
+  jpa:
+    show-sql: false
+  cache:
+    type: SIMPLE
+  datasource:
+    driver-class-name: oracle.jdbc.OracleDriver
+    url: jdbc:oracle:thin:@18.6.30.55:1521:gdnxfd
+    username: nxfdprod
+    password: gdnxfd123
+    type: com.alibaba.druid.pool.DruidDataSource
+    druid:
+      max-active: 20
+      initial-size: 1
+      min-idle: 3
+      max-wait: 60000
+      time-between-eviction-runs-millis: 60000
+      min-evictable-idle-time-millis: 300000
+      test-while-idle: true
+      test-on-borrow: false
+      test-on-return: false
+
+knife4j:
+  redis:
+    # 是否采用json序列化方式,若不采用jackson序列化
+    jsonSerialType: 'Fastjson'
+    host: 18.6.30.75
+    password: 123456
+    port: 6379
+    databases: [0] # 要使用的库,会根据此处填写的库生成redisTemplate
+    timeout: 60s
+    lettuce: # lettuce基于netty,线程安全,支持并发
+      pool:
+        max-active: 50
+        max-wait: -1ms
+        max-idle: 8
+        min-idle: 0
+  cache:
+    type: Simple
+timeseries:
+  db-type: redis
+#taoscz场站数据 数据连接方式分为两种 JDBC-JNI和JDBC-RESTful
+#JDBC-JNI方式驱动为com.taosdata.jdbc.TSDBDriver 端口为6030
+#JDBC-RESTful方式驱动为com.taosdata.jdbc.rs.RestfulDriver 端口为6041
+taoscz:
+#  server_ip: 192.168.1.252
+#  server_port: 6030
+#  db_name: hnj_fdc
+#  user_name: root
+#  password: taosdata
+#  pool_size: 10
+#  max_pool_size: 100
+#  driver_type: com.taosdata.jdbc.TSDBDriver
+
+#  server_ip: 123.60.219.66
+#  server_port: 6041
+#  db_name: hnj_fdc
+#  user_name: root
+#  password: taosdata
+#  pool_size: 10
+#  max_pool_size: 100
+#  driver_type: com.taosdata.jdbc.rs.RestfulDriver
+
+  server_ip: 192.168.1.67
+  server_port: 6041
+  db_name: gdnxxny
+  user_name: root
+  password: taosdata
+  pool_size: 10
+  max_pool_size: 100
+  driver_type: com.taosdata.jdbc.rs.RestfulDriver
+
+#是否缓存所有风机测点
+isLoadAllTag: false
+
+redis:
+  host: 18.6.30.75
+  port: 6379
+  password: 123456
+
+

+ 35 - 13
transport/redis2taos/src/main/resources/application.yaml

@@ -1,6 +1,7 @@
 server:
   port: 8085
-  connection-timeout: 3000
+  tomcat:
+    connection-timeout: 3000
 
 spring:
   application:
@@ -11,15 +12,16 @@ spring:
     type: SIMPLE
   datasource:
     # -------------------------1区mysql/2区oracle---------------------------------------
-    #    driver-class-name: oracle.jdbc.OracleDriver
-    #    url: jdbc:oracle:thin:@123.60.213.70:1521:gdnxfd
-    #    username: nxfdprod
-    #    password: gdnxfd123
+    driver-class-name: oracle.jdbc.OracleDriver
+    #url: jdbc:oracle:thin:@123.60.213.70:1521:gdnxfd
+    url: jdbc:oracle:thin:@192.168.1.105:1521:gdnxfd
+    username: nxfdprod
+    password: gdnxfd123
     # ----------------------------------------------------------------
-    driver-class-name: com.mysql.jdbc.Driver
-    url: jdbc:mysql://192.168.1.252/wisdom_cs?useUnicode=true&characterEncoding=UTF-8
-    username: root
-    password: 123456
+#    driver-class-name: com.mysql.jdbc.Driver
+#    url: jdbc:mysql://192.168.1.252/wisdom_cs?useUnicode=true&characterEncoding=UTF-8
+#    username: root
+#    password: 123456
     # ----------------------------------------------------------------
     type: com.alibaba.druid.pool.DruidDataSource
     druid:
@@ -32,6 +34,8 @@ spring:
       test-while-idle: true
       test-on-borrow: false
       test-on-return: false
+  profiles:
+    active: xnj
 
 knife4j:
   redis:
@@ -56,14 +60,32 @@ timeseries:
 #JDBC-JNI方式驱动为com.taosdata.jdbc.TSDBDriver 端口为6030
 #JDBC-RESTful方式驱动为com.taosdata.jdbc.rs.RestfulDriver 端口为6041
 taoscz:
-  server_ip: 192.168.1.252
-  server_port: 6030
-  db_name: hnj_fdc
+#  server_ip: 192.168.1.252
+#  server_port: 6030
+#  db_name: hnj_fdc
+#  user_name: root
+#  password: taosdata
+#  pool_size: 10
+#  max_pool_size: 100
+#  driver_type: com.taosdata.jdbc.TSDBDriver
+
+#  server_ip: 123.60.219.66
+#  server_port: 6041
+#  db_name: hnj_fdc
+#  user_name: root
+#  password: taosdata
+#  pool_size: 10
+#  max_pool_size: 100
+#  driver_type: com.taosdata.jdbc.rs.RestfulDriver
+
+  server_ip: 192.168.1.67
+  server_port: 6041
+  db_name: gdnxxny
   user_name: root
   password: taosdata
   pool_size: 10
   max_pool_size: 100
-  driver_type: com.taosdata.jdbc.TSDBDriver
+  driver_type: com.taosdata.jdbc.rs.RestfulDriver
 
 #是否缓存所有风机测点
 isLoadAllTag: true