Browse Source

数据中心查询接口

xieshengjie 3 years ago
parent
commit
a51be490bd
79 changed files with 5199 additions and 0 deletions
  1. 20 0
      common/src/main/java/com/gyee/common/vo/datacenter/ParameterComparisonVo.java
  2. 19 0
      common/src/main/java/com/gyee/common/vo/datacenter/PointDataVo.java
  3. 16 0
      common/src/main/java/com/gyee/common/vo/datacenter/RealExport.java
  4. BIN
      common/target/common-1.0-SNAPSHOT.jar
  5. 2 0
      common/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  6. BIN
      common/target/test-classes/com/gyee/common/CommonMainTest.class
  7. 79 0
      web/datacenter-hb/pom.xml
  8. 19 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/DatacenterMain.java
  9. 26 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/config/CorsConfig.java
  10. 151 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/config/GeneratorCodeConfig.java
  11. 23 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/config/MybatisPlusConfig.java
  12. 71 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/config/R.java
  13. 12 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/config/ResultCode.java
  14. 111 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/controller/DataqueryController.java
  15. 20 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/controller/auto/DatacenterController.java
  16. 20 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/controller/auto/DatacenterpointController.java
  17. 20 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/controller/auto/WindpowerstationtestingpointController.java
  18. 20 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/controller/auto/WindturbinetestingpointaiController.java
  19. 59 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/init/CacheContext.java
  20. 16 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/mapper/auto/DatacenterMapper.java
  21. 16 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/mapper/auto/DatacenterpointMapper.java
  22. 16 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/mapper/auto/WindpowerstationtestingpointMapper.java
  23. 16 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/mapper/auto/WindturbinetestingpointaiMapper.java
  24. 51 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/model/auto/Datacenter.java
  25. 51 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/model/auto/Datacenterpoint.java
  26. 75 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/model/auto/Windpowerstationtestingpoint.java
  27. 81 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/model/auto/Windturbinetestingpointai.java
  28. 129 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/service/DataqueryService.java
  29. 16 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/service/auto/IDatacenterService.java
  30. 16 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/service/auto/IDatacenterpointService.java
  31. 16 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/service/auto/IWindpowerstationtestingpointService.java
  32. 16 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/service/auto/IWindturbinetestingpointaiService.java
  33. 20 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/service/auto/impl/DatacenterServiceImpl.java
  34. 20 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/service/auto/impl/DatacenterpointServiceImpl.java
  35. 20 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/service/auto/impl/WindpowerstationtestingpointServiceImpl.java
  36. 20 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/service/auto/impl/WindturbinetestingpointaiServiceImpl.java
  37. 51 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/PageUtil.java
  38. 48 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/ApiGolden.java
  39. 1267 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/EdosUtil.java
  40. 27 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/GoldenConfig.java
  41. 172 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/HttpClientUtil.java
  42. 234 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/IEdosUtil.java
  43. 791 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/MongoEdosUtil.java
  44. 34 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/StringUtil.java
  45. 28 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/BaseTsQuery.java
  46. 38 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/BasicTsData.java
  47. 29 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/BasicTsPoint.java
  48. 24 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/BlobTsData.java
  49. 22 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/BlobWriteTsData.java
  50. 24 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/BooleanTsData.java
  51. 19 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/BooleanWriteTsData.java
  52. 18 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/Coordinate.java
  53. 26 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/CoordinateTsData.java
  54. 21 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/CoordinateWriteTsData.java
  55. 30 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/DoubleStatData.java
  56. 25 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/DoubleTsData.java
  57. 19 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/DoubleWriteTsData.java
  58. 38 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/ErrorRequest.java
  59. 27 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/GeneralTsData.java
  60. 8 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/Interpolation.java
  61. 206 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/JsonObjectHelper.java
  62. 24 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/LongTsData.java
  63. 20 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/LongWriteTsData.java
  64. 24 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/StringTsData.java
  65. 34 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/StringUtil.java
  66. 20 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/StringWriteTsData.java
  67. 15 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/TsData.java
  68. 15 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/TsDataType.java
  69. 12 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/TsPoint.java
  70. 36 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/TsPointData.java
  71. 23 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/TsPointDataList.java
  72. 17 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/TsQuery.java
  73. 44 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/redis/RedisAutoConfiguration.java
  74. 47 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/redis/RedisConfig.java
  75. 49 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/redis/RedisService.java
  76. 124 0
      web/datacenter-hb/src/main/java/com/gyee/datacenter/util/redis/RedisServiceImpl.java
  77. 91 0
      web/datacenter-hb/src/main/resources/application-dev.yml
  78. 91 0
      web/datacenter-hb/src/main/resources/application-test.yml
  79. 4 0
      web/datacenter-hb/src/main/resources/application.yml

+ 20 - 0
common/src/main/java/com/gyee/common/vo/datacenter/ParameterComparisonVo.java

@@ -0,0 +1,20 @@
+package com.gyee.common.vo.datacenter;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @ClassName : ParameterComparisonVo
+ * @Author : xieshengjie
+ * @Date: 2021/5/26 10:46
+ * @Description : 参数对比英文
+ */
+@Data
+public class ParameterComparisonVo {
+
+    private String wtid;
+    private Date time;
+    private String tagetName;
+    private Double value;
+}

+ 19 - 0
common/src/main/java/com/gyee/common/vo/datacenter/PointDataVo.java

@@ -0,0 +1,19 @@
+package com.gyee.common.vo.datacenter;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @ClassName : PointDataVo
+ * @Author : xieshengjie
+ * @Date: 2021/5/13 16:46
+ * @Description : 返回信息vo
+ */
+@Data
+public class PointDataVo {
+    private String pointId;
+    private String pointName;
+    private Double value;
+    private Date time;
+}

+ 16 - 0
common/src/main/java/com/gyee/common/vo/datacenter/RealExport.java

@@ -0,0 +1,16 @@
+package com.gyee.common.vo.datacenter;
+
+import lombok.Data;
+
+
+/**
+ * @ClassName : RealExport
+ * @Author : xieshengjie
+ * @Date: 2021/5/18 10:58
+ * @Description : 实时导出vo
+ */
+@Data
+public class RealExport {
+    private String id;
+    private String name;
+}

BIN
common/target/common-1.0-SNAPSHOT.jar


+ 2 - 0
common/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

@@ -25,9 +25,11 @@ com\gyee\common\vo\specific\SpecificTopVo.class
 com\gyee\common\vo\threerate\QxjslVo.class
 com\gyee\common\vo\analysis\AnalsisUpdateVo.class
 com\gyee\common\util\RandomUtil.class
+com\gyee\common\vo\datacenter\PointDataVo.class
 com\gyee\common\vo\analysis\BdzVo.class
 com\gyee\common\vo\benchmark\ValueVo.class
 com\gyee\common\vo\benchmark\WxsslVo.class
+com\gyee\common\vo\datacenter\ParameterComparisonVo.class
 com\gyee\common\model\Convert.class
 com\gyee\common\vo\specific\SpecificTargetVo.class
 com\gyee\common\util\DateUtils.class

BIN
common/target/test-classes/com/gyee/common/CommonMainTest.class


+ 79 - 0
web/datacenter-hb/pom.xml

@@ -11,5 +11,84 @@
 
     <artifactId>datacenter-hb</artifactId>
 
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-generator</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.freemarker</groupId>
+            <artifactId>freemarker</artifactId>
+            <version>2.3.28</version>
+        </dependency>
+        <!--mysql-connector-java-->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.oracle</groupId>
+            <artifactId>ojdbc6</artifactId>
+            <version>11.2.0.3</version>
+        </dependency>
+        <dependency>
+            <groupId>com.gyee</groupId>
+            <artifactId>common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.17</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <version>3.1</version>
+            <scope>compile</scope>
+        </dependency>
 
+
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 </project>

+ 19 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/DatacenterMain.java

@@ -0,0 +1,19 @@
+package com.gyee.datacenter;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+/**
+ * @ClassName : DatacenterMain
+ * @Author : xieshengjie
+ * @Date: 2022/2/21 17:39
+ * @Description :
+ */
+@SpringBootApplication
+@MapperScan("com.gyee.datacenter.mapper")
+public class DatacenterMain {
+    public static void main(String[] args) {
+        SpringApplication.run(DatacenterMain.class,args);
+    }
+}

+ 26 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/config/CorsConfig.java

@@ -0,0 +1,26 @@
+package com.gyee.datacenter.config;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+/**
+ * @ClassName : CorsConfig
+ * @Author : xieshengjie
+ * @Date: 2021/6/28 20:00
+ * @Description :
+ */
+@Configuration
+public class CorsConfig implements WebMvcConfigurer {
+
+    static final String[] ORIGINS = new String[]{"GET", "POST", "PUT", "DELETE"};  //请求方式
+
+    @Override
+    public void addCorsMappings(CorsRegistry registry) {
+        registry.addMapping("/**") //所有的当前站点的请求地址,都支持跨域访问
+                .allowedOrigins("*")// 所有的外部域都可跨域访问,这里注意2.4.0以后是allowedOriginPatterns,以前是allowedOrigins
+                .allowCredentials(true)  //是否支持跨域用户凭证
+                .allowedMethods(ORIGINS) //当前站点支持的跨域请求类型是什么
+                .maxAge(3600);  //超是时长,单位为秒。
+    }
+}

+ 151 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/config/GeneratorCodeConfig.java

@@ -0,0 +1,151 @@
+package com.gyee.datacenter.config;
+
+
+import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.generator.AutoGenerator;
+import com.baomidou.mybatisplus.generator.config.*;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
+
+import java.util.Scanner;
+
+/**
+ *@ClassName GeneratorCodeConfig
+ *@Description 自动生成mybatisplus的相关代码
+ *@Author 谢生杰
+ *@Date 2020/9/25 18:26
+ *@Version 1.0
+ **/
+public class GeneratorCodeConfig {
+    public static String scanner(String tip) {
+        Scanner scanner = new Scanner(System.in);
+        StringBuilder help = new StringBuilder();
+        help.append("请输入" + tip + ":");
+        System.out.println(help.toString());
+        if (scanner.hasNext()) {
+            String ipt = scanner.next();
+            if (StringUtils.isNotEmpty(ipt)) {
+                return ipt;
+            }
+        }
+        throw new MybatisPlusException("请输入正确的" + tip + "!");
+    }
+
+    public static void main(String[] args) {
+        // 代码生成器
+        AutoGenerator mpg = new AutoGenerator();
+
+        // 全局配置
+        GlobalConfig gc = new GlobalConfig();
+        String projectPath = System.getProperty("user.dir");
+        gc.setOutputDir(projectPath + "/src/main/java");
+        gc.setAuthor("谢生杰");
+        gc.setOpen(false);
+        //实体属性 Swagger2 注解
+        gc.setSwagger2(false);
+        mpg.setGlobalConfig(gc);
+
+        // 数据源配置
+        DataSourceConfig dsc = new DataSourceConfig();
+
+//        dsc.setUrl("jdbc:mysql://127.0.0.1:3306/test?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true");
+//        dsc.setDriverName("com.mysql.jdbc.Driver");
+//        dsc.setUsername("root");
+//        dsc.setPassword("root");
+//        mpg.setDataSource(dsc);
+
+        dsc.setDriverName("oracle.jdbc.driver.OracleDriver");
+        dsc.setUsername("gdprod");
+        dsc.setPassword("gd123");
+//        dsc.setUrl("jdbc:oracle:thin:@49.4.50.80:1521:gdnxfd");
+        dsc.setUrl("jdbc:oracle:thin:@10.83.68.165:1521:gdsj");
+        mpg.setDataSource(dsc);
+
+//        dsc.setDriverName("com.cloudera.impala.jdbc41.Driver");
+//        dsc.setUrl("jdbc:impala://192.168.1.67:21050/gyee_test");
+//        mpg.setDataSource(dsc);
+
+
+
+        // 包配置
+        PackageConfig pc = new PackageConfig();
+//        pc.setModuleName(scanner("模块名"));
+        pc.setParent("com.gyee.datacenter");
+        pc.setEntity("model.auto");
+        pc.setMapper("mapper.auto");
+        pc.setService("service.auto");
+        pc.setServiceImpl("service.auto.impl");
+        pc.setController("controller.auto");
+        mpg.setPackageInfo(pc);
+
+        // 自定义配置
+//        InjectionConfig cfg = new InjectionConfig() {
+//            @Override
+//            public void initMap() {
+//                // to do nothing
+//            }
+//        };
+
+        // 如果模板引擎是 freemarker
+//        String templatePath = "/templates/mapper.xml.ftl";
+        // 如果模板引擎是 velocity
+        // String templatePath = "/templates/mapper.xml.vm";
+
+        // 自定义输出配置
+//        List<FileOutConfig> focList = new ArrayList<>();
+        // 自定义配置会被优先输出
+//        focList.add(new FileOutConfig(templatePath) {
+//            @Override
+//            public String outputFile(TableInfo tableInfo) {
+//                // 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
+//                return projectPath + "/src/main/resources/mapper/" + pc.getModuleName()
+//                        + "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
+//            }
+//        });
+        /*
+        cfg.setFileCreate(new IFileCreate() {
+            @Override
+            public boolean isCreate(ConfigBuilder configBuilder, FileType fileType, String filePath) {
+                // 判断自定义文件夹是否需要创建
+                checkDir("调用默认方法创建的目录");
+                return false;
+            }
+        });
+        */
+//        cfg.setFileOutConfigList(focList);
+//        mpg.setCfg(cfg);
+
+        // 配置模板
+        TemplateConfig templateConfig = new TemplateConfig();
+
+        // 配置自定义输出模板
+        //指定自定义模板路径,注意不要带上.ftl/.vm, 会根据使用的模板引擎自动识别
+        // templateConfig.setEntity("templates/entity2.java");
+        // templateConfig.setService();
+        // templateConfig.setController();
+
+        templateConfig.setXml(null);
+        mpg.setTemplate(templateConfig);
+
+        // 策略配置
+        StrategyConfig strategy = new StrategyConfig();
+        strategy.setNaming(NamingStrategy.underline_to_camel);
+        strategy.setColumnNaming(NamingStrategy.underline_to_camel);
+        strategy.setSuperEntityClass("com.baomidou.mybatisplus.extension.activerecord.Model");
+        strategy.setEntityLombokModel(true);
+        strategy.setRestControllerStyle(true);
+
+        strategy.setEntityLombokModel(true);
+        // 公共父类
+//        strategy.setSuperControllerClass("com.baomidou.ant.common.BaseController");
+        // 写于父类中的公共字段
+//        strategy.setSuperEntityColumns("id");
+        strategy.setInclude(scanner("表名,多个英文逗号分割").split(","));
+        strategy.setControllerMappingHyphenStyle(true);
+        strategy.setTablePrefix(pc.getModuleName() + "_");
+        mpg.setStrategy(strategy);
+        mpg.setTemplateEngine(new FreemarkerTemplateEngine());
+        mpg.execute();
+    }
+}

+ 23 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/config/MybatisPlusConfig.java

@@ -0,0 +1,23 @@
+package com.gyee.datacenter.config;
+
+import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ *@ClassName MybatisPlusConfig
+ *@Description 配置分页插件
+ *@Author 谢生杰
+ *@Date 2020/9/25 18:24
+ *@Version 1.0
+ **/
+@Configuration
+public class MybatisPlusConfig {
+    /**
+     * 分页插件
+     */
+    @Bean
+    public PaginationInterceptor paginationInterceptor() {
+        return new PaginationInterceptor();
+    }
+}

+ 71 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/config/R.java

@@ -0,0 +1,71 @@
+package com.gyee.datacenter.config;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @ClassName : R
+ * @Author : xieshengjie
+ * @Date: 2021/5/16 16:59
+ * @Description : 结果集
+ */
+@Data
+public class R {
+    @ApiModelProperty(value = "是否成功")
+    private Boolean success;
+    @ApiModelProperty(value = "返回码")
+    private Integer code;
+    @ApiModelProperty(value = "返回消息")
+    private String message;
+    @ApiModelProperty(value = "总数量")
+    private Integer count;
+    @ApiModelProperty(value = "返回数据")
+    private Object data = new Object();
+    private R(){}
+    public static R ok(){
+        R r = new R();
+        r.setSuccess(true);
+        r.setCode(ResultCode.SUCCESS);
+        r.setMessage("成功");
+        return r;
+    }
+    public static R ok(Integer count){
+        R r = new R();
+        r.setSuccess(true);
+        r.setCode(ResultCode.SUCCESS);
+        r.setMessage("成功");
+        r.setCount(count);
+        return r;
+    }
+    public static R error(){
+        R r = new R();
+        r.setSuccess(false);
+        r.setCode(ResultCode.ERROR);
+        r.setMessage("失败");
+        return r;
+    }
+    public R success(Boolean success){
+        this.setSuccess(success);
+        return this;
+    }
+    public R message(String message){
+        this.setMessage(message);
+        return this;
+    }
+    public R code(Integer code){
+        this.setCode(code);
+        return this;
+    }
+//    public R data(String key, Object value){
+//        this.data.put(key, value);
+//        return this;
+//    }
+//    public R data(Map<String, Object> map){
+//        this.setData(map);
+//        return this;
+//    }
+    public R data(Object value){
+        this.setData(value);
+        return this;
+    }
+}

+ 12 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/config/ResultCode.java

@@ -0,0 +1,12 @@
+package com.gyee.datacenter.config;
+
+/**
+ * @ClassName : ResultCode
+ * @Author : xieshengjie
+ * @Date: 2021/5/16 17:01
+ * @Description : 结果状态
+ */
+public class ResultCode {
+    public static Integer SUCCESS = 200;
+    public static Integer ERROR = 500;
+}

+ 111 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/controller/DataqueryController.java

@@ -0,0 +1,111 @@
+package com.gyee.datacenter.controller;
+
+import com.gyee.common.model.StringUtils;
+import com.gyee.common.vo.datacenter.PointDataVo;
+import com.gyee.common.vo.datacenter.RealExport;
+import com.gyee.datacenter.config.R;
+import com.gyee.datacenter.model.auto.Datacenter;
+import com.gyee.datacenter.model.auto.Datacenterpoint;
+import com.gyee.datacenter.service.DataqueryService;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @ClassName : DatacenterController
+ * @Author : xieshengjie
+ * @Date: 2022/2/21 17:45
+ * @Description :
+ */
+@RestController
+@RequestMapping("//dataquery")
+public class DataqueryController {
+    @Resource
+    private DataqueryService dataqueryService;
+
+    /**
+     * 获取所有表名
+     * @return
+     */
+    @GetMapping("/tables")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R getTables(){
+        List<Datacenter> tables = dataqueryService.getTables();
+        if (StringUtils.isNotNull(tables)) {
+            return R.ok(tables.size()).data(tables);
+        }else{
+            return R.error().message("访问失败");
+        }
+    }
+
+    /**
+     * 根据表名点名查询数据
+     * @param tableid
+     * @param pointId
+     * @return
+     */
+    @GetMapping("/realtimeData")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R getRealtimedata(@RequestParam(value = "tableid",required = true)String tableid,
+                             @RequestParam(value = "pointId",required = false)String pointId,
+                             @RequestParam(value = "pointName",required = false)String pointName,
+                             @RequestParam(value = "pageNum",required = true)String pageNum,
+                             @RequestParam(value = "pageSize",required = true)String pageSize) {
+        List<Datacenterpoint> realtimeList = dataqueryService.getRealtimeList(tableid, pointId, pointName);
+        List<PointDataVo> vos = new ArrayList<>();
+        if(StringUtils.isNotNull(realtimeList) && StringUtils.isNotEmpty(realtimeList)){
+            vos = dataqueryService.getRealtimedata(realtimeList,pageNum,pageSize);
+        }
+        if (StringUtils.isNotNull(vos)) {
+            return R.ok(vos.size()).data(vos);
+        }else {
+            return R.error().data("访问失败");
+        }
+    }
+
+    /**
+     * 根据点名查询历史数据
+     * @param pointId
+     * @param begin
+     * @param end
+     * @param interval
+     * @return
+     */
+    @GetMapping("/historyData")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R gethistoryData(@RequestParam(value = "pointId",required = true)String pointId,
+                            @RequestParam(value = "begin",required = true)String begin,
+                            @RequestParam(value = "end",required = true)String end,
+                            @RequestParam(value = "interval",required = false)String interval,
+                            @RequestParam(value = "type",required = false)String type) {
+        List<PointDataVo> vos = dataqueryService.gethistoryData(pointId,begin,end,interval,type);
+        if (StringUtils.isNotNull(vos)) {
+            return R.ok(vos.size()).data(vos);
+        }else {
+            return R.error().message("访问失败");
+        }
+    }
+
+    @GetMapping("/realtimeExport")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R realtimeExport(@RequestParam(value = "tableid",required = true)String tableid,
+                            @RequestParam(value = "pointId",required = false)String pointId,
+                            @RequestParam(value = "pointName",required = false)String pointName, HttpServletResponse response) throws IOException {
+
+        List<RealExport> list = dataqueryService.getRealtimeExport(tableid,pointId,pointName);
+        if (StringUtils.isNotNull(list)) {
+            return R.ok(list.size()).data(list);
+        }else {
+            return R.error().data("访问失败");
+        }
+    }
+
+}

+ 20 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/controller/auto/DatacenterController.java

@@ -0,0 +1,20 @@
+package com.gyee.datacenter.controller.auto;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-02-21
+ */
+@RestController
+@RequestMapping("//datacenter")
+public class DatacenterController {
+
+}

+ 20 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/controller/auto/DatacenterpointController.java

@@ -0,0 +1,20 @@
+package com.gyee.datacenter.controller.auto;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-02-21
+ */
+@RestController
+@RequestMapping("//datacenterpoint")
+public class DatacenterpointController {
+
+}

+ 20 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/controller/auto/WindpowerstationtestingpointController.java

@@ -0,0 +1,20 @@
+package com.gyee.datacenter.controller.auto;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-02-21
+ */
+@RestController
+@RequestMapping("//windpowerstationtestingpoint")
+public class WindpowerstationtestingpointController {
+
+}

+ 20 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/controller/auto/WindturbinetestingpointaiController.java

@@ -0,0 +1,20 @@
+package com.gyee.datacenter.controller.auto;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-02-21
+ */
+@RestController
+@RequestMapping("//windturbinetestingpointai")
+public class WindturbinetestingpointaiController {
+
+}

+ 59 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/init/CacheContext.java

@@ -0,0 +1,59 @@
+package com.gyee.datacenter.init;
+
+import com.gyee.common.model.StringUtils;
+import com.gyee.common.util.JSONUtil;
+import com.gyee.datacenter.model.auto.Datacenter;
+import com.gyee.datacenter.model.auto.Datacenterpoint;
+import com.gyee.datacenter.service.auto.IDatacenterService;
+import com.gyee.datacenter.util.redis.RedisService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.CommandLineRunner;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : CacheContext
+ * @Author : xieshengjie
+ * @Date: 2022/2/21 18:20
+ * @Description :
+ */
+@Component
+public class CacheContext  implements CommandLineRunner {
+    private static final Logger log = LoggerFactory.getLogger(CacheContext.class);
+
+    @Resource
+    private RedisService redisService;
+
+    @Resource
+    private IDatacenterService datacenterService;
+
+    public static List<Datacenter> tableList = new ArrayList<>();
+    public static Map<String, List<Datacenterpoint>> pointmap = new HashMap<>();
+    public static Map<String,String> inmap = new HashMap<>();
+
+    @Override
+    public void run(String... args) throws Exception {
+        log.info("-------------------------------缓存开始--------------------------------------");
+
+        tableList = datacenterService.list();
+
+        tableList.stream().forEach(i->{
+            List<Datacenterpoint> realtimedataList = JSONUtil.jsonToList(redisService.get(i.getTableid()), Datacenterpoint.class);
+            if(StringUtils.isNotNull(realtimedataList)){
+                pointmap.put(i.getTableid(),realtimedataList);
+                realtimedataList.stream().forEach(x->{
+                    inmap.put(x.getId(),x.getName());
+                });
+            }
+        });
+
+        log.info("-------------------------------缓存结束--------------------------------------");
+    }
+}

+ 16 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/mapper/auto/DatacenterMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.datacenter.mapper.auto;
+
+import com.gyee.datacenter.model.auto.Datacenter;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-02-21
+ */
+public interface DatacenterMapper extends BaseMapper<Datacenter> {
+
+}

+ 16 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/mapper/auto/DatacenterpointMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.datacenter.mapper.auto;
+
+import com.gyee.datacenter.model.auto.Datacenterpoint;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-02-21
+ */
+public interface DatacenterpointMapper extends BaseMapper<Datacenterpoint> {
+
+}

+ 16 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/mapper/auto/WindpowerstationtestingpointMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.datacenter.mapper.auto;
+
+import com.gyee.datacenter.model.auto.Windpowerstationtestingpoint;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-02-21
+ */
+public interface WindpowerstationtestingpointMapper extends BaseMapper<Windpowerstationtestingpoint> {
+
+}

+ 16 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/mapper/auto/WindturbinetestingpointaiMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.datacenter.mapper.auto;
+
+import com.gyee.datacenter.model.auto.Windturbinetestingpointai;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-02-21
+ */
+public interface WindturbinetestingpointaiMapper extends BaseMapper<Windturbinetestingpointai> {
+
+}

+ 51 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/model/auto/Datacenter.java

@@ -0,0 +1,51 @@
+package com.gyee.datacenter.model.auto;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-02-21
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("DATACENTER")
+public class Datacenter extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId("ID")
+    private Long id;
+
+    @TableField("TABLEID")
+    private String tableid;
+
+    @TableField("TABLENAME")
+    private String tablename;
+
+    @TableField("WINDPOWERSTATIONID")
+    private String windpowerstationid;
+
+    @TableField("ORDERNO")
+    private Integer orderno;
+
+    @TableField("SPARE1")
+    private String spare1;
+
+    @TableField("SPARE2")
+    private String spare2;
+
+    @TableField("SPARE3")
+    private String spare3;
+
+
+}

+ 51 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/model/auto/Datacenterpoint.java

@@ -0,0 +1,51 @@
+package com.gyee.datacenter.model.auto;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-02-21
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("DATACENTERPOINT")
+public class Datacenterpoint extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId("ID")
+    private String id;
+
+    @TableField("NAME")
+    private String name;
+
+    @TableField("TID")
+    private String tid;
+
+    @TableField("AIORDI")
+    private String aiordi;
+
+    @TableField("ORDERNO")
+    private Integer orderno;
+
+    @TableField("SPARE1")
+    private String spare1;
+
+    @TableField("SPARE2")
+    private String spare2;
+
+    @TableField("SPARE3")
+    private String spare3;
+
+
+}

+ 75 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/model/auto/Windpowerstationtestingpoint.java

@@ -0,0 +1,75 @@
+package com.gyee.datacenter.model.auto;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-02-21
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("WINDPOWERSTATIONTESTINGPOINT")
+public class Windpowerstationtestingpoint extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId("CODE")
+    private String code;
+
+    @TableField("NAME")
+    private String name;
+
+    @TableField("MODEL")
+    private String model;
+
+    @TableField("VALUEUNIT")
+    private String valueunit;
+
+    @TableField("ENGLISHNAME")
+    private String englishname;
+
+    @TableField("TYPEID")
+    private String typeid;
+
+    @TableField("MODELID")
+    private String modelid;
+
+    @TableField("MAXVAL")
+    private Double maxval;
+
+    @TableField("MINVAL")
+    private Double minval;
+
+    @TableField("REASONABLEMAXVAL")
+    private Double reasonablemaxval;
+
+    @TableField("REASONABLEMINVAL")
+    private Double reasonableminval;
+
+    @TableField("UNIFORMCODE")
+    private String uniformcode;
+
+    @TableField("SHORTID")
+    private String shortid;
+
+    @TableField("LONGID")
+    private String longid;
+
+    @TableField("WINDPOWERSTATIONID")
+    private String windpowerstationid;
+
+    @TableField("REALTIMEID")
+    private String realtimeid;
+
+
+}

+ 81 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/model/auto/Windturbinetestingpointai.java

@@ -0,0 +1,81 @@
+package com.gyee.datacenter.model.auto;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-02-21
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("WINDTURBINETESTINGPOINTAI")
+public class Windturbinetestingpointai extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId("ID")
+    private String id;
+
+    @TableField("CODE")
+    private String code;
+
+    @TableField("NAME")
+    private String name;
+
+    @TableField("MODEL")
+    private String model;
+
+    @TableField("VALUEUNIT")
+    private String valueunit;
+
+    @TableField("ENGLISHNAME")
+    private String englishname;
+
+    @TableField("TYPEID")
+    private String typeid;
+
+    @TableField("MODELID")
+    private String modelid;
+
+    @TableField("MAXVAL")
+    private Double maxval;
+
+    @TableField("MINVAL")
+    private Double minval;
+
+    @TableField("REASONABLEMAXVAL")
+    private Double reasonablemaxval;
+
+    @TableField("REASONABLEMINVAL")
+    private Double reasonableminval;
+
+    @TableField("WINDTURBINEID")
+    private String windturbineid;
+
+    @TableField("UNIFORMCODE")
+    private String uniformcode;
+
+    @TableField("SHORTID")
+    private String shortid;
+
+    @TableField("LONGID")
+    private String longid;
+
+    @TableField("WINDPOWERSTATIONID")
+    private String windpowerstationid;
+
+    @TableField("REALTIMEID")
+    private String realtimeid;
+
+
+}

+ 129 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/service/DataqueryService.java

@@ -0,0 +1,129 @@
+package com.gyee.datacenter.service;
+
+import com.gyee.common.model.PointData;
+import com.gyee.common.model.StringUtils;
+import com.gyee.common.util.DateUtils;
+import com.gyee.common.vo.datacenter.PointDataVo;
+import com.gyee.common.vo.datacenter.RealExport;
+import com.gyee.datacenter.init.CacheContext;
+import com.gyee.datacenter.model.auto.Datacenter;
+import com.gyee.datacenter.model.auto.Datacenterpoint;
+import com.gyee.datacenter.util.PageUtil;
+import com.gyee.datacenter.util.realtimesource.EdosUtil;
+import com.gyee.datacenter.util.realtimesource.IEdosUtil;
+import com.gyee.datacenter.util.realtimesource.MongoEdosUtil;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @ClassName : DatacenterService
+ * @Author : xieshengjie
+ * @Date: 2022/2/21 17:46
+ * @Description :
+ */
+@Service
+public class DataqueryService {
+
+    private IEdosUtil edosUtil = new EdosUtil();
+    public List<Datacenter> getTables() {
+        return CacheContext.tableList;
+    }
+
+
+    public List<Datacenterpoint> getRealtimeList(String tableid, String pointId, String pointName) {
+        Map<String, List<Datacenterpoint>> pointmap = CacheContext.pointmap;
+        List<Datacenterpoint> realtimedataList = pointmap.get(tableid);
+        if (StringUtils.isNotEmpty(pointId)) {
+            realtimedataList = realtimedataList.stream().filter(i -> i.getId().contains(pointId)).collect(Collectors.toList());
+        }
+        if (StringUtils.isNotEmpty(pointName)) {
+            realtimedataList = realtimedataList.stream().filter(i -> i.getName().contains(pointName)).collect(Collectors.toList());
+        }
+        return realtimedataList;
+    }
+
+    public List<RealExport> getRealtimeExport(String tableid, String pointId, String pointName) {
+        List<RealExport> resultList = new ArrayList<>();
+
+        List<Datacenterpoint> realtimedataList = getRealtimeList(tableid, pointId, pointName);
+        realtimedataList.stream().forEach(i->{
+            RealExport re = new RealExport();
+            re.setId(i.getId());
+            re.setName(i.getName());
+            resultList.add(re);
+        });
+        return resultList;
+    }
+
+    public List<PointDataVo> getRealtimedata(List<Datacenterpoint> realtimedataList,String pageNum,String pageSize) {
+
+        List<PointDataVo> resultList = new ArrayList<>();
+        realtimedataList = PageUtil.startPage(realtimedataList,Integer.parseInt(pageNum),Integer.parseInt(pageSize));
+//        realtimedataList = realtimedataList.stream().limit(200).collect(Collectors.toList());
+        List<String> pointIdList = realtimedataList.stream().map(i -> i.getId()).collect(Collectors.toList());
+
+        List<PointData> realDatas = null;
+        try {
+            if (StringUtils.isNotEmpty(pointIdList)){
+                realDatas  = edosUtil.getRealData(pointIdList);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        if (StringUtils.isNotEmpty(realDatas)) {
+            realDatas.stream().filter(pointData -> pointData.getPointTime()!=null).forEach(pointData -> {
+                PointDataVo vo = new PointDataVo();
+                vo.setPointId(pointData.getEdnaId());
+                vo.setPointName(CacheContext.inmap.get(vo.getPointId()));
+                vo.setValue(pointData.getPointValueInDouble());
+                vo.setTime(DateUtils.parseLongToDate(pointData.getPointTime()));
+                resultList.add(vo);
+            });
+        }
+        return resultList;
+    }
+
+
+    public List<PointDataVo> gethistoryData(String pointId, String begin, String end, String interval,String type) {
+
+        List<PointDataVo> resultList = new ArrayList<>();
+        Date beginDate = DateUtils.parseDate1(begin);
+        Date endDate = DateUtils.parseDate1(end);
+        List<PointData> pointDatas = null;
+
+        try {
+            if (interval != null) {
+                if (type!=null){
+                    pointDatas = edosUtil.getHistStat(pointId,beginDate.getTime()/1000, endDate.getTime()/1000,null,Long.parseLong(interval),Integer.parseInt(type));
+                }else{
+                    pointDatas = edosUtil.getHistoryDatasSnap(pointId,beginDate.getTime()/1000, endDate.getTime()/1000,null,Long.parseLong(interval));
+                }
+//                pointDatas = edosUtil.getHistoryDatasSnap(pointId,beginDate.getTime()/1000, endDate.getTime()/1000,null,Long.parseLong(interval));
+//                pointDatas = PageUtil.startPage(pointDatas,Integer.parseInt(pageNum),Integer.parseInt(pageSize));
+            }else {
+                pointDatas = edosUtil.getHistoryDatasRaw(pointId, beginDate.getTime()/1000, endDate.getTime()/1000);
+//                pointDatas = PageUtil.startPage(edosUtil.getHistoryDatasRaw(pointId, beginDate.getTime()/1000, endDate.getTime()/1000),Integer.parseInt(pageNum),Integer.parseInt(pageSize));
+            }
+        }catch (Exception e) {
+            e.printStackTrace();
+        }
+        if (StringUtils.isNotEmpty(pointDatas)){
+            pointDatas.stream().forEach(pointData->{
+                PointDataVo vo = new PointDataVo();
+                vo.setPointId(pointData.getEdnaId());
+                vo.setPointName(CacheContext.inmap.get(vo.getPointId()));
+                vo.setValue(pointData.getPointValueInDouble());
+                vo.setTime(DateUtils.parseLongToDate(pointData.getPointTime()*1000));
+                resultList.add(vo);
+            });
+        }
+        return resultList;
+    }
+
+
+}

+ 16 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/service/auto/IDatacenterService.java

@@ -0,0 +1,16 @@
+package com.gyee.datacenter.service.auto;
+
+import com.gyee.datacenter.model.auto.Datacenter;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-02-21
+ */
+public interface IDatacenterService extends IService<Datacenter> {
+
+}

+ 16 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/service/auto/IDatacenterpointService.java

@@ -0,0 +1,16 @@
+package com.gyee.datacenter.service.auto;
+
+import com.gyee.datacenter.model.auto.Datacenterpoint;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-02-21
+ */
+public interface IDatacenterpointService extends IService<Datacenterpoint> {
+
+}

+ 16 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/service/auto/IWindpowerstationtestingpointService.java

@@ -0,0 +1,16 @@
+package com.gyee.datacenter.service.auto;
+
+import com.gyee.datacenter.model.auto.Windpowerstationtestingpoint;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-02-21
+ */
+public interface IWindpowerstationtestingpointService extends IService<Windpowerstationtestingpoint> {
+
+}

+ 16 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/service/auto/IWindturbinetestingpointaiService.java

@@ -0,0 +1,16 @@
+package com.gyee.datacenter.service.auto;
+
+import com.gyee.datacenter.model.auto.Windturbinetestingpointai;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-02-21
+ */
+public interface IWindturbinetestingpointaiService extends IService<Windturbinetestingpointai> {
+
+}

+ 20 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/service/auto/impl/DatacenterServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.datacenter.service.auto.impl;
+
+import com.gyee.datacenter.model.auto.Datacenter;
+import com.gyee.datacenter.mapper.auto.DatacenterMapper;
+import com.gyee.datacenter.service.auto.IDatacenterService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-02-21
+ */
+@Service
+public class DatacenterServiceImpl extends ServiceImpl<DatacenterMapper, Datacenter> implements IDatacenterService {
+
+}

+ 20 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/service/auto/impl/DatacenterpointServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.datacenter.service.auto.impl;
+
+import com.gyee.datacenter.model.auto.Datacenterpoint;
+import com.gyee.datacenter.mapper.auto.DatacenterpointMapper;
+import com.gyee.datacenter.service.auto.IDatacenterpointService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-02-21
+ */
+@Service
+public class DatacenterpointServiceImpl extends ServiceImpl<DatacenterpointMapper, Datacenterpoint> implements IDatacenterpointService {
+
+}

+ 20 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/service/auto/impl/WindpowerstationtestingpointServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.datacenter.service.auto.impl;
+
+import com.gyee.datacenter.model.auto.Windpowerstationtestingpoint;
+import com.gyee.datacenter.mapper.auto.WindpowerstationtestingpointMapper;
+import com.gyee.datacenter.service.auto.IWindpowerstationtestingpointService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-02-21
+ */
+@Service
+public class WindpowerstationtestingpointServiceImpl extends ServiceImpl<WindpowerstationtestingpointMapper, Windpowerstationtestingpoint> implements IWindpowerstationtestingpointService {
+
+}

+ 20 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/service/auto/impl/WindturbinetestingpointaiServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.datacenter.service.auto.impl;
+
+import com.gyee.datacenter.model.auto.Windturbinetestingpointai;
+import com.gyee.datacenter.mapper.auto.WindturbinetestingpointaiMapper;
+import com.gyee.datacenter.service.auto.IWindturbinetestingpointaiService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-02-21
+ */
+@Service
+public class WindturbinetestingpointaiServiceImpl extends ServiceImpl<WindturbinetestingpointaiMapper, Windturbinetestingpointai> implements IWindturbinetestingpointaiService {
+
+}

+ 51 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/PageUtil.java

@@ -0,0 +1,51 @@
+package com.gyee.datacenter.util;
+
+import java.util.List;
+
+/**
+ * @ClassName : PageUtil
+ * @Author : xieshengjie
+ * @Date: 2021/5/16 20:44
+ * @Description : 分页工具
+ */
+public class PageUtil {
+    /**
+     * 开始分页
+     * @param list
+     * @param pageNum 页码
+     * @param pageSize 每页多少条数据
+     * @return
+     */
+    public static List startPage(List list, Integer pageNum,
+                                 Integer pageSize) {
+        if (list == null) {
+            return null;
+        }
+        if (list.size() == 0) {
+            return null;
+        }
+
+        Integer count = list.size(); // 记录总数
+        Integer pageCount = 0; // 页数
+        if (count % pageSize == 0) {
+            pageCount = count / pageSize;
+        } else {
+            pageCount = count / pageSize + 1;
+        }
+
+        int fromIndex = 0; // 开始索引
+        int toIndex = 0; // 结束索引
+
+        if (pageNum != pageCount) {
+            fromIndex = (pageNum - 1) * pageSize;
+            toIndex = fromIndex + pageSize;
+        } else {
+            fromIndex = (pageNum - 1) * pageSize;
+            toIndex = count;
+        }
+
+        List pageList = list.subList(fromIndex, toIndex);
+
+        return pageList;
+    }
+}

+ 48 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/ApiGolden.java

@@ -0,0 +1,48 @@
+/** 
+ * Project Name:nxfd2 
+ * File Name:ApiEdos.java 
+ * Package Name:com.gyee.frame.util
+ * Date:2016-7-25下午12:26:14 
+ * Copyright (c) 2016, chenzhou1025@126.com All Rights Reserved. 
+ * 
+ */
+
+package com.gyee.datacenter.util.realtimesource;
+
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * ClassName:ApiEdos <br/>
+ * Function: TODO ADD FUNCTION. <br/>
+ * Reason: TODO ADD REASON. <br/>
+ * Date: 2016-7-25 下午12:26:14 <br/>
+ * 
+ * @author 石林
+ * @version
+ * @since JDK 1.6
+ * @see
+ */
+public class ApiGolden {
+
+    private static RestTemplate restTemplate = null;
+
+  
+    private ApiGolden() {
+
+    }
+
+    public static RestTemplate getInstance() {
+    	
+    	
+
+        if (restTemplate == null) {
+        	
+        	restTemplate = new RestTemplate();
+
+        }
+
+        return restTemplate;
+
+    }
+
+}

File diff suppressed because it is too large
+ 1267 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/EdosUtil.java


+ 27 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/GoldenConfig.java

@@ -0,0 +1,27 @@
+package com.gyee.datacenter.util.realtimesource;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * 读取项目相关配置
+ * 
+ * @author gyee
+ */
+
+@Configuration
+@ConfigurationProperties(prefix = "golden")
+public class GoldenConfig
+{
+    private static String baseURL;
+
+    public static String getBaseurl() {
+        return baseURL;
+    }
+
+    public  void setBaseurl(String baseURL) {
+        GoldenConfig.baseURL = baseURL;
+    }
+}
+
+

+ 172 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/HttpClientUtil.java

@@ -0,0 +1,172 @@
+package com.gyee.datacenter.util.realtimesource;
+
+import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpStatus;
+import org.apache.commons.httpclient.NameValuePair;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.params.HttpMethodParams;
+
+import java.io.*;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+/**
+ * @ClassName : HttpClientUtil
+ * @Author : xieshengjie
+ * @Date: 2021/12/22 15:52
+ * @Description :
+ */
+public class HttpClientUtil {
+    public static String doGet(String url) {
+        // 输入流
+        InputStream is = null;
+        BufferedReader br = null;
+        String result = null;
+        // 创建httpClient实例
+        HttpClient httpClient = new HttpClient();
+        // 设置http连接主机服务超时时间:15000毫秒
+        // 先获取连接管理器对象,再获取参数对象,再进行参数的赋值
+        httpClient.getHttpConnectionManager().getParams().setConnectionTimeout(15000);
+        // 创建一个Get方法实例对象
+        GetMethod getMethod = new GetMethod(url);
+        // 设置get请求超时为60000毫秒
+        getMethod.getParams().setParameter(HttpMethodParams.SO_TIMEOUT, 60000);
+        // 设置请求重试机制,默认重试次数:3次,参数设置为true,重试机制可用,false相反
+        getMethod.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler(3, true));
+        try {
+            // 执行Get方法
+            int statusCode = httpClient.executeMethod(getMethod);
+            // 判断返回码
+            if (statusCode != HttpStatus.SC_OK) {
+                // 如果状态码返回的不是ok,说明失败了,打印错误信息
+                System.err.println("Method faild: " + getMethod.getStatusLine());
+            } else {
+                // 通过getMethod实例,获取远程的一个输入流
+                is = getMethod.getResponseBodyAsStream();
+                // 包装输入流
+                br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
+
+                StringBuffer sbf = new StringBuffer();
+                // 读取封装的输入流
+                String temp = null;
+                while ((temp = br.readLine()) != null) {
+                    sbf.append(temp).append("\r\n");
+                }
+
+                result = sbf.toString();
+            }
+
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            // 关闭资源
+            if (null != br) {
+                try {
+                    br.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (null != is) {
+                try {
+                    is.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            // 释放连接
+            getMethod.releaseConnection();
+        }
+        return result;
+    }
+
+    public static String doPost(String url, Map<String, Object> paramMap) {
+        // 获取输入流
+        InputStream is = null;
+        BufferedReader br = null;
+        String result = null;
+        // 创建httpClient实例对象
+        HttpClient httpClient = new HttpClient();
+        // 设置httpClient连接主机服务器超时时间:15000毫秒
+        httpClient.getHttpConnectionManager().getParams().setConnectionTimeout(15000);
+        // 创建post请求方法实例对象
+        PostMethod postMethod = new PostMethod(url);
+        // 设置post请求超时时间
+        postMethod.getParams().setParameter(HttpMethodParams.SO_TIMEOUT, 60000);
+
+        NameValuePair[] nvp = null;
+        // 判断参数map集合paramMap是否为空
+        if (null != paramMap && paramMap.size() > 0) {// 不为空
+            // 创建键值参数对象数组,大小为参数的个数
+
+            nvp = new NameValuePair[paramMap.size()];
+            // 循环遍历参数集合map
+            Set<Entry<String, Object>> entrySet = paramMap.entrySet();
+            // 获取迭代器
+            Iterator<Entry<String, Object>> iterator = entrySet.iterator();
+
+            int index = 0;
+            while (iterator.hasNext()) {
+                Entry<String, Object> mapEntry = iterator.next();
+                // 从mapEntry中获取key和value创建键值对象存放到数组中
+                try {
+                    nvp[index] = new NameValuePair(mapEntry.getKey(),
+                            new String(mapEntry.getValue().toString().getBytes("UTF-8"), "UTF-8"));
+                } catch (UnsupportedEncodingException e) {
+                    e.printStackTrace();
+                }
+                index++;
+            }
+        }
+        // 判断nvp数组是否为空
+        if (null != nvp && nvp.length > 0) {
+            // 将参数存放到requestBody对象中
+            postMethod.setRequestBody(nvp);
+        }
+        // 执行POST方法
+        try {
+            int statusCode = httpClient.executeMethod(postMethod);
+            // 判断是否成功
+            if (statusCode != HttpStatus.SC_OK) {
+                System.err.println("Method faild: " + postMethod.getStatusLine());
+            }
+            // 获取远程返回的数据
+            is = postMethod.getResponseBodyAsStream();
+            // 封装输入流
+            br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
+
+            StringBuffer sbf = new StringBuffer();
+            String temp = null;
+            while ((temp = br.readLine()) != null) {
+                sbf.append(temp).append("\r\n");
+            }
+
+            result = sbf.toString();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            // 关闭资源
+            if (null != br) {
+                try {
+                    br.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (null != is) {
+                try {
+                    is.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            // 释放连接
+            postMethod.releaseConnection();
+        }
+        return result;
+    }
+}

+ 234 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/IEdosUtil.java

@@ -0,0 +1,234 @@
+package com.gyee.datacenter.util.realtimesource;
+
+
+
+import com.gyee.common.model.DNAStatVal;
+import com.gyee.common.model.DNAVal;
+import com.gyee.common.model.PointData;
+import com.gyee.datacenter.model.auto.Windpowerstationtestingpoint;
+import com.gyee.datacenter.model.auto.Windturbinetestingpointai;
+
+import java.util.List;
+import java.util.Map;
+
+
+public interface IEdosUtil {
+
+	/**
+	 * 通过风场测点获得测点实时数据
+	 * @param point 只是用了code字段,作为唯一标识
+	 * @return
+	 * @throws Exception
+	 */
+    public PointData getRealData(Windpowerstationtestingpoint point) throws Exception;
+
+    /**
+     * 通过风场测点获得测点历史快照数据
+     * @param point 只是用了code字段,作为唯一标识
+     * @param beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @param count  点数
+     * @param pried  时间间隔
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistoryDatasSnap(Windpowerstationtestingpoint 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(Windpowerstationtestingpoint point, Long beginDate, Long endDate) throws Exception;
+
+    /**
+     * 通过风机测点获得测点实时数据
+     * @param point 只是用了id字段,作为唯一标识
+     * @return
+     * @throws Exception
+     */
+    public PointData getRealData(Windturbinetestingpointai point) throws Exception;
+
+    /**
+     * 通过风机测点获得历史快照
+     * @param point  只是用了id字段,作为唯一标识
+     * @param  beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @param count  点数
+     * @param pried  时间间隔
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistoryDatasSnap(Windturbinetestingpointai 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(Windturbinetestingpointai 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(Windturbinetestingpointai 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(Windpowerstationtestingpoint 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;
+
+}

+ 791 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/MongoEdosUtil.java

@@ -0,0 +1,791 @@
+package com.gyee.datacenter.util.realtimesource;
+
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+
+
+import com.gyee.common.model.DNAStatVal;
+import com.gyee.common.model.DNAVal;
+import com.gyee.common.model.PointData;
+import com.gyee.common.model.StringUtils;
+import com.gyee.datacenter.model.auto.Windpowerstationtestingpoint;
+import com.gyee.datacenter.model.auto.Windturbinetestingpointai;
+import com.gyee.datacenter.util.realtimesource.timeseries.ErrorRequest;
+import com.gyee.datacenter.util.realtimesource.timeseries.JsonObjectHelper;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Component;
+import org.springframework.web.client.HttpClientErrorException;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+/**
+ */
+@Component
+public class MongoEdosUtil implements IEdosUtil {
+
+    private RestTemplate restTemplate =new RestTemplate();
+    private static String baseURL = "http://192.168.2.216:8090/mogodb";
+    @Override
+    public PointData getRealData(Windpowerstationtestingpoint point) throws Exception {
+        try {
+            Optional<String> keys = Optional.ofNullable(point.getCode());
+
+
+            String url = baseURL + "/getRealData.action?";
+            if (keys.isPresent())
+                url = url + "point=" + keys.get();
+            String s = HttpClientUtil.doGet(url);
+            JSONObject jsonObject=JSONObject.parseObject(s);
+            PointData pointData = JSONObject.toJavaObject(jsonObject, PointData.class);
+            return pointData;
+        } catch (HttpClientErrorException exception) {
+            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+                System.out.println("404请求错误");
+                return ErrorRequest.RequestError(point.getCode());
+            } else {
+                throw exception;
+            }
+        }
+    }
+
+
+
+
+    @Override
+    public List<PointData> getHistoryDatasSnap(Windpowerstationtestingpoint point, Long beginDate, Long endDate, Long count, Long pried) throws Exception {
+        Optional<String> tagName = Optional.ofNullable(point.getCode());
+        Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationid());
+        Optional<String> thingType = Optional.ofNullable(point.getModelid());
+        Optional<String> uniformCode = Optional.ofNullable(point.getUniformcode());
+        Optional<Long> startTs = Optional.ofNullable(beginDate);
+        Optional<Long> endTs = Optional.ofNullable(endDate);
+        Optional<Long> counts = Optional.ofNullable(count);
+        Optional<Long> prieds = Optional.ofNullable(pried);
+        //通过时间区间和时间间隔获取点数
+
+
+        try {
+            String url = baseURL + "/getHistoryDatasSnap.action?";
+            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
+            if (tagName.isPresent())
+                url = url + "point=" + tagName.get();
+            if (startTs.isPresent())
+                url = url + "&begin=" + startTs.get();
+            if (endTs.isPresent())
+                url = url + "&end=" + endTs.get();
+            if (counts.isPresent())
+                url = url + "&count=" + counts.get();
+            if (prieds.isPresent())
+                url = url + "&pried=" + prieds.get();
+            String s = HttpClientUtil.doGet(url);
+            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
+
+            return pointDatas;
+
+
+
+
+        } catch (HttpClientErrorException exception) {
+            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+                System.out.println("404请求错误");
+                return ErrorRequest.RequestListError(point.getCode());
+            } else {
+                throw exception;
+            }
+        }
+
+    }
+
+
+
+
+
+    @Override
+    public List<PointData> getHistoryDatasRaw(Windpowerstationtestingpoint point, Long beginDate, Long endDate) throws Exception {
+        Optional<String> tagName = Optional.ofNullable(point.getCode());
+        Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationid());
+        Optional<String> thingType = Optional.ofNullable(point.getModelid());
+        Optional<String> uniformCode = Optional.ofNullable(point.getUniformcode());
+        Optional<Long> startTs = Optional.ofNullable(beginDate);
+        Optional<Long> endTs = Optional.ofNullable(endDate);
+
+        try {
+            String url = baseURL + "/getHistoryDatasRaw.action?";
+            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
+            if (tagName.isPresent())
+                url = url + "point=" + tagName.get();
+
+
+            if (startTs.isPresent())
+                url = url + "&begin=" + startTs.get();
+            if (endTs.isPresent())
+                url = url + "&end=" + endTs.get();
+
+            String s = HttpClientUtil.doGet(url);
+            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
+           return pointDatas;
+
+        } catch (HttpClientErrorException exception) {
+            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+                System.out.println("404请求错误");
+                return ErrorRequest.RequestListError(point.getCode());
+            } else {
+                throw exception;
+            }
+        }
+    }
+
+    @Override
+    public PointData getRealData(Windturbinetestingpointai point) throws Exception {
+        Optional<String> keys = Optional.ofNullable(point.getId());
+        Optional<String> thingType = Optional.ofNullable(point.getModelid());
+        Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationid());
+        Optional<String> uniformCodes = Optional.ofNullable(point.getUniformcode());
+
+        try {
+            String url = baseURL + "/getRealData.action?";
+            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
+            if (keys.isPresent())
+                url = url + "point=" + keys.get();
+
+            String s = HttpClientUtil.doGet(url);
+            JSONObject jsonObject=JSONObject.parseObject(s);
+            PointData pointData = JSONObject.toJavaObject(jsonObject, PointData.class);
+            return pointData;
+
+        } catch (HttpClientErrorException exception) {
+            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+                System.out.println("404请求错误");
+                return ErrorRequest.RequestError(point.getId());
+            } else {
+                throw exception;
+            }
+        }
+    }
+
+    @Override
+    public List<PointData> getHistoryDatasSnap(Windturbinetestingpointai point, Long beginDate, Long endDate, Long count, Long pried) throws Exception {
+
+        Optional<String> tagName = Optional.ofNullable(point.getId());
+        Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationid());
+        Optional<String> thingType = Optional.ofNullable(point.getModelid());
+        Optional<String> uniformCode = Optional.ofNullable(point.getUniformcode());
+        Optional<Long> startTs = Optional.ofNullable(beginDate);
+        Optional<Long> endTs = Optional.ofNullable(endDate);
+        Optional<Long> counts = Optional.ofNullable(count);
+        Optional<Long> prieds = Optional.ofNullable(pried);
+        //通过时间区间和时间间隔获取点数
+
+        try {
+            String url = baseURL + "/getHistoryDatasSnap.action?";
+            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
+            if (tagName.isPresent())
+                url = url + "point=" + tagName.get();
+
+            if (startTs.isPresent())
+                url = url + "&begin=" + startTs.get();
+            if (endTs.isPresent())
+                url = url + "&end=" + endTs.get();
+            if (counts.isPresent())
+                url = url + "&count=" + counts.get();
+            if (prieds.isPresent())
+                url = url + "&pried=" + prieds.get();
+
+            String s = HttpClientUtil.doGet(url);
+            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
+            return pointDatas;
+        } catch (HttpClientErrorException exception) {
+            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+                System.out.println("404请求错误");
+                return ErrorRequest.RequestListError(point.getId());
+            } else {
+                throw exception;
+            }
+        }
+    }
+
+
+    @Override
+    public List<PointData> getHistoryDatasRaw(Windturbinetestingpointai point, Long beginDate, Long endDate) throws Exception {
+        Optional<String> tagName = Optional.ofNullable(point.getId());
+        Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationid());
+        Optional<String> thingType = Optional.ofNullable(point.getModelid());
+        Optional<String> uniformCode = Optional.ofNullable(point.getUniformcode());
+        Optional<Long> startTs = Optional.ofNullable(beginDate);
+        Optional<Long> endTs = Optional.ofNullable(endDate);
+        try {
+            String url = baseURL + "/getHistoryDatasRaw.action?";
+            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
+            if (tagName.isPresent())
+                url = url + "point=" + tagName.get();
+            if (startTs.isPresent())
+                url = url + "&begin=" + startTs.get();
+            if (endTs.isPresent())
+                url = url + "&end=" + endTs.get();
+
+            String s = HttpClientUtil.doGet(url);
+            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
+            return pointDatas;
+        } catch (HttpClientErrorException exception) {
+            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+                System.out.println("404请求错误");
+                return ErrorRequest.RequestListError(point.getId());
+            } else {
+                throw exception;
+            }
+        }
+    }
+
+    @Override
+    public PointData getRealData(String pointid) throws Exception {
+        Optional<String> keys = Optional.ofNullable(pointid);
+        String url = baseURL + "/getRealData.action?";
+        try {
+            if (keys.isPresent())
+                url = url + "point=" + keys.get();
+            else
+                return null;
+
+            String s = HttpClientUtil.doGet(url);
+            JSONObject jsonObject=JSONObject.parseObject(s);
+            PointData pointData = JSONObject.toJavaObject(jsonObject, PointData.class);
+            return pointData;
+
+        } catch (HttpClientErrorException exception) {
+            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+                System.out.println("404请求错误");
+                return ErrorRequest.RequestError(pointid);
+            } else {
+                return ErrorRequest.RequestError(pointid);
+            }
+        }
+    }
+
+    @Override
+    public List<PointData> getRealData(String... pointids) throws Exception {
+        String pointIdString = StringUtil.join(pointids, ",");
+        Optional<String> keys = Optional.ofNullable(pointIdString);
+        String url = baseURL + "/getRealData.action?1=1";
+        try {
+            if (keys.isPresent())
+                url = url + "&point=" + keys.get();
+            else {
+                return ErrorRequest.RequestListError(pointids);
+            }
+            String s = HttpClientUtil.doGet(url);
+            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
+            return pointDatas;
+
+
+
+        } catch (HttpClientErrorException exception) {
+            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+                System.out.println("404请求错误");
+                return ErrorRequest.RequestListError(pointids);
+            } else {
+                throw exception;
+            }
+        }
+    }
+
+
+
+    @Override
+    public List<PointData> getRealData(List<String> pointids) throws Exception {
+        String pointIdString = StringUtil.join(pointids.toArray(), ",");
+        Optional<String> keys = Optional.ofNullable(pointIdString);
+        String url = baseURL + "/getRealDataByList.action?";
+        try {
+            if (keys.isPresent())
+                url = url + "pointids=" + keys.get();
+            else {
+                String[] arr = new String[pointids.size()];
+                return ErrorRequest.RequestListError(pointids.toArray(arr));
+            }
+            String s = HttpClientUtil.doGet(url);
+            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
+            return pointDatas;
+
+        } catch (HttpClientErrorException exception) {
+            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+                System.out.println("404请求错误");
+                String[] arr = new String[pointids.size()];
+                return ErrorRequest.RequestListError(pointids.toArray(arr));
+            } else {
+                throw exception;
+            }
+        }
+    }
+
+    @Override
+    public Map<String, Double> getRealDataMap(String... pointids) throws Exception {
+        return null;
+    }
+
+
+	  @Override
+	    public List<PointData> getHistoryDatasSnap(String pointid, Long beginDate, Long endDate, Long count, Long pried) throws Exception {
+	        Optional<String> tagName = Optional.ofNullable(pointid);
+	        Optional<Long> startTs = Optional.ofNullable(beginDate);
+	        Optional<Long> endTs = Optional.ofNullable(endDate);
+          Optional<Long> counts = Optional.ofNullable(count);
+          Optional<Long> prieds = Optional.ofNullable(pried);
+
+
+          try {
+              String url = baseURL + "/getHistoryDatasSnap.action?";
+              //tagName 或thingType,thingId,uniformCode可以确定一个标签点
+              if (tagName.isPresent())
+                  url = url + "point=" + tagName.get();
+
+              if (startTs.isPresent())
+                  url = url + "&begin=" + startTs.get();
+              if (endTs.isPresent())
+                  url = url + "&end=" + endTs.get();
+              if (counts.isPresent())
+                  url = url + "&count=" + counts.get();
+              if (prieds.isPresent())
+                  url = url + "&pried=" + prieds.get();
+
+
+              String s = HttpClientUtil.doGet(url);
+              List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
+              return pointDatas;
+
+
+	        } catch (HttpClientErrorException exception) {
+	            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+	                System.out.println("404请求错误");
+	                return ErrorRequest.RequestListError(pointid);
+	            } else {
+	                throw exception;
+	            }
+	        }
+
+	    }
+
+
+    @Override
+    public List<PointData> getHistoryDatasRaw(String pointid, Long beginDate, Long endDate) throws Exception {
+        Optional<String> tagName = Optional.ofNullable(pointid);
+        Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
+        Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
+
+        try {
+            String url = baseURL + "/history/raw?null=0";
+            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
+            if (tagName.isPresent())
+                url = url + "&tagName=" + tagName.get();
+            if (startTs.isPresent())
+                url = url + "&startTs=" + startTs.get();
+            if (endTs.isPresent())
+                url = url + "&endTs=" + endTs.get();
+
+            ResponseEntity<JSONArray> resp = restTemplate.getForEntity(url, JSONArray.class);
+
+            JSONArray jsonArray = resp.getBody();
+            if (jsonArray != null)
+                return JsonObjectHelper.phrasePointData(jsonArray, pointid);
+            else {
+                return ErrorRequest.RequestListError(pointid);
+            }
+        } catch (HttpClientErrorException exception) {
+            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+                System.out.println("404请求错误");
+                return ErrorRequest.RequestListError(pointid);
+            } else {
+                throw exception;
+            }
+        }
+    }
+
+    @Override
+    public List<PointData> getHistStat(Windturbinetestingpointai point, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception {
+        Optional<String> tagName = Optional.ofNullable(point.getId());
+        Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationid());
+        Optional<String> thingType = Optional.ofNullable(point.getModelid());
+        Optional<String> uniformCode = Optional.ofNullable(point.getUniformcode());
+        Optional<Long> startTs = Optional.ofNullable(beginDate);
+        Optional<Long> endTs = Optional.ofNullable(endDate);
+        Optional<Long> counts = Optional.ofNullable(count);
+        Optional<Long> prieds = Optional.ofNullable(pried);
+        Optional<Integer> types = Optional.ofNullable(type);
+
+
+        try {
+            String url = baseURL + "/getHistStat.action?";
+            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
+            if (tagName.isPresent())
+                url = url + "point=" + tagName.get();
+            if (startTs.isPresent())
+                url = url + "&begin=" + startTs.get();
+            if (endTs.isPresent())
+                url = url + "&end=" + endTs.get();
+            if (counts.isPresent())
+                url = url + "&count=" + counts.get();
+            if (prieds.isPresent())
+                url = url + "&pried=" + prieds.get();
+            if (types.isPresent())
+                url = url + "&type=" + types.get();
+
+            String s = HttpClientUtil.doGet(url);
+            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
+            return pointDatas;
+        } catch (HttpClientErrorException exception) {
+            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+                System.out.println("404请求错误");
+                return ErrorRequest.RequestListError(point.getId());
+            } else {
+                throw exception;
+            }
+        }
+    }
+
+    @Override
+    public List<PointData> getHistStat(Windpowerstationtestingpoint point, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception {
+        Optional<String> tagName = Optional.ofNullable(point.getCode());
+        Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationid());
+        Optional<String> thingType = Optional.ofNullable(point.getModelid());
+        Optional<String> uniformCode = Optional.ofNullable(point.getUniformcode());
+        Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
+        Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
+        Optional<Long> counts = Optional.ofNullable(count);
+        Optional<Long> prieds = Optional.ofNullable(pried);
+        Optional<Integer> types = Optional.ofNullable(type);
+
+
+        try {
+            String url = baseURL + "/getHistStat.action?";
+            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
+            if (tagName.isPresent())
+                url = url + "point=" + tagName.get();
+
+            if (startTs.isPresent())
+                url = url + "&begin=" + startTs.get();
+            if (endTs.isPresent())
+                url = url + "&end=" + endTs.get();
+            if (counts.isPresent())
+                url = url + "&count=" + counts.get();
+            if (prieds.isPresent())
+                url = url + "&pried=" + prieds.get();
+            if (types.isPresent())
+                url = url + "&type=" + types.get();
+
+            String s = HttpClientUtil.doGet(url);
+            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
+            return pointDatas;
+        } catch (HttpClientErrorException exception) {
+            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+                System.out.println("404请求错误");
+                return ErrorRequest.RequestListError(point.getCode());
+            } else {
+                throw exception;
+            }
+        }
+    }
+
+    @Override
+    public List<PointData> getHistStat(String pointid, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception {
+        Optional<String> tagName = Optional.ofNullable(pointid);
+        Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
+        Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
+        Optional<Long> counts = Optional.ofNullable(count);
+        Optional<Long> prieds = Optional.ofNullable(pried);
+        Optional<Integer> types = Optional.ofNullable(type);
+
+
+        try {
+            String url = baseURL + "/getHistStat.action?";
+            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
+            if (tagName.isPresent())
+                url = url + "point=" + tagName.get();
+
+            if (startTs.isPresent())
+                url = url + "&begin=" + startTs.get();
+            if (endTs.isPresent())
+                url = url + "&end=" + endTs.get();
+            if (counts.isPresent())
+                url = url + "&count=" + counts.get();
+            if (prieds.isPresent())
+                url = url + "&pried=" + prieds.get();
+            if (types.isPresent())
+                url = url + "&type=" + types.get();
+
+            String s = HttpClientUtil.doGet(url);
+            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
+            return pointDatas;
+        } catch (HttpClientErrorException exception) {
+            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+                System.out.println("404请求错误");
+                return ErrorRequest.RequestListError(pointid);
+            } else {
+                throw exception;
+            }
+        }
+    }
+
+    @Override
+    public DNAStatVal[] getHistStat(String point, Long beginDate, Long endDate, Integer pried) throws Exception {
+        Optional<String> tagName = Optional.ofNullable(point);
+        Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
+        Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
+        //通过时间区间和时间间隔获取点数
+        Optional<Integer> interval = Optional.ofNullable(pried);
+
+        try {
+            String url = baseURL + "/history/stat?null=0";
+            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
+            if (tagName.isPresent())
+                url = url + "&tagName=" + tagName.get();
+            if (startTs.isPresent())
+                url = url + "&startTs=" + startTs.get();
+            if (endTs.isPresent())
+                url = url + "&endTs=" + endTs.get();
+            if (interval.isPresent())
+                url = url + "&interval=" + interval.get();
+
+            //System.out.println(restTemplate.getForEntity(url, JSONArray.class));
+            ResponseEntity<JSONArray> resp = restTemplate.getForEntity(url, JSONArray.class);
+            if (resp != null) {
+                JSONArray jsonArray = resp.getBody();
+                if (jsonArray == null || jsonArray.size() <= 0) {
+                    DNAStatVal[] dnaVal = new DNAStatVal[1];
+                    DNAVal errorData = new DNAVal();
+                    errorData.Status = 0;
+
+                    DNAStatVal val = new DNAStatVal();
+                    val.avg = errorData;
+                    val.max = errorData;
+                    val.min = errorData;
+                    dnaVal[0] = val;
+                    return dnaVal;
+                } else {
+                    return JsonObjectHelper.phraseDNAVal(jsonArray);
+                }
+            } else {
+                return null;
+            }
+
+        } catch (HttpClientErrorException exception) {
+            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+                System.out.println("404请求错误");
+                DNAStatVal val = new DNAStatVal();
+                DNAStatVal[] dnaVal = new DNAStatVal[1];
+                DNAVal errorData = new DNAVal();
+                errorData.Status = 0;
+                val.avg = errorData;
+                val.max = errorData;
+                val.min = errorData;
+                dnaVal[0] = val;
+                return dnaVal;
+
+            } else {
+                DNAStatVal val = new DNAStatVal();
+                DNAStatVal[] dnaVal = new DNAStatVal[1];
+                DNAVal errorData = new DNAVal();
+                errorData.Status = 0;
+                val.avg = errorData;
+                val.max = errorData;
+                val.min = errorData;
+                dnaVal[0] = val;
+                return dnaVal;
+            }
+        }
+    }
+
+    private JSONObject convertPointData(PointData pd) {
+        JSONObject jo = new JSONObject();
+        jo.put("tagName", pd.getEdnaId());
+        JSONObject joo = new JSONObject();
+        joo.put("ts", pd.getPointTime()*1000);
+        joo.put("status", 0);
+        joo.put("doubleValue", pd.getPointValueInDouble());
+        jo.put("tsData", joo);
+        return jo;
+    }
+
+    @Override
+    public void updatePoint(PointData point) throws Exception {
+        String url = baseURL + "/history";
+        try {
+            String result = restTemplate.postForObject(url, convertPointData(point), String.class);
+        } catch (HttpClientErrorException exception) {
+            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+                return;
+            } else {
+                throw exception;
+            }
+        }
+    }
+
+    @Override
+    public DNAVal[] getRealtimeTagValues(String... tagNames) throws Exception {
+        String pointIdString = StringUtil.join(tagNames, ",");
+        Optional<String> keys = Optional.ofNullable(pointIdString);
+        String url = baseURL + "/latest?null=0";
+        try {
+            if (keys.isPresent())
+                url = url + "&keys=" + keys.get();
+            else
+                return null;
+
+            ResponseEntity<JSONObject> resp = restTemplate.getForEntity(url, JSONObject.class);
+            JSONObject jsonObject = resp.getBody();
+            if (StringUtils.isNotEmpty(jsonObject) && !jsonObject.isEmpty()){
+                return JsonObjectHelper.phraseDNAVal(jsonObject,tagNames);
+            } else {
+            	  DNAVal[] errorResult = new DNAVal[tagNames.length];
+                  for(int i=0;i<tagNames.length;i++)
+                  {
+                  	 DNAVal val = new DNAVal();
+                       val.Status = 0;
+                       errorResult[i] = val;
+                  }
+                  return errorResult;
+            }
+
+        } catch (HttpClientErrorException exception) {
+            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+                System.out.println("404请求错误");
+                DNAVal[] errorResult = new DNAVal[tagNames.length];
+                for(int i=0;i<tagNames.length;i++)
+                {
+                	 DNAVal val = new DNAVal();
+                     val.Status = 0;
+                     errorResult[i] = val;
+                }
+                return errorResult;
+            } else {
+                throw exception;
+            }
+        }
+    }
+
+    @Override
+    public void updatePoint(List<PointData> pointls) throws Exception {
+        String url = baseURL + "/history/batch";
+        List<JSONObject> writeList = new ArrayList<>();
+
+        for (PointData entity : pointls) {
+            writeList.add(convertPointData(entity));
+        }
+        try {
+            String result = restTemplate.postForObject(url, writeList, String.class);
+        } catch (HttpClientErrorException exception) {
+            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+                return;
+            } else {
+                throw exception;
+            }
+        }
+    }
+
+    @Override
+    public void sendSinglePoint(PointData point) throws Exception {
+        String url = baseURL + "/latest";
+
+
+        try {
+            String result = restTemplate.postForObject(url, convertPointData(point), String.class);
+        } catch (HttpClientErrorException exception) {
+            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+                return;
+            } else {
+                throw exception;
+            }
+        }
+    }
+
+    @Override
+    public void sendMultiPoint(List<PointData> pointls) throws Exception {
+
+        String url = baseURL + "/latest/batch";
+        List<JSONObject> writeList = new ArrayList<>();
+
+        for (PointData entity : pointls) {
+            writeList.add(convertPointData(entity));
+        }
+        try {
+            String result = restTemplate.postForObject(url, writeList, String.class);
+        } catch (HttpClientErrorException exception) {
+            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+                System.out.println("404请求错误");
+            } else {
+                throw exception;
+            }
+        }
+    }
+
+    @Override
+    public void sendMultiPoint(String[] realvalue, DNAVal[] pointls) throws Exception {
+        String url = baseURL + "/latest/batch";
+
+        List<JSONObject> writeDataList = new ArrayList<>();
+        if (realvalue != null && pointls != null & realvalue.length == pointls.length) {
+            for (int i = 0; i < realvalue.length; i++) {
+                PointData writeData = new PointData();
+                writeData.setEdnaId(realvalue[i]);
+                writeData.setPointValueInDouble(pointls[i].DValue);
+                writeData.setPointTime((long)pointls[i].Time);
+                JSONObject jsonObject=convertPointData(writeData);
+                writeDataList.add(jsonObject);
+            }
+
+            try {
+                String result = restTemplate.postForObject(url, writeDataList, String.class);
+            } catch (HttpClientErrorException exception) {
+                if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
+                    System.out.println("404请求错误");
+                } else {
+                    throw exception;
+                }
+            }
+        } else
+            return;
+    }
+
+    //多点切面数据
+    @Override
+    public DNAVal[] getHistMatrix(String[] nameList, int tTime) throws Exception {
+        String tagNameString = StringUtil.join(nameList, ",");
+        Long time = Long.valueOf(tTime);
+        Optional<String> tagName = Optional.ofNullable(tagNameString);
+        Optional<Long> ts = Optional.ofNullable(time * 1000);
+        String url = baseURL + "/history/section?tagNames=" + tagName.get() + "&ts=" + ts.get();
+        try {
+            ResponseEntity<JSONObject> resp = restTemplate.getForEntity(url, JSONObject.class);
+            JSONObject jsonObject = resp.getBody();
+            if (StringUtils.isNotEmpty(jsonObject) && !jsonObject.isEmpty())
+            {
+            	 return JsonObjectHelper.phraseDNAVal(jsonObject,nameList);
+            }
+            else {
+                DNAVal[] errorResult = new DNAVal[nameList.length];
+                for(int i=0;i<nameList.length;i++)
+                {
+                	 DNAVal val = new DNAVal();
+                     val.Status = 0;
+                     errorResult[i] = val;
+                }
+                return errorResult;
+            }
+        } catch (Exception e) {
+        	  DNAVal[] errorResult = new DNAVal[nameList.length];
+              for(int i=0;i<nameList.length;i++)
+              {
+              	 DNAVal val = new DNAVal();
+                   val.Status = 0;
+                   errorResult[i] = val;
+              }
+              return errorResult;
+        }
+    }
+
+
+}

+ 34 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/StringUtil.java

@@ -0,0 +1,34 @@
+package com.gyee.datacenter.util.realtimesource;
+
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * String辅助类
+ * 
+ */
+public class StringUtil extends StringUtils {
+	
+	/**
+	 * 非空判断
+	 * 
+	 * @param obj
+	 * @return
+	 */
+	public static boolean isNotBlank(Object obj) {
+		return !isBlank(obj);
+	}
+
+	/**
+	 * 为空判断
+	 * 
+	 * @param obj
+	 * @return
+	 */
+	public static boolean isBlank(Object obj) {
+		if (obj == null || StringUtils.isBlank(obj.toString())) {
+			return true;
+		}
+		return false;
+	}
+
+}

+ 28 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/BaseTsQuery.java

@@ -0,0 +1,28 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+import lombok.Data;
+
+@Data
+public class BaseTsQuery implements TsQuery {
+
+    private final TsPoint tsPoint;
+    private final long startTs;
+    private final long endTs;
+    private final int interval;
+    private final int limit;
+    private final Interpolation interpolation;
+
+    public BaseTsQuery(TsPoint tsPoint, long startTs, long endTs, int interval, int limit, Interpolation interpolation) {
+        this.tsPoint = tsPoint;
+        this.startTs = startTs;
+        this.endTs = endTs;
+        this.interval = interval;
+        this.limit = limit;
+        this.interpolation = interpolation;
+    }
+
+    public BaseTsQuery(TsPoint tsPoint, long startTs, long endTs) {
+        this(tsPoint, startTs, endTs, 1, 1, Interpolation.RAW);
+    }
+
+}

+ 38 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/BasicTsData.java

@@ -0,0 +1,38 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public abstract class BasicTsData implements TsData, Comparable<BasicTsData>{
+
+    private final long ts;
+
+    private final short status;
+
+    public BasicTsData(long ts, short status) {
+        this.ts = ts;
+        this.status = status;
+    }
+
+    public long getTs() {
+        return ts;
+    }
+
+    public short getStatus() {
+        return status;
+    }
+
+    @Override
+    public int compareTo(BasicTsData o) {
+        return Long.compare(ts, o.ts);
+    }
+
+    @Override
+    public String toString() {
+        return "BasicTsData{ts='" + ts +
+                "', status='" + this.getStatus() +
+                "'}";
+    }
+
+}
+

+ 29 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/BasicTsPoint.java

@@ -0,0 +1,29 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public class BasicTsPoint implements TsPoint {
+
+    private final String id;
+
+    private final TsDataType tsDataType;
+
+    public BasicTsPoint(String id,  TsDataType tsDataType) {
+        this.id = id;
+        this.tsDataType = tsDataType;
+    }
+
+    public String getId() { return id; }
+
+    public TsDataType getTsDataType() {return tsDataType; }
+
+    @Override
+    public String toString() {
+        return "BasicTsPoint{id='" + id +
+                "', dataType='" + this.getTsDataType() +
+                "'}";
+    }
+
+}
+

+ 24 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/BlobTsData.java

@@ -0,0 +1,24 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+import java.util.Base64;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public class BlobTsData extends BasicTsData {
+
+    private final byte[] blob;
+
+    public BlobTsData(long ts, short status, byte[] blob) {
+        super(ts, status);
+        this.blob = blob;
+    }
+
+    //public byte[] getBlob() { return  blob ;}
+
+    public String getBlobValue() {
+        return Base64.getEncoder().encodeToString(blob);
+    }
+
+}
+

+ 22 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/BlobWriteTsData.java

@@ -0,0 +1,22 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+import lombok.Data;
+
+import java.util.Base64;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2018-05-04
+ */
+@Data
+public class BlobWriteTsData {
+    private String tagName;
+    private long ts;
+    private  byte[]blob;
+
+    public String getValue() {
+        return Base64.getEncoder().encodeToString(blob);
+    }
+
+}

+ 24 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/BooleanTsData.java

@@ -0,0 +1,24 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public class BooleanTsData extends BasicTsData {
+
+    private final boolean actualValue;
+
+    public BooleanTsData(long ts, short status, boolean actualValue) {
+        super(ts, status);
+        this.actualValue = actualValue;
+    }
+
+//    public boolean getActualValue() {
+//        return actualValue;
+//    }
+
+    public String getBooleanValue() {
+        return Boolean.toString(actualValue);
+    }
+
+}
+

+ 19 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/BooleanWriteTsData.java

@@ -0,0 +1,19 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+import lombok.Data;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2018-05-04
+ */
+@Data
+public class BooleanWriteTsData  {
+    private String tagName;
+    private long ts;
+    private boolean actualValue;
+
+    public boolean getValue() {
+        return this.actualValue;
+    }
+}

+ 18 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/Coordinate.java

@@ -0,0 +1,18 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+@Data
+@AllArgsConstructor
+public class Coordinate {
+
+    private double latitude;
+
+    private double longitude;
+
+}
+

+ 26 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/CoordinateTsData.java

@@ -0,0 +1,26 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public class CoordinateTsData extends BasicTsData {
+
+    private final Coordinate coordinate;
+
+    public CoordinateTsData(long ts, short status, double latitude, double longitude) {
+        super(ts, status);
+        this.coordinate = new Coordinate(latitude, longitude);
+    }
+
+    public CoordinateTsData(long ts, short status, Coordinate coordinate) {
+        super(ts, status);
+        this.coordinate = coordinate;
+    }
+
+    public Coordinate getCoordinateValue() {
+        return coordinate;
+        //return String.format("{\"longitude\":%f,\"latitude\":\"%f\"}", longitude, latitude);
+    }
+
+}
+

+ 21 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/CoordinateWriteTsData.java

@@ -0,0 +1,21 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+import lombok.Data;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2018-05-04
+ */
+@Data
+public class CoordinateWriteTsData  {
+
+    private String tagName;
+    private long ts;
+    private  double latitude;
+    private  double longitude;
+
+    public double getLatitude() { return  latitude ;}
+    public double getLongitude() {return  longitude; }
+
+}

+ 30 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/DoubleStatData.java

@@ -0,0 +1,30 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public class DoubleStatData {
+
+    private DoubleTsData avg;
+    private DoubleTsData max;
+    private DoubleTsData min;
+
+    public DoubleStatData(DoubleTsData avg, DoubleTsData max, DoubleTsData min) {
+        this.avg = avg;
+        this.max = max;
+        this.min = min;
+    }
+
+    public DoubleTsData getAvg() {
+        return avg;
+    }
+
+    public DoubleTsData getMax() {
+        return max;
+    }
+
+    public DoubleTsData getMin() {
+        return min;
+    }
+}
+

+ 25 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/DoubleTsData.java

@@ -0,0 +1,25 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public class DoubleTsData extends BasicTsData {
+
+    private final double actualValue;
+
+    public DoubleTsData(long ts, short status, double actualValue) {
+        super(ts, status);
+        this.actualValue = actualValue;
+    }
+
+
+    public double getDoubleValue() {
+        return actualValue;
+    }
+
+//    public String getValue() {
+//        return Double.toString(actualValue);
+//    }
+
+}
+

+ 19 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/DoubleWriteTsData.java

@@ -0,0 +1,19 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+import lombok.Data;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2018-05-04
+ */
+@Data
+public class DoubleWriteTsData  {
+    private String tagName;
+    private long ts;
+    private double actualValue;
+
+    public double getValue() {
+        return this.actualValue;
+    }
+}

+ 38 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/ErrorRequest.java

@@ -0,0 +1,38 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+import com.gyee.common.model.PointData;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @descrition:接口请求失败返回操作类
+ * @author:Wanghs
+ * @date:2018-05-21
+ */
+public class ErrorRequest {
+
+    public static List<PointData> RequestListError(String pointId) {
+        List<PointData> dataList = new ArrayList<>();
+        return dataList;
+    }
+
+    public static List<PointData> RequestListError(String... pointId) {
+        List<PointData> dataList = new ArrayList<>();
+        return dataList;
+    }
+
+    public static PointData RequestError(String pointId) {
+        PointData data = new PointData();
+        data.setPointValueInDouble(0);
+        data.setPointName("0");
+        return data;
+    }
+
+    public static Map<String, Double> RequestMapError() {
+        Map<String, Double> resultMap = new HashMap();
+        return resultMap;
+    }
+}

+ 27 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/GeneralTsData.java

@@ -0,0 +1,27 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Optional;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class GeneralTsData implements TsData {
+
+    private long ts;
+    private short status;
+    private Optional<Double> doubleValue;
+    private Optional<Long> longValue;
+    private Optional<Boolean> booleanValue;
+    private Optional<String> stringValue;
+    private Optional<String> blobValue;
+    private Optional<Coordinate> coordinateValue;
+
+}
+

+ 8 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/Interpolation.java

@@ -0,0 +1,8 @@
+
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+public enum Interpolation {
+    SNAP,   // 历史快照数据
+    INTERPOLATION, //插值
+    RAW    //原始数据
+}

+ 206 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/JsonObjectHelper.java

@@ -0,0 +1,206 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.gyee.common.model.DNAStatVal;
+import com.gyee.common.model.DNAVal;
+import com.gyee.common.model.PointData;
+
+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 / 1000);
+            pointData.setPointValue(pointValue);
+            pointData.setPointValueInDouble(Double.parseDouble(pointValue));
+            //System.out.println("key= " + tagName + ", ts = " + ts + ", value = " + pointValue);
+            result.add(pointData);
+        }
+        return result;
+    }
+
+
+    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("1");
+                pointData.setPointValue(pointValue);
+                pointData.setPointTime(ts/1000);
+                if(pointValue.equals("false")  )
+                {
+                    pointData.setPointValueInDouble(0.0);
+                }else  if(pointValue.equals("true") )
+                {
+                    pointData.setPointValueInDouble(1.0);
+                }else
+                {
+                    pointData.setPointValueInDouble(Double.parseDouble(pointValue));
+                }
+
+                //  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")) / 1000);
+                    break;
+                case 1:
+                    data.setPointValue(String.valueOf(minData.getString("doubleValue")));
+                    data.setPointValueInDouble(Double.valueOf(minData.getString("doubleValue")));
+                    data.setPointTime(Long.valueOf(minData.getString("ts")) / 1000);
+                    break;
+                case 2:
+                    data.setPointValue(String.valueOf(avgData.getString("doubleValue")));
+                    data.setPointValueInDouble(Double.valueOf(avgData.getString("doubleValue")));
+                    data.setPointTime(Long.valueOf(avgData.getString("ts")) / 1000);
+                    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")) / 1000));
+            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")) / 1000));
+            avgVal.DValue = Double.valueOf(avgData.getString("doubleValue"));
+
+            maxVal.Time =  Integer.valueOf(String.valueOf(Long.valueOf(maxData.getString("ts")) / 1000));
+            maxVal.DValue = Double.valueOf(maxData.getString("doubleValue"));
+
+            minVal.Time =  Integer.valueOf(String.valueOf(Long.valueOf(minData.getString("ts")) / 1000));
+            minVal.DValue = Double.valueOf(minData.getString("doubleValue"));
+
+            statVal.max = maxVal;
+            statVal.min = minVal;
+            statVal.avg = avgVal;
+
+            list.add(statVal);
+        }
+
+        return list.toArray(arr);
+    }
+
+}

+ 24 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/LongTsData.java

@@ -0,0 +1,24 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public class LongTsData extends BasicTsData {
+
+    private final long actualValue;
+
+    public LongTsData(long ts, short status, long actualValue) {
+        super(ts, status);
+        this.actualValue = actualValue;
+    }
+
+    public long getLongValue() {
+        return actualValue;
+    }
+
+//    public String getValue() {
+//        return Long.toString(actualValue);
+//    }
+
+}
+

+ 20 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/LongWriteTsData.java

@@ -0,0 +1,20 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+import lombok.Data;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2018-05-04
+ */
+@Data
+public class LongWriteTsData  {
+
+    private String tagName;
+    private long ts;
+    private long actualValue;
+
+    public long getValue() {
+        return this.actualValue;
+    }
+}

+ 24 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/StringTsData.java

@@ -0,0 +1,24 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public class StringTsData extends BasicTsData {
+
+    private final String actualValue;
+
+    public StringTsData(long ts, short status, String actualValue) {
+        super(ts, status);
+        this.actualValue = actualValue;
+    }
+
+//    public String getActualValue() {
+//        return actualValue;
+//    }
+
+    public String getStringValue() {
+        return actualValue;
+    }
+
+}
+

+ 34 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/StringUtil.java

@@ -0,0 +1,34 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * String辅助类
+ * 
+ */
+public class StringUtil extends StringUtils {
+	
+	/**
+	 * 非空判断
+	 * 
+	 * @param obj
+	 * @return
+	 */
+	public static boolean isNotBlank(Object obj) {
+		return !isBlank(obj);
+	}
+
+	/**
+	 * 为空判断
+	 * 
+	 * @param obj
+	 * @return
+	 */
+	public static boolean isBlank(Object obj) {
+		if (obj == null || StringUtils.isBlank(obj.toString())) {
+			return true;
+		}
+		return false;
+	}
+
+}

+ 20 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/StringWriteTsData.java

@@ -0,0 +1,20 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+import lombok.Data;
+
+/**
+ * @descrition:String类型写入实体类
+ * @author:Wanghs
+ * @date:2018-05-04
+ */
+@Data
+public class StringWriteTsData  {
+    private String tagName;
+    private long ts;
+    private String actualValue;
+
+    public String getValue() {
+        return this.actualValue;
+    }
+
+}

+ 15 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/TsData.java

@@ -0,0 +1,15 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public interface TsData {
+
+    long getTs();
+
+    short getStatus();
+
+    //double getValue();
+
+}
+

+ 15 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/TsDataType.java

@@ -0,0 +1,15 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public enum TsDataType {
+    LONG,
+    DOUBLE,
+    BOOLEAN,
+    STRING,
+    BLOB,
+    COORDINATE
+
+}
+

+ 12 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/TsPoint.java

@@ -0,0 +1,12 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public interface TsPoint {
+
+    String getId();
+
+    TsDataType getTsDataType();
+}
+

+ 36 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/TsPointData.java

@@ -0,0 +1,36 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class TsPointData {
+
+    private String tagName;
+    private GeneralTsData tsData;
+
+    public TsDataType findDataType() {
+        if (tsData.getDoubleValue().isPresent())
+            return TsDataType.DOUBLE;
+        else if (tsData.getBooleanValue().isPresent())
+            return TsDataType.BOOLEAN;
+        else if (tsData.getLongValue().isPresent())
+            return TsDataType.LONG;
+        else if (tsData.getStringValue().isPresent())
+            return TsDataType.STRING;
+        else if (tsData.getBlobValue().isPresent())
+            return TsDataType.BLOB;
+        else if (tsData.getCoordinateValue().isPresent())
+            return TsDataType.COORDINATE;
+
+        return TsDataType.DOUBLE;
+    }
+}
+

+ 23 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/TsPointDataList.java

@@ -0,0 +1,23 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class TsPointDataList {
+
+    private String tagName;
+
+    private List<GeneralTsData> tsDataList;
+
+}
+

+ 17 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/realtimesource/timeseries/TsQuery.java

@@ -0,0 +1,17 @@
+package com.gyee.datacenter.util.realtimesource.timeseries;
+
+public interface TsQuery {
+
+    TsPoint getTsPoint();
+
+    long getStartTs();
+
+    long getEndTs();
+
+    int getInterval();
+
+    int getLimit();
+
+    Interpolation getInterpolation();
+
+}

+ 44 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/redis/RedisAutoConfiguration.java

@@ -0,0 +1,44 @@
+package com.gyee.datacenter.util.redis;
+
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.core.RedisOperations;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.core.StringRedisTemplate;
+
+import java.net.UnknownHostException;
+
+@Configuration
+@ConditionalOnClass(RedisOperations.class)
+@EnableConfigurationProperties(RedisProperties.class)
+public class RedisAutoConfiguration {
+
+
+    @Bean
+    @ConditionalOnMissingBean(name = "redisTemplate")
+    public RedisTemplate<Object, Object> redisTemplate(
+            RedisConnectionFactory redisConnectionFactory) throws UnknownHostException {
+        RedisTemplate<Object, Object> template = new RedisTemplate<>();
+        template.setConnectionFactory(redisConnectionFactory);
+        return template;
+
+    }
+
+
+    @Bean
+    @ConditionalOnMissingBean
+    public StringRedisTemplate stringRedisTemplate(
+            RedisConnectionFactory redisConnectionFactory) throws UnknownHostException {
+        StringRedisTemplate template = new StringRedisTemplate();
+        template.setConnectionFactory(redisConnectionFactory);
+        return template;
+
+    }
+
+
+}

+ 47 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/redis/RedisConfig.java

@@ -0,0 +1,47 @@
+package com.gyee.datacenter.util.redis;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.PropertyAccessor;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+
+
+/**
+
+/**
+ *@ClassName RedisConfig
+ *@Description TODO
+ *@Author 谢生杰
+ *@Date 2020/9/14 10:42
+ *@Version 1.0
+ **/
+@Configuration
+public class RedisConfig {
+    @Bean
+    @SuppressWarnings("all")
+    public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory) {
+        RedisTemplate<String, Object> template = new RedisTemplate<String, Object>();
+        template.setConnectionFactory(factory);
+        Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class);
+        ObjectMapper om = new ObjectMapper();
+        om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
+        om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+        jackson2JsonRedisSerializer.setObjectMapper(om);
+        StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
+        // key采用String的序列化方式
+        template.setKeySerializer(stringRedisSerializer);
+        // hash的key也采用String的序列化方式
+        template.setHashKeySerializer(stringRedisSerializer);
+        // value序列化方式采用jackson
+        template.setValueSerializer(jackson2JsonRedisSerializer);
+        // hash的value序列化方式采用jackson
+        template.setHashValueSerializer(jackson2JsonRedisSerializer);
+        template.afterPropertiesSet();
+        return template;
+    }
+}

+ 49 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/redis/RedisService.java

@@ -0,0 +1,49 @@
+package com.gyee.datacenter.util.redis;
+
+public interface RedisService {
+
+    /**
+     * set存数据
+     * @param key
+     * @param value
+     * @return
+     */
+    boolean set(String key, String value);
+
+    /**
+     * get获取数据
+     * @param key
+     * @return
+     */
+    String get(String key);
+
+//    void getList(String key,int start,int end);
+
+    /**
+     * 设置有效天数
+     * @param key
+     * @param expire
+     * @return
+     */
+    boolean expire(String key, long expire);
+
+    /**
+     * 移除数据
+     * @param key
+     * @return
+     */
+    boolean remove(String key);
+
+
+    /**
+     * 插入对象
+     */
+    void setObject(Object o);
+
+
+    boolean hasKey(String key);
+
+
+    void select(Integer dbIndex);
+
+}

+ 124 - 0
web/datacenter-hb/src/main/java/com/gyee/datacenter/util/redis/RedisServiceImpl.java

@@ -0,0 +1,124 @@
+package com.gyee.datacenter.util.redis;
+
+import org.springframework.dao.DataAccessException;
+import org.springframework.data.redis.connection.RedisConnection;
+import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
+import org.springframework.data.redis.core.RedisCallback;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.RedisSerializer;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.lang.reflect.Field;
+import java.util.concurrent.TimeUnit;
+
+@Service("redisService")
+public class RedisServiceImpl implements RedisService {
+
+    @Resource
+    private RedisTemplate<String, ?> redisTemplate;
+
+    @Override
+    public boolean set(final String key, final String value) {
+        boolean result = redisTemplate.execute(new RedisCallback<Boolean>() {
+            @Override
+            public Boolean doInRedis(RedisConnection connection) throws DataAccessException {
+                RedisSerializer<String> serializer = redisTemplate.getStringSerializer();
+                connection.set(serializer.serialize(key), serializer.serialize(value));
+                return true;
+            }
+        });
+        return result;
+    }
+
+    @Override
+    public String get(final String key) {
+        String result = redisTemplate.execute(new RedisCallback<String>() {
+            @Override
+            public String doInRedis(RedisConnection connection) throws DataAccessException {
+                RedisSerializer<String> serializer = redisTemplate.getStringSerializer();
+                byte[] value = connection.get(serializer.serialize(key));
+                return serializer.deserialize(value);
+            }
+        });
+        return result;
+    }
+
+
+
+    @Override
+    public boolean expire(final String key, long expire) {
+        return redisTemplate.expire(key, expire, TimeUnit.SECONDS);
+    }
+
+    @Override
+    public boolean remove(final String key) {
+        boolean result = redisTemplate.execute(new RedisCallback<Boolean>() {
+            @Override
+            public Boolean doInRedis(RedisConnection connection) throws DataAccessException {
+                RedisSerializer<String> serializer = redisTemplate.getStringSerializer();
+                connection.del(key.getBytes());
+                return true;
+            }
+        });
+        return result;
+    }
+
+    @Override
+    public boolean hasKey(final String key) {
+        try {
+            return redisTemplate.hasKey(key);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    @Override
+    public void setObject(Object obj) {
+        Field[] fields = obj.getClass().getDeclaredFields();
+        for(int i = 0 , len = fields.length; i < len; i++) {
+            // 对于每个属性,获取属性名
+            String varName = fields[i].getName();
+            try {
+                // 获取原来的访问控制权限
+                boolean accessFlag = fields[i].isAccessible();
+                // 修改访问控制权限
+                fields[i].setAccessible(true);
+                // 获取在对象f中属性fields[i]对应的对象中的变量
+                Object o;
+                try {
+                    o = fields[i].get(obj);
+                    if (o!=null){
+                        set(varName, String.valueOf(o));
+                    }else {
+                        set(varName,"");
+                    }
+
+                    //System.err.println("传入的对象中包含一个如下的变量:" + varName + " = " + o);
+                } catch (IllegalAccessException e) {
+                    // TODO Auto-generated catch block
+                    e.printStackTrace();
+                }
+                // 恢复访问控制权限
+                fields[i].setAccessible(accessFlag);
+            } catch (IllegalArgumentException ex) {
+                ex.printStackTrace();
+            }
+        }
+
+    }
+
+    public void select(Integer dbIndex) {
+        if (dbIndex == null || dbIndex > 15 || dbIndex < 0) {
+            dbIndex = 0;
+        }
+        LettuceConnectionFactory jedisConnectionFactory = (LettuceConnectionFactory) redisTemplate
+                .getConnectionFactory();
+        jedisConnectionFactory.setDatabase(dbIndex);
+        redisTemplate.setConnectionFactory(jedisConnectionFactory);
+        jedisConnectionFactory.afterPropertiesSet();
+//        jedisConnectionFactory.resetConnection();
+
+    }
+}

+ 91 - 0
web/datacenter-hb/src/main/resources/application-dev.yml

@@ -0,0 +1,91 @@
+server:
+  port: 8091
+  servlet:
+    context-path: /
+
+
+spring:
+  main:
+    allow-bean-definition-overriding: true #当遇到同样名字的时候,是否允许覆盖注册
+  #redis集群
+  redis:
+    host: 192.168.2.202
+#    host: 10.83.68.94
+    port: 6379
+    timeout: 100000
+    #    集群环境打开下面注释,单机不需要打开
+    #    cluster:
+    #      集群信息
+    #      nodes: xxx.xxx.xxx.xxx:xxxx,xxx.xxx.xxx.xxx:xxxx,xxx.xxx.xxx.xxx:xxxx
+    #      #默认值是5 一般当此值设置过大时,容易报:Too many Cluster redirections
+    #      maxRedirects: 3
+    password:
+    application:
+      name: test
+    jedis:
+      pool:
+        max-active: 8
+        min-idle: 0
+        max-idle: 8
+        max-wait: -1
+    database: 19
+  autoconfigure:
+    exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    driver-class-name: oracle.jdbc.OracleDriver
+    #外网
+#    url: jdbc:oracle:thin:@10.83.68.165:1521:gdsj
+    url: jdbc:oracle:thin:@192.168.2.215:1521:gdsj
+    username: gdprod
+    password: gd123
+    oracle-schema=:
+    #    type: com.alibaba.druid.pool.DruidDataSource
+    #    url: jdbc:mysql://127.0.0.1:3306/test?characterEncoding=utf8&serverTimezone=UTC
+    #    username: root
+    #    password: root
+    #    driver-class-name: com.mysql.jdbc.Driver
+    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
+  servlet:
+    multipart:
+      # 开启 multipart 上传功能
+      enabled: true
+      # 文件写入磁盘的阈值
+      file-size-threshold: 2KB
+      # 最大文件大小
+      max-file-size: 200MB
+      # 最大请求大小
+      max-request-size: 215MB
+
+mybatis-plus:
+  configuration:
+    map-underscore-to-camel-case: true
+    auto-mapping-behavior: full
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+  mapper-locations: classpath*:mapper/**/*Mapper.xml
+  global-config:
+    # 逻辑删除配置
+    db-config:
+      id-type: auto
+      # 删除前
+      logic-not-delete-value: 1
+      # 删除后
+      logic-delete-value: 0
+logging:
+  level:
+    root: info
+    com.example: debug
+
+
+golden:
+  baseURL: http://10.155.32.4:8011/ts
+

+ 91 - 0
web/datacenter-hb/src/main/resources/application-test.yml

@@ -0,0 +1,91 @@
+server:
+  port: 8091
+  servlet:
+    context-path: /
+
+
+spring:
+  main:
+    allow-bean-definition-overriding: true #当遇到同样名字的时候,是否允许覆盖注册
+  #redis集群
+  redis:
+#    host: 192.168.2.202
+    host: 10.83.68.94
+    port: 6379
+    timeout: 100000
+    #    集群环境打开下面注释,单机不需要打开
+    #    cluster:
+    #      集群信息
+    #      nodes: xxx.xxx.xxx.xxx:xxxx,xxx.xxx.xxx.xxx:xxxx,xxx.xxx.xxx.xxx:xxxx
+    #      #默认值是5 一般当此值设置过大时,容易报:Too many Cluster redirections
+    #      maxRedirects: 3
+    password:
+    application:
+      name: test
+    jedis:
+      pool:
+        max-active: 8
+        min-idle: 0
+        max-idle: 8
+        max-wait: -1
+    database: 19
+  autoconfigure:
+    exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    driver-class-name: oracle.jdbc.OracleDriver
+    #外网
+    url: jdbc:oracle:thin:@10.83.68.165:1521:gdsj
+#    url: jdbc:oracle:thin:@192.168.2.215:1521:gdsj
+    username: gdprod
+    password: gd123
+    oracle-schema=:
+    #    type: com.alibaba.druid.pool.DruidDataSource
+    #    url: jdbc:mysql://127.0.0.1:3306/test?characterEncoding=utf8&serverTimezone=UTC
+    #    username: root
+    #    password: root
+    #    driver-class-name: com.mysql.jdbc.Driver
+    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
+  servlet:
+    multipart:
+      # 开启 multipart 上传功能
+      enabled: true
+      # 文件写入磁盘的阈值
+      file-size-threshold: 2KB
+      # 最大文件大小
+      max-file-size: 200MB
+      # 最大请求大小
+      max-request-size: 215MB
+
+mybatis-plus:
+  configuration:
+    map-underscore-to-camel-case: true
+    auto-mapping-behavior: full
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+  mapper-locations: classpath*:mapper/**/*Mapper.xml
+  global-config:
+    # 逻辑删除配置
+    db-config:
+      id-type: auto
+      # 删除前
+      logic-not-delete-value: 1
+      # 删除后
+      logic-delete-value: 0
+logging:
+  level:
+    root: info
+    com.example: debug
+
+
+golden:
+  baseURL: http://10.155.32.4:8011/ts
+

+ 4 - 0
web/datacenter-hb/src/main/resources/application.yml

@@ -0,0 +1,4 @@
+spring:
+  profiles:
+#    active: dev
+    active: test