소스 검색

产品和微服务分类监视、分析、健康管理、用户管理

shilin 3 년 전
부모
커밋
abd6fb9de6
100개의 변경된 파일14195개의 추가작업 그리고 0개의 파일을 삭제
  1. 1091 0
      web/health-hb/doc/springbootv2.sql
  2. BIN
      web/health-hb/lib/ueditor-1.1.2.jar
  3. 518 0
      web/health-hb/pom.xml
  4. 57 0
      web/health-hb/src/main/java/com/gyee/SpringbootStart.java
  5. 19 0
      web/health-hb/src/main/java/com/gyee/SpringbootWebInitializer.java
  6. 77 0
      web/health-hb/src/main/java/com/gyee/frame/common/async/config/AsyncConfig.java
  7. 76 0
      web/health-hb/src/main/java/com/gyee/frame/common/async/config/ThreadPoolConfig.java
  8. 133 0
      web/health-hb/src/main/java/com/gyee/frame/common/async/controller/AsyncController.java
  9. 57 0
      web/health-hb/src/main/java/com/gyee/frame/common/async/service/AsyncService.java
  10. 63 0
      web/health-hb/src/main/java/com/gyee/frame/common/async/service/impl/AsyncServiceImpl.java
  11. 41 0
      web/health-hb/src/main/java/com/gyee/frame/common/async/util/SmsUtil.java
  12. 166 0
      web/health-hb/src/main/java/com/gyee/frame/common/base/BaseController.java
  13. 34 0
      web/health-hb/src/main/java/com/gyee/frame/common/base/BaseService.java
  14. 268 0
      web/health-hb/src/main/java/com/gyee/frame/common/base/PageInfo.java
  15. 419 0
      web/health-hb/src/main/java/com/gyee/frame/common/cache/AppRedisCacheManager.java
  16. 46 0
      web/health-hb/src/main/java/com/gyee/frame/common/cache/ApplicationContextHolder.java
  17. 383 0
      web/health-hb/src/main/java/com/gyee/frame/common/cache/IGlobalCache.java
  18. 72 0
      web/health-hb/src/main/java/com/gyee/frame/common/cache/MybatisRedisCache.java
  19. 105 0
      web/health-hb/src/main/java/com/gyee/frame/common/cache/RedisConfig.java
  20. 31 0
      web/health-hb/src/main/java/com/gyee/frame/common/cache/RedisUtils.java
  21. 13 0
      web/health-hb/src/main/java/com/gyee/frame/common/conf/AjaxStatus.java
  22. 25 0
      web/health-hb/src/main/java/com/gyee/frame/common/conf/ExportConfig.java
  23. 30 0
      web/health-hb/src/main/java/com/gyee/frame/common/conf/FileConfig.java
  24. 85 0
      web/health-hb/src/main/java/com/gyee/frame/common/conf/KaptchaConfig.java
  25. 99 0
      web/health-hb/src/main/java/com/gyee/frame/common/conf/MybatisConfig.java
  26. 34 0
      web/health-hb/src/main/java/com/gyee/frame/common/conf/PageHelperConf.java
  27. 83 0
      web/health-hb/src/main/java/com/gyee/frame/common/conf/Swagger.java
  28. 79 0
      web/health-hb/src/main/java/com/gyee/frame/common/conf/TemperatureConfig.java
  29. 56 0
      web/health-hb/src/main/java/com/gyee/frame/common/conf/ThreadPoolTaskConfig.java
  30. 229 0
      web/health-hb/src/main/java/com/gyee/frame/common/conf/V2Config.java
  31. 27 0
      web/health-hb/src/main/java/com/gyee/frame/common/conf/ZmConfig.java
  32. 45 0
      web/health-hb/src/main/java/com/gyee/frame/common/conf/monitor/LeaderConfig.java
  33. 45 0
      web/health-hb/src/main/java/com/gyee/frame/common/conf/monitor/StatusConfig.java
  34. 21 0
      web/health-hb/src/main/java/com/gyee/frame/common/dataSources/DataSource.java
  35. 77 0
      web/health-hb/src/main/java/com/gyee/frame/common/dataSources/DataSourceAspect.java
  36. 50 0
      web/health-hb/src/main/java/com/gyee/frame/common/dataSources/DataSourceContextHolder.java
  37. 13 0
      web/health-hb/src/main/java/com/gyee/frame/common/dataSources/DataSourceType.java
  38. 27 0
      web/health-hb/src/main/java/com/gyee/frame/common/dataSources/DynamicDataSource.java
  39. 104 0
      web/health-hb/src/main/java/com/gyee/frame/common/domain/AjaxResult.java
  40. 80 0
      web/health-hb/src/main/java/com/gyee/frame/common/druid/RemoveDruidAdConfig.java
  41. 141 0
      web/health-hb/src/main/java/com/gyee/frame/common/exception/GlobalExceptionResolver.java
  42. 65 0
      web/health-hb/src/main/java/com/gyee/frame/common/exception/QiNiuException.java
  43. 17 0
      web/health-hb/src/main/java/com/gyee/frame/common/exception/demo/DemoModeException.java
  44. 55 0
      web/health-hb/src/main/java/com/gyee/frame/common/exception/enums/QiNiuErrorEnum.java
  45. 41 0
      web/health-hb/src/main/java/com/gyee/frame/common/exception/file/FileNameLengthLimitExceededException.java
  46. 73 0
      web/health-hb/src/main/java/com/gyee/frame/common/exception/file/InvalidExtensionException.java
  47. 37 0
      web/health-hb/src/main/java/com/gyee/frame/common/feign/IAdapterService.java
  48. 30 0
      web/health-hb/src/main/java/com/gyee/frame/common/feign/RemoteServiceBuilder.java
  49. 83 0
      web/health-hb/src/main/java/com/gyee/frame/common/file/ClassUtil.java
  50. 272 0
      web/health-hb/src/main/java/com/gyee/frame/common/file/ExcelExport.java
  51. 179 0
      web/health-hb/src/main/java/com/gyee/frame/common/file/FileUploadUtils.java
  52. 110 0
      web/health-hb/src/main/java/com/gyee/frame/common/file/FileUtils.java
  53. 174 0
      web/health-hb/src/main/java/com/gyee/frame/common/interceptor/MyInterceptor.java
  54. 108 0
      web/health-hb/src/main/java/com/gyee/frame/common/interceptor/MyWebAppConfigurer.java
  55. 31 0
      web/health-hb/src/main/java/com/gyee/frame/common/log/Log.java
  56. 186 0
      web/health-hb/src/main/java/com/gyee/frame/common/log/LogAspect.java
  57. 100 0
      web/health-hb/src/main/java/com/gyee/frame/common/quartz/AbstractQuartzJob.java
  58. 29 0
      web/health-hb/src/main/java/com/gyee/frame/common/quartz/QuartzConfig.java
  59. 23 0
      web/health-hb/src/main/java/com/gyee/frame/common/quartz/QuartzDisallowConcurrentExecution.java
  60. 22 0
      web/health-hb/src/main/java/com/gyee/frame/common/quartz/QuartzJobExecution.java
  61. 410 0
      web/health-hb/src/main/java/com/gyee/frame/common/quartz/QuartzSchedulerUtil.java
  62. 66 0
      web/health-hb/src/main/java/com/gyee/frame/common/quartz/ScheduleConstants.java
  63. 191 0
      web/health-hb/src/main/java/com/gyee/frame/common/quartz/utils/JobInvokeUtil.java
  64. 590 0
      web/health-hb/src/main/java/com/gyee/frame/common/spring/Constant.java
  65. 397 0
      web/health-hb/src/main/java/com/gyee/frame/common/spring/ConstantTR.java
  66. 377 0
      web/health-hb/src/main/java/com/gyee/frame/common/spring/InitialRedis.java
  67. 497 0
      web/health-hb/src/main/java/com/gyee/frame/common/spring/InitialRunner.java
  68. 116 0
      web/health-hb/src/main/java/com/gyee/frame/common/spring/SpringUtils.java
  69. 20 0
      web/health-hb/src/main/java/com/gyee/frame/common/spring/WpEnum.java
  70. 89 0
      web/health-hb/src/main/java/com/gyee/frame/common/support/CharsetKit.java
  71. 1057 0
      web/health-hb/src/main/java/com/gyee/frame/common/support/Convert.java
  72. 240 0
      web/health-hb/src/main/java/com/gyee/frame/common/support/ConvertUtil.java
  73. 77 0
      web/health-hb/src/main/java/com/gyee/frame/common/support/KaptchaTextCreator.java
  74. 148 0
      web/health-hb/src/main/java/com/gyee/frame/common/websocket/ClientInboundChannelInterceptor.java
  75. 65 0
      web/health-hb/src/main/java/com/gyee/frame/common/websocket/WebSocketCache.java
  76. 241 0
      web/health-hb/src/main/java/com/gyee/frame/common/websocket/WebSocketConfig.java
  77. 68 0
      web/health-hb/src/main/java/com/gyee/frame/common/websocket/WebSocketLoginOutEvent.java
  78. 30 0
      web/health-hb/src/main/java/com/gyee/frame/common/websocket/WebsocketMessageService.java
  79. 130 0
      web/health-hb/src/main/java/com/gyee/frame/controller/health/EarlyWarnKnowledgeController.java
  80. 131 0
      web/health-hb/src/main/java/com/gyee/frame/controller/health/FaultKnowledgeController.java
  81. 122 0
      web/health-hb/src/main/java/com/gyee/frame/controller/health/HealthMainController.java
  82. 144 0
      web/health-hb/src/main/java/com/gyee/frame/controller/health/HealthOperationController.java
  83. 495 0
      web/health-hb/src/main/java/com/gyee/frame/controller/health/HealthSubController.java
  84. 81 0
      web/health-hb/src/main/java/com/gyee/frame/controller/health/LossPowerRateHealthController.java
  85. 80 0
      web/health-hb/src/main/java/com/gyee/frame/controller/health/PartBjController.java
  86. 123 0
      web/health-hb/src/main/java/com/gyee/frame/controller/health/ReliabilityAnalysisController.java
  87. 97 0
      web/health-hb/src/main/java/com/gyee/frame/controller/health/StopAnalysisController.java
  88. 160 0
      web/health-hb/src/main/java/com/gyee/frame/controller/health/WindTurbineCurveController.java
  89. 55 0
      web/health-hb/src/main/java/com/gyee/frame/controller/health/WindTurbineHealthListController.java
  90. 520 0
      web/health-hb/src/main/java/com/gyee/frame/controller/recommen/RecommenController.java
  91. 20 0
      web/health-hb/src/main/java/com/gyee/frame/mapper/FanStatusQueryExportMapper/FanStatusQueryExportMapper.java
  92. 35 0
      web/health-hb/src/main/java/com/gyee/frame/mapper/StandardPointTableMapper/StandardPointTableMapper.java
  93. 97 0
      web/health-hb/src/main/java/com/gyee/frame/mapper/auto/ActivePowerDataMapper.java
  94. 64 0
      web/health-hb/src/main/java/com/gyee/frame/mapper/auto/AlarmcountMapper.java
  95. 105 0
      web/health-hb/src/main/java/com/gyee/frame/mapper/auto/AlarmsnapMapper.java
  96. 104 0
      web/health-hb/src/main/java/com/gyee/frame/mapper/auto/Alertrule2Mapper.java
  97. 96 0
      web/health-hb/src/main/java/com/gyee/frame/mapper/auto/AlertrulefailureMapper.java
  98. 106 0
      web/health-hb/src/main/java/com/gyee/frame/mapper/auto/AnalysissubtablebottomMapper.java
  99. 97 0
      web/health-hb/src/main/java/com/gyee/frame/mapper/auto/Brownoutsevent2Mapper.java
  100. 0 0
      web/health-hb/src/main/java/com/gyee/frame/mapper/auto/CompanysMapper.java

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1091 - 0
web/health-hb/doc/springbootv2.sql


BIN
web/health-hb/lib/ueditor-1.1.2.jar


+ 518 - 0
web/health-hb/pom.xml

@@ -0,0 +1,518 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>web</artifactId>
+        <groupId>com.gyee</groupId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>health-hb</artifactId>
+
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <java.version>1.8</java.version>
+        <commons.fileupload.version>1.3.3</commons.fileupload.version>
+        <commons.io.version>2.5</commons.io.version>
+        <tomcat.version>9.0.35</tomcat.version>
+        <spring-boot.version>2.3.7.RELEASE</spring-boot.version>
+        <spring-cloud-alibaba.version>2.2.5.RELEASE</spring-cloud-alibaba.version>
+        <pgsql.version>42.2.5</pgsql.version>
+    </properties>
+
+    <!-- https://mvnrepository.com/ 查找jar网站 -->
+    <dependencies>
+        <!-- SpringBoot Web容器 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <!-- SpringBoot集成mybatis框架 -->
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+            <version>1.3.2</version>
+        </dependency>
+        <!--		<dependency>-->
+        <!--			<groupId>org.mybatis.caches</groupId>-->
+        <!--			<artifactId>mybatis-ehcache</artifactId>-->
+        <!--			<version>1.2.1</version>-->
+        <!--		</dependency>-->
+        <!-- SpringBoot 测试 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <!-- 添加swagger2 -->
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+            <version>2.9.2</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>io.swagger</groupId>
+                    <artifactId>swagger-annotations</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>io.swagger</groupId>
+                    <artifactId>swagger-models</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger-ui</artifactId>
+            <version>2.9.2</version>
+        </dependency>
+        <dependency>
+            <groupId>io.swagger</groupId>
+            <artifactId>swagger-annotations</artifactId>
+            <version>1.5.21</version>
+        </dependency>
+        <dependency>
+            <groupId>io.swagger</groupId>
+            <artifactId>swagger-models</artifactId>
+            <version>1.5.21</version>
+        </dependency>
+
+        <!-- https://mvnrepository.com/artifact/io.github.swagger2markup/swagger2markup -->
+
+        <dependency>
+            <groupId>io.swagger</groupId>
+            <artifactId>swagger-core</artifactId>
+            <version>1.6.2</version>
+        </dependency>
+        <!--GSON -->
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+        </dependency>
+        <!-- pageHelper -->
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper-spring-boot-starter</artifactId>
+            <version>1.2.5</version>
+        </dependency>
+        <!-- mysql驱动7.0-->
+        <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.microsoft.sqlserver</groupId>
+            <artifactId>sqljdbc4</artifactId>
+            <version>4.0</version>
+        </dependency>
+        <dependency>
+            <groupId>com.taosdata.jdbc</groupId>
+            <artifactId>taos-jdbcdriver</artifactId>
+            <version>2.0.30</version>
+        </dependency>
+        <!-- mysql驱动8.0
+         <dependency>
+             <groupId>mysql</groupId>
+             <artifactId>mysql-connector-java</artifactId>
+            <version>8.0.11</version>
+         </dependency>
+         -->
+        <!--druid 数据源监控-->
+        <!-- https://mvnrepository.com/artifact/com.alibaba/druid-spring-boot-starter -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>1.1.10</version>
+        </dependency>
+        <!-- shiro权限 -->
+        <dependency>
+            <groupId>org.apache.shiro</groupId>
+            <artifactId>shiro-spring</artifactId>
+            <version>1.4.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-aop</artifactId>
+        </dependency>
+        <!-- shiro权限支持thymeleaf -->
+        <dependency>
+            <groupId>com.github.theborakompanioni</groupId>
+            <artifactId>thymeleaf-extras-shiro</artifactId>
+            <version>2.0.0</version>
+        </dependency>
+
+        <!-- thymeleaf模版 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-thymeleaf</artifactId>
+        </dependency>
+
+        <!--常用工具类 -->
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+            <version>2.4</version>
+        </dependency>
+
+        <!--io常用工具类 -->
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>${commons.io.version}</version>
+        </dependency>
+
+        <!--文件上传工具类 -->
+        <dependency>
+            <groupId>commons-fileupload</groupId>
+            <artifactId>commons-fileupload</artifactId>
+            <version>${commons.fileupload.version}</version>
+        </dependency>
+
+
+        <!-- 热部署 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-devtools</artifactId>
+            <optional>false</optional>
+        </dependency>
+
+        <!-- Hutool是一个Java工具包 http://hutool.cn/ -->
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>4.1.12</version>
+        </dependency>
+        <!-- google验证码 -->
+        <dependency>
+            <groupId>com.github.penggle</groupId>
+            <artifactId>kaptcha</artifactId>
+            <version>2.3.2</version>
+        </dependency>
+        <!-- https://mvnrepository.com/artifact/org.apache.velocity/velocity -->
+        <dependency>
+            <groupId>org.apache.velocity</groupId>
+            <artifactId>velocity</artifactId>
+            <version>1.7</version>
+        </dependency>
+        <!-- websocket -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-websocket</artifactId>
+        </dependency>
+        <!-- 配置文件读取 -->
+        <dependency>
+            <groupId>commons-configuration</groupId>
+            <artifactId>commons-configuration</artifactId>
+            <version>1.10</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-configuration-processor</artifactId>
+            <optional>true</optional>
+        </dependency>
+
+        <!-- mail -->
+        <dependency>
+            <groupId>javax.mail</groupId>
+            <artifactId>mail</artifactId>
+            <version>1.4.7</version>
+        </dependency>
+
+        <!--百度UEditor依赖的jar包 -->
+        <dependency>
+            <groupId>org.json</groupId>
+            <artifactId>json</artifactId>
+            <version>20180813</version>
+        </dependency>
+        <dependency>
+            <groupId>ueditor</groupId>
+            <artifactId>1.4.3</artifactId>
+            <version>1.8</version>
+            <scope>system</scope>
+            <systemPath>${basedir}/lib/ueditor-1.1.2.jar</systemPath>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-integration</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-logging</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.integration</groupId>
+            <artifactId>spring-integration-ip</artifactId>
+        </dependency>
+        <!--quartz依赖-->
+        <dependency>
+            <groupId>org.quartz-scheduler</groupId>
+            <artifactId>quartz</artifactId>
+        </dependency>
+        <!-- 七牛云 -->
+        <dependency>
+            <groupId>com.qiniu</groupId>
+            <artifactId>qiniu-java-sdk</artifactId>
+            <version>[7.2.0, 7.2.99]</version>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.17</version>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>1.18.12</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tomcat</groupId>
+            <artifactId>tomcat-juli</artifactId>
+            <version>${tomcat.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tomcat.embed</groupId>
+            <artifactId>tomcat-embed-core</artifactId>
+            <version>${tomcat.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tomcat.embed</groupId>
+            <artifactId>tomcat-embed-el</artifactId>
+            <version>${tomcat.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tomcat.embed</groupId>
+            <artifactId>tomcat-embed-websocket</artifactId>
+            <version>${tomcat.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>redis.clients</groupId>
+            <artifactId>jedis</artifactId>
+            <version>3.2.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml</artifactId>
+            <version>4.0.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi</artifactId>
+            <version>4.0.1</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.pegdown</groupId>
+            <artifactId>pegdown</artifactId>
+            <version>1.4.2</version>
+        </dependency>
+        <!-- webservice-->
+        <dependency>
+            <groupId>org.apache.ws.commons.axiom</groupId>
+            <artifactId>axiom-api</artifactId>
+            <version>1.2.12</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2</artifactId>
+            <version>1.6.1</version>
+            <type>pom</type>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-kernel</artifactId>
+            <version>1.6.1</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-adb</artifactId>
+            <version>1.6.1</version>
+        </dependency>
+        <!-- webservice-->
+
+        <!--http请求-->
+        <dependency>
+            <groupId>com.netflix.feign</groupId>
+            <artifactId>feign-core</artifactId>
+            <version>8.18.0</version>
+        </dependency>
+        <dependency>
+            <groupId>com.netflix.feign</groupId>
+            <artifactId>feign-jackson</artifactId>
+            <version>8.18.0</version>
+        </dependency>
+        <!--http请求-->
+
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.postgresql</groupId>
+            <artifactId>postgresql</artifactId>
+            <version>${pgsql.version}</version>
+        </dependency>
+    </dependencies>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>com.alibaba.cloud</groupId>
+                <artifactId>spring-cloud-alibaba-dependencies</artifactId>
+                <version>${spring-cloud-alibaba.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+            <!-- spring-cloud-dependencies -->
+            <dependency>
+                <groupId>org.springframework.cloud</groupId>
+                <artifactId>spring-cloud-dependencies</artifactId>
+                <version>Hoxton.SR5</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-dependencies</artifactId>
+                <version>${spring-boot.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <build>
+
+
+        <!-- 打包不带版本号 -->
+        <!-- <finalName>Gyee_Frame_HF</finalName> -->
+        <plugins>
+            <!-- JUnit 配置 -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <!--忽略测试启动类 -->
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+            </plugin>
+
+
+
+
+            <!-- generator 配置-->
+            <plugin>
+                <groupId>org.mybatis.generator</groupId>
+                <artifactId>mybatis-generator-maven-plugin</artifactId>
+                <version>1.3.7</version>
+                <configuration>
+                    <!--允许移动生成的文件 -->
+                    <verbose>false</verbose>
+                    <!--允许覆盖生成的文件 -->
+                    <overwrite>false</overwrite>
+                    <!--配置文件的路径 -->
+                    <configurationFile>src/main/resources/mybatis-generator.xml</configurationFile>
+                </configuration>
+                <dependencies>
+                    <!--					<dependency>-->
+                    <!--						<groupId>mysql</groupId>-->
+                    <!--						<artifactId>mysql-connector-java</artifactId>-->
+                    <!--						<version>${mysql.version}</version>-->
+                    <!--					</dependency>-->
+                    <dependency>
+                        <groupId>com.oracle</groupId>
+                        <artifactId>ojdbc6</artifactId>
+                        <version>11.2.0.3</version>
+                    </dependency>
+
+                    <!--					<dependency>-->
+                    <!--					<groupId>com.microsoft.sqlserver</groupId>-->
+                    <!--					<artifactId>sqljdbc4</artifactId>-->
+                    <!--					<version>4.0</version>-->
+                    <!--				    </dependency>-->
+
+                </dependencies>
+            </plugin>
+            <!-- jar运行配置 -->
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.8</source>
+                    <target>1.8</target>
+                    <encoding>UTF-8</encoding>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <mainClass>com.gyee.SpringbootStart</mainClass>
+                </configuration>
+
+            </plugin>
+
+
+
+        </plugins>
+    </build>
+
+    <!-- 阿里云maven仓库 -->
+    <repositories>
+        <repository>
+            <id>public</id>
+            <name>aliyun nexus</name>
+            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+        </repository>
+    </repositories>
+
+    <pluginRepositories>
+        <pluginRepository>
+            <id>public</id>
+            <name>aliyun nexus</name>
+            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </pluginRepository>
+    </pluginRepositories>
+
+
+</project>

+ 57 - 0
web/health-hb/src/main/java/com/gyee/SpringbootStart.java

@@ -0,0 +1,57 @@
+package com.gyee;
+
+import com.gyee.frame.common.spring.SpringUtils;
+import com.gyee.frame.service.initialpoint.InitialPointEdosService;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+
+
+/**
+ * 项目启动方法
+ * @author gyee
+ *
+ */
+@EnableDiscoveryClient //开启服务注册与发现功能: classpath: META-INF/spring.factories文件
+@EnableCaching
+@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
+public class SpringbootStart {
+
+    public static void main(String[] args) throws Exception {
+
+        SpringApplication.run(SpringbootStart.class, args);
+
+
+
+
+        InitialPointEdosService initialPointEdosService= SpringUtils.getBean("initialPointEdosService");
+
+
+
+//        InitialRedis initialRedis=new InitialRedis();
+//        System.out.println("初始化开始!");
+//        initialRedis.intialWindturbinepowercurvefitting();
+//        initialRedis.intialWpScatter();
+//        initialRedis.intialPjScatter();
+//        initialRedis.intialLnScatter();
+//        initialRedis.intialWtScatter();
+//        System.out.println("初始化完成!");
+
+//        System.out.println("开始导出风机测点。。。。。。");
+//        initialPointEdosService.initalFj();
+//        System.out.println("结束导出风机测点。。。。。。");
+//
+//        System.out.println("开始导出风场测点。。。。。。");
+//        initialPointEdosService.initalFc(false);
+//        System.out.println("结束导出风场测点。。。。。。");
+//
+//
+//        System.out.println("开始导出风功率测点。。。。。。");
+//        initialPointEdosService.initalFgl();
+//        System.out.println("结束导出风功率测点。。。。。。");
+
+        System.out.println("初始化结束!");
+    }
+}

+ 19 - 0
web/health-hb/src/main/java/com/gyee/SpringbootWebInitializer.java

@@ -0,0 +1,19 @@
+package com.gyee;
+
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
+
+/**
+* @ClassName: SpringbootWebInitializer
+* @Description: web容器中进行部署
+* @author gyee
+* @date 2018年8月18日
+*
+*/
+public class SpringbootWebInitializer  extends SpringBootServletInitializer{
+	@Override
+    protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
+    {
+        return application.sources(SpringbootStart.class);
+    }
+}

+ 77 - 0
web/health-hb/src/main/java/com/gyee/frame/common/async/config/AsyncConfig.java

@@ -0,0 +1,77 @@
+//package com.gyee.frame.common.async.config;
+//
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
+//import org.springframework.context.annotation.Configuration;
+//import org.springframework.scheduling.annotation.AsyncConfigurer;
+//import org.springframework.scheduling.annotation.EnableAsync;
+//
+//import java.lang.reflect.Method;
+//import java.util.Arrays;
+//
+///**
+// * AsyncConfig
+// *
+// * @author wliduo[i@dolyw.com]
+// * @date 2020/5/19 17:58
+// */
+//@Configuration
+//@EnableAsync
+//public class AsyncConfig implements AsyncConfigurer {
+//
+//    /**
+//     * logger
+//     */
+//    private static final Logger logger = LoggerFactory.getLogger(AsyncConfig.class);
+//
+//    /**
+//     * 这里不实现了,使用 ThreadPoolConfig 里的线程池即可
+//     *
+//     * @param
+//     * @return java.util.concurrent.Executor
+//     * @throws
+//     * @author wliduo[i@dolyw.com]
+//     * @date 2020/5/19 18:00
+//     */
+//    /*@Override
+//    public Executor getAsyncExecutor() {
+//        return null;
+//    }*/
+//
+//    /**
+//     * 只能捕获无返回值的异步方法,有返回值的被主线程处理
+//     *
+//     * @param
+//     * @return org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler
+//     * @throws
+//     * @author wliduo[i@dolyw.com]
+//     * @date 2020/5/20 10:16
+//     */
+//    @Override
+//    public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
+//        return new CustomAsyncExceptionHandler();
+//    }
+//
+//    /***
+//     * 处理异步方法中未捕获的异常
+//     *
+//     * @author wliduo[i@dolyw.com]
+//     * @date 2020/5/19 19:16
+//     */
+//    class CustomAsyncExceptionHandler implements AsyncUncaughtExceptionHandler {
+//
+//        @Override
+//        public void handleUncaughtException(Throwable throwable, Method method, Object... obj) {
+//            logger.info("Exception message - {}", throwable.getMessage());
+//            logger.info("Method name - {}", method.getName());
+//            logger.info("Parameter values - {}", Arrays.toString(obj));
+//            if (throwable instanceof Exception) {
+//                Exception exception = (Exception) throwable;
+//                logger.info("exception:{}", exception.getMessage());
+//            }
+//            throwable.printStackTrace();
+//        }
+//
+//    }
+//}

+ 76 - 0
web/health-hb/src/main/java/com/gyee/frame/common/async/config/ThreadPoolConfig.java

@@ -0,0 +1,76 @@
+package com.gyee.frame.common.async.config;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+
+import java.util.concurrent.*;
+
+/**
+ * 线程池配置
+ *
+ * @author wliduo
+ * @date 2019/2/15 14:36
+ */
+@Configuration
+public class ThreadPoolConfig {
+
+    /**
+     * logger
+     */
+    private final static Logger logger = LoggerFactory.getLogger(ThreadPoolConfig.class);
+
+    @Value("${asyncThreadPool.corePoolSize}")
+    private int corePoolSize;
+
+    @Value("${asyncThreadPool.maxPoolSize}")
+    private int maxPoolSize;
+
+    @Value("${asyncThreadPool.queueCapacity}")
+    private int queueCapacity;
+
+    @Value("${asyncThreadPool.keepAliveSeconds}")
+    private int keepAliveSeconds;
+
+    @Value("${asyncThreadPool.awaitTerminationSeconds}")
+    private int awaitTerminationSeconds;
+
+    @Value("${asyncThreadPool.threadNamePrefix}")
+    private String threadNamePrefix;
+
+    /**
+     * 线程池配置
+     * @param
+     * @return java.util.concurrent.Executor
+     * @author wliduo
+     * @date 2019/2/15 14:44
+     */
+    @Bean(name = "threadPoolTaskExecutor")
+    public ThreadPoolTaskExecutor threadPoolTaskExecutor() {
+        logger.info("---------- 线程池开始加载 ----------");
+        ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor();
+        // 核心线程池大小
+        threadPoolTaskExecutor.setCorePoolSize(corePoolSize);
+        // 最大线程数
+        threadPoolTaskExecutor.setMaxPoolSize(maxPoolSize);
+        // 队列容量
+        threadPoolTaskExecutor.setQueueCapacity(keepAliveSeconds);
+        // 活跃时间
+        threadPoolTaskExecutor.setKeepAliveSeconds(queueCapacity);
+        // 主线程等待子线程执行时间
+        threadPoolTaskExecutor.setAwaitTerminationSeconds(awaitTerminationSeconds);
+        // 线程名字前缀
+        threadPoolTaskExecutor.setThreadNamePrefix(threadNamePrefix);
+        // RejectedExecutionHandler:当pool已经达到max-size的时候,如何处理新任务
+        // CallerRunsPolicy:不在新线程中执行任务,而是由调用者所在的线程来执行
+        threadPoolTaskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
+        // 初始化
+        threadPoolTaskExecutor.initialize();
+        logger.info("---------- 线程池加载完成 ----------");
+        return threadPoolTaskExecutor;
+    }
+
+}

+ 133 - 0
web/health-hb/src/main/java/com/gyee/frame/common/async/controller/AsyncController.java

@@ -0,0 +1,133 @@
+package com.gyee.frame.common.async.controller;
+
+
+import com.gyee.frame.common.async.service.AsyncService;
+import com.gyee.frame.common.async.util.SmsUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.concurrent.Future;
+
+/**
+ * AsyncController
+ *
+ * @author wliduo[i@dolyw.com]
+ * @date 2020/5/19 14:46
+ */
+@RestController
+@RequestMapping("/async")
+public class AsyncController {
+
+    /**
+     * logger
+     */
+    private final static Logger logger = LoggerFactory.getLogger(AsyncController.class);
+
+    @Resource
+    private AsyncService asyncService;
+
+    @Autowired
+    private SmsUtil smsUtil;
+
+    /**
+     * 可以看到无返回值异步方法出现异常,主线程还是继续执行完成
+     *
+     * @param
+     * @return void
+     * @throws
+     * @author wliduo[i@dolyw.com]
+     * @date 2020/5/20 9:53
+     */
+    @GetMapping("/run1")
+    public String run1() throws Exception {
+        asyncService.task1();
+        logger.info("run1开始执行");
+        Thread.sleep(5000);
+        logger.info("run1执行完成");
+        return "run1 success";
+    }
+
+    /**
+     * 可以看到有返回值异步方法出现异常,异常抛给主线程处理,导致主线程也被中断执行
+     *
+     * @param
+     * @return java.lang.String
+     * @throws
+     * @author wliduo[i@dolyw.com]
+     * @date 2020/5/20 10:15
+     */
+    @GetMapping("/run2")
+    public String run2() throws Exception {
+        Future<String> future = asyncService.task2();
+        // get()方法阻塞主线程,直到执行完成
+        String result = future.get();
+        logger.info("run2开始执行");
+        Thread.sleep(5000);
+        logger.info("run2执行完成");
+        return result;
+    }
+
+    /**
+     * 多个异步执行
+     *
+     * @param
+     * @return java.lang.String
+     * @throws
+     * @author wliduo[i@dolyw.com]
+     * @date 2020/5/20 10:26
+     */
+    @GetMapping("/run3")
+    public String run3() throws Exception {
+        logger.info("run3开始执行");
+        long start = System.currentTimeMillis();
+        Future<String> future3 = asyncService.task3();
+        Future<String> future4 = asyncService.task4();
+        // 这样与下面是一样的
+        logger.info(future3.get());
+        logger.info(future4.get());
+        // 先判断是否执行完成
+        boolean run3Done = Boolean.FALSE;
+        while (true) {
+            if (future3.isDone() && future4.isDone()) {
+                // 执行完成
+                run3Done = Boolean.TRUE;
+                break;
+            }
+            if (future3.isCancelled() || future4.isCancelled()) {
+                // 取消情况
+                break;
+            }
+        }
+        if (run3Done) {
+            logger.info(future3.get());
+            logger.info(future4.get());
+        } else {
+            // 其他异常情况
+        }
+        long end = System.currentTimeMillis();
+        logger.info("run3执行完成,执行时间: {}", end - start);
+        return "run3 success";
+    }
+
+    /**
+     * 工具类异步
+     *
+     * @param
+     * @return java.lang.String
+     * @throws
+     * @author wliduo[i@dolyw.com]
+     * @date 2020/5/20 10:59
+     */
+    @GetMapping("/sms")
+    public String sms() throws Exception {
+        logger.info("run1开始执行");
+        smsUtil.sendCode("15912347896", "135333");
+        logger.info("run1执行完成");
+        return "send sms success";
+    }
+}

+ 57 - 0
web/health-hb/src/main/java/com/gyee/frame/common/async/service/AsyncService.java

@@ -0,0 +1,57 @@
+package com.gyee.frame.common.async.service;
+
+import java.util.concurrent.Future;
+
+/**
+ * AsyncService
+ *
+ * @author wliduo[i@dolyw.com]
+ * @date 2020/5/19 14:18
+ */
+public interface AsyncService {
+
+    /**
+     * 任务1
+     *
+     * @param
+     * @return void
+     * @throws Exception e
+     * @author wliduo[i@dolyw.com]
+     * @date 2020/5/19 14:45
+     */
+    void task1() throws Exception;
+
+    /**
+     * 任务2
+     *
+     * @param
+     * @return java.util.concurrent.Future<java.lang.String>
+     * @throws Exception e
+     * @author wliduo[i@dolyw.com]
+     * @date 2020/5/20 10:04
+     */
+    Future<String> task2() throws Exception;
+
+    /**
+     * 任务3
+     *
+     * @param
+     * @return java.util.concurrent.Future<java.lang.String>
+     * @throws Exception e
+     * @author wliduo[i@dolyw.com]
+     * @date 2020/5/20 10:20
+     */
+    Future<String> task3() throws Exception;
+
+    /**
+     * 任务4
+     *
+     * @param
+     * @return java.util.concurrent.Future<java.lang.String>
+     * @throws Exception e
+     * @author wliduo[i@dolyw.com]
+     * @date 2020/5/20 10:20
+     */
+    Future<String> task4() throws Exception;
+
+}

+ 63 - 0
web/health-hb/src/main/java/com/gyee/frame/common/async/service/impl/AsyncServiceImpl.java

@@ -0,0 +1,63 @@
+package com.gyee.frame.common.async.service.impl;
+
+
+import com.gyee.frame.common.async.service.AsyncService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.scheduling.annotation.AsyncResult;
+import org.springframework.stereotype.Service;
+
+import java.util.concurrent.Future;
+
+/**
+ * AsyncServiceImpl
+ *
+ * @author wliduo[i@dolyw.com]
+ * @date 2020/5/19 14:24
+ */
+@Service
+public class AsyncServiceImpl implements AsyncService {
+
+    /**
+     * logger
+     */
+    private final static Logger logger = LoggerFactory.getLogger(AsyncServiceImpl.class);
+
+    @Override
+    @Async("threadPoolTaskExecutor")
+    public void task1() throws Exception {
+        logger.info("task1开始执行");
+        Thread.sleep(3000);
+        logger.info("task1执行结束");
+        throw new RuntimeException("出现异常");
+    }
+
+    @Override
+    @Async("threadPoolTaskExecutor")
+    public Future<String> task2() throws Exception {
+        logger.info("task2开始执行");
+        Thread.sleep(3000);
+        logger.info("task2执行结束");
+        throw new RuntimeException("出现异常");
+        // return new AsyncResult<String>("task2 success");
+    }
+
+    @Override
+    @Async("threadPoolTaskExecutor")
+    public Future<String> task3() throws Exception {
+        logger.info("task3开始执行");
+        Thread.sleep(3000);
+        logger.info("task3执行结束");
+        return new AsyncResult<String>("task3 success");
+    }
+
+    @Override
+    @Async("threadPoolTaskExecutor")
+    public Future<String> task4() throws Exception {
+        logger.info("task4开始执行");
+        Thread.sleep(3000);
+        logger.info("task4执行结束");
+        return new AsyncResult<String>("task4 success");
+    }
+}

+ 41 - 0
web/health-hb/src/main/java/com/gyee/frame/common/async/util/SmsUtil.java

@@ -0,0 +1,41 @@
+package com.gyee.frame.common.async.util;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Component;
+
+/**
+ * SmsUtil
+ *
+ * @author wliduo[i@dolyw.com]
+ * @date 2020/5/20 10:50
+ */
+@Component
+public class SmsUtil {
+
+    private static final Logger logger = LoggerFactory.getLogger(SmsUtil.class);
+
+    /**
+     * 异步发送短信
+     *
+     * @param phone
+	 * @param code
+     * @return void
+     * @throws
+     * @author wliduo[i@dolyw.com]
+     * @date 2020/5/20 10:53
+     */
+    @Async
+    public void sendCode(String phone, String code) {
+        logger.info("开始发送验证码...");
+        // 模拟调用接口发验证码的耗时
+        try {
+            Thread.sleep(3000);
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+        logger.info("发送成功: {}", phone);
+    }
+
+}

+ 166 - 0
web/health-hb/src/main/java/com/gyee/frame/common/base/BaseController.java

@@ -0,0 +1,166 @@
+package com.gyee.frame.common.base;
+
+import cn.hutool.core.util.StrUtil;
+import com.gyee.frame.common.domain.AjaxResult;
+import com.gyee.frame.model.custom.TitleVo;
+import com.gyee.frame.service.*;
+import org.springframework.beans.propertyeditors.CustomDateEditor;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.WebDataBinder;
+import org.springframework.web.bind.annotation.InitBinder;
+
+import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * web层通用数据处理
+* @ClassName: BaseController
+* @author gyee
+* @date 2018年8月18日
+*
+ */
+@Controller
+public class BaseController
+{
+	//系统用户
+	@Resource
+	public SysUserService sysUserService; 
+	
+	//系统角色
+	@Resource
+	public SysRoleService sysRoleService; 
+	
+	//权限
+	@Resource
+	public SysPermissionService sysPermissionService;
+
+    //VUE系统用户
+    @Resource
+    public VueUserService vueUserService;
+    //VUE系统角色
+    @Resource
+    public VueRoleService vueRoleService;
+
+    //VUE权限
+    @Resource
+    public VuePermissionService vuePermissionService;
+	//文件上传
+	@Resource
+	public SysFileService sysFileService;
+	
+	//文件存储
+	@Resource
+	public SysDatasService sysDatasService;
+	
+	//文件存储管理表
+	@Resource
+	public SysFileDatasService sysFileDatasService;
+	
+	//日志操作
+	@Resource
+	public SysOperLogService sysOperLogService;
+	//公告
+	@Resource
+	public SysNoticeService sysNoticeService;
+
+    /**
+     * 将前台传递过来的日期格式的字符串,自动转化为Date类型
+     */
+    @InitBinder
+    public void initBinder(WebDataBinder binder)
+    {
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        dateFormat.setLenient(false);
+        binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
+    }
+
+
+    /**
+     * 响应返回结果
+     * 
+     * @param rows 影响行数
+     * @return 操作结果
+     */
+    protected AjaxResult toAjax(int rows)
+    {
+        return rows > 0 ? success() : error();
+    }
+
+    /**
+     * 返回成功
+     */
+    public AjaxResult success()
+    {
+        return AjaxResult.success();
+    }
+
+    /**
+     * 返回失败消息
+     */
+    public AjaxResult error()
+    {
+        return AjaxResult.error();
+    }
+
+    /**
+     * 返回成功消息
+     */
+    public AjaxResult success(String message)
+    {
+        return AjaxResult.success(message);
+    }
+    
+
+    /**
+     * 返回失败消息
+     */
+    public AjaxResult error(String message)
+    {
+        return AjaxResult.error(message);
+    }
+
+    /**
+     * 返回错误码消息
+     */
+    public AjaxResult error(int code, String message)
+    {
+        return AjaxResult.error(code, message);
+    }
+    
+    /**
+     * 返回object数据
+     */
+    public AjaxResult retobject(int code, Object  data)
+    {
+        return AjaxResult.successData(code, data);
+    }
+
+    /**
+     * 页面跳转
+     */
+    public String redirect(String url)
+    {
+    	return StrUtil.format("redirect:{}", url);
+    }
+    
+    
+    /**
+     * 设置标题通用方法
+     */
+    public void setTitle(ModelMap map,TitleVo titleVo){
+    	//标题
+    	map.put("title",titleVo.getTitle());
+    	map.put("parenttitle",titleVo.getParenttitle());
+		//是否打开欢迎语
+    	map.put("isMsg",titleVo.isMsg());
+		//欢迎语
+    	map.put("msgHTML",titleVo.getMsgHtml());
+		//小控件
+    	map.put("isControl",titleVo.isControl());
+		map.put("isribbon", titleVo.isIsribbon());
+    }
+
+   
+}

+ 34 - 0
web/health-hb/src/main/java/com/gyee/frame/common/base/BaseService.java

@@ -0,0 +1,34 @@
+package com.gyee.frame.common.base;
+
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+/**
+ * 抽象类BaseService
+* @ClassName: BaseService
+* @Description: Service实现这个
+* @author gyee
+* @date 2018年6月3日
+*
+ */
+public interface BaseService<T,T2> {
+	
+    int deleteByPrimaryKey(String id);
+
+    int insertSelective(T record);
+
+    T selectByPrimaryKey(String id);
+   
+    int updateByPrimaryKeySelective(T record);
+    
+    int updateByExampleSelective(@Param("record") T record, @Param("example") T2 example);
+
+    int updateByExample(@Param("record") T record, @Param("example") T2 example);
+    
+    List<T> selectByExample(T2 example);
+
+    long countByExample(T2 example);
+
+    int deleteByExample(T2 example);
+
+}

+ 268 - 0
web/health-hb/src/main/java/com/gyee/frame/common/base/PageInfo.java

@@ -0,0 +1,268 @@
+package com.gyee.frame.common.base;
+
+import java.io.Serializable;
+import java.util.List;
+
+import com.github.pagehelper.Page;
+
+@SuppressWarnings({"rawtypes", "unchecked"})
+public class PageInfo<T> implements Serializable {
+    private static final long serialVersionUID = 1L;
+    //当前页
+    private int pageNum;
+    //每页的数量
+    private int pageSize;
+    //当前页的数量
+    private int size;
+    //由于startRow和endRow不常用,这里说个具体的用法
+    //可以在页面中"显示startRow到endRow 共size条数据"
+
+    //当前页面第一个元素在数据库中的行号
+    private int startRow;
+    //当前页面最后一个元素在数据库中的行号
+    private int endRow;
+    //总记录数
+    private long total;
+    //总页数
+    private int pages;
+    //结果集
+    private List<T> list;
+
+    //第一页
+    private int firstPage;
+    //前一页
+    private int prePage;
+    //下一页
+    private int nextPage;
+    //最后一页
+    private int lastPage;
+
+    //是否为第一页
+    private boolean isFirstPage = false;
+    //是否为最后一页
+    private boolean isLastPage = false;
+    //是否有前一页
+    private boolean hasPreviousPage = false;
+    //是否有下一页
+    private boolean hasNextPage = false;
+    //导航页码数
+    private int navigatePages;
+    //所有导航页号
+    private int[] navigatepageNums;
+
+    /**
+     * 包装Page对象
+     *
+     * @param list
+     */
+    public PageInfo(List<T> list) {
+        this(list, 8);
+    }
+
+    /**
+     * 包装Page对象
+     *
+     * @param list          page结果
+     * @param navigatePages 页码数量
+     */
+    public PageInfo(List<T> list, int navigatePages) {
+        if (list instanceof Page) {
+            Page page = (Page) list;
+            this.pageNum = page.getPageNum();
+            this.pageSize = page.getPageSize();
+
+            this.total = page.getTotal();
+            this.pages = page.getPages();
+            this.list = page;
+            this.size = page.size();
+            //由于结果是>startRow的,所以实际的需要+1
+            if (this.size == 0) {
+                this.startRow = 0;
+                this.endRow = 0;
+            } else {
+                this.startRow = page.getStartRow() + 1;
+                //计算实际的endRow(最后一页的时候特殊)
+                this.endRow = this.startRow - 1 + this.size;
+            }
+            this.navigatePages = navigatePages;
+            //计算导航页
+            calcNavigatepageNums();
+            //计算前后页,第一页,最后一页
+            calcPage();
+            //判断页面边界
+            judgePageBoudary();
+        }
+    }
+
+    /**
+     * 计算导航页
+     */
+    private void calcNavigatepageNums() {
+        //当总页数小于或等于导航页码数时
+        if (pages <= navigatePages) {
+            navigatepageNums = new int[pages];
+            for (int i = 0; i < pages; i++) {
+                navigatepageNums[i] = i + 1;
+            }
+        } else { //当总页数大于导航页码数时
+            navigatepageNums = new int[navigatePages];
+            int startNum = pageNum - navigatePages / 2;
+            int endNum = pageNum + navigatePages / 2;
+
+            if (startNum < 1) {
+                startNum = 1;
+                //(最前navigatePages页
+                for (int i = 0; i < navigatePages; i++) {
+                    navigatepageNums[i] = startNum++;
+                }
+            } else if (endNum > pages) {
+                endNum = pages;
+                //最后navigatePages页
+                for (int i = navigatePages - 1; i >= 0; i--) {
+                    navigatepageNums[i] = endNum--;
+                }
+            } else {
+                //所有中间页
+                for (int i = 0; i < navigatePages; i++) {
+                    navigatepageNums[i] = startNum++;
+                }
+            }
+        }
+    }
+
+    /**
+     * 计算前后页,第一页,最后一页
+     */
+    private void calcPage() {
+        if (navigatepageNums != null && navigatepageNums.length > 0) {
+            firstPage = navigatepageNums[0];
+            lastPage = navigatepageNums[navigatepageNums.length - 1];
+            if (pageNum > 1) {
+                prePage = pageNum - 1;
+            }
+            if (pageNum < pages) {
+                nextPage = pageNum + 1;
+            }
+        }
+    }
+
+    /**
+     * 判定页面边界
+     */
+    private void judgePageBoudary() {
+        isFirstPage = pageNum == 1;
+        isLastPage = pageNum == pages;
+        hasPreviousPage = pageNum > 1;
+        hasNextPage = pageNum < pages;
+    }
+
+    public void setPageNum(int pageNum) {
+        this.pageNum = pageNum;
+    }
+
+    public int getPageNum() {
+        return pageNum;
+    }
+
+    public int getPageSize() {
+        return pageSize;
+    }
+
+    public int getSize() {
+        return size;
+    }
+
+    public int getStartRow() {
+        return startRow;
+    }
+
+    public int getEndRow() {
+        return endRow;
+    }
+
+    public long getTotal() {
+        return total;
+    }
+
+    public int getPages() {
+        return pages;
+    }
+
+    public List<T> getList() {
+        return list;
+    }
+
+    public int getFirstPage() {
+        return firstPage;
+    }
+
+    public int getPrePage() {
+        return prePage;
+    }
+
+    public int getNextPage() {
+        return nextPage;
+    }
+
+    public int getLastPage() {
+        return lastPage;
+    }
+
+    public boolean isIsFirstPage() {
+        return isFirstPage;
+    }
+
+    public boolean isIsLastPage() {
+        return isLastPage;
+    }
+
+    public boolean isHasPreviousPage() {
+        return hasPreviousPage;
+    }
+
+    public boolean isHasNextPage() {
+        return hasNextPage;
+    }
+
+    public int getNavigatePages() {
+        return navigatePages;
+    }
+
+    public int[] getNavigatepageNums() {
+        return navigatepageNums;
+    }
+
+    @Override
+    public String toString() {
+        final StringBuffer sb = new StringBuffer("PageInfo{");
+        sb.append("pageNum=").append(pageNum);
+        sb.append(", pageSize=").append(pageSize);
+        sb.append(", size=").append(size);
+        sb.append(", startRow=").append(startRow);
+        sb.append(", endRow=").append(endRow);
+        sb.append(", total=").append(total);
+        sb.append(", pages=").append(pages);
+        sb.append(", list=").append(list);
+        sb.append(", firstPage=").append(firstPage);
+        sb.append(", prePage=").append(prePage);
+        sb.append(", nextPage=").append(nextPage);
+        sb.append(", lastPage=").append(lastPage);
+        sb.append(", isFirstPage=").append(isFirstPage);
+        sb.append(", isLastPage=").append(isLastPage);
+        sb.append(", hasPreviousPage=").append(hasPreviousPage);
+        sb.append(", hasNextPage=").append(hasNextPage);
+        sb.append(", navigatePages=").append(navigatePages);
+        sb.append(", navigatepageNums=");
+        if (navigatepageNums == null){
+        	sb.append("null");
+        }else {
+            sb.append('[');
+            for (int i = 0; i < navigatepageNums.length; ++i){
+            	sb.append(i == 0 ? "" : ", ").append(navigatepageNums[i]);
+            }
+            sb.append(']');
+        }
+        sb.append('}');
+        return sb.toString();
+    }
+}

+ 419 - 0
web/health-hb/src/main/java/com/gyee/frame/common/cache/AppRedisCacheManager.java

@@ -0,0 +1,419 @@
+package com.gyee.frame.common.cache;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.util.CollectionUtils;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @description: 移动端Redis缓存实现类
+ * @author: YuXD
+ * @create: 2021-01-05 10:40
+ **/
+@Getter
+@AllArgsConstructor
+public final class AppRedisCacheManager implements IGlobalCache {
+
+    private RedisTemplate<String, Object> redisTemplate;
+
+    @Override
+    public boolean expire(String key, long time) {
+        try {
+            if (time > 0) {
+                redisTemplate.expire(key, time, TimeUnit.SECONDS);
+            }
+
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    @Override
+    public long getExpire(String key) {
+        return redisTemplate.getExpire(key, TimeUnit.SECONDS);
+    }
+
+    @Override
+    public boolean hasKey(String key) {
+        try {
+            return redisTemplate.hasKey(key);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public void del(String... key) {
+        if (key != null && key.length > 0) {
+            if (key.length == 1) {
+                redisTemplate.delete(key[0]);
+            } else {
+                redisTemplate.delete(CollectionUtils.arrayToList(key));
+            }
+        }
+    }
+
+    @Override
+    public Object get(String key) {
+        return key == null ? null : redisTemplate.opsForValue().get(key);
+    }
+
+    @Override
+    public boolean set(String key, Object value) {
+        try {
+            redisTemplate.opsForValue().set(key, value);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    @Override
+    public boolean set(String key, Object value, long time) {
+        try {
+            if (time > 0) {
+                redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS);
+            } else {
+                set(key, value);
+            }
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    @Override
+    public long incr(String key, long delta) {
+        if (delta < 0) {
+            throw new RuntimeException("递增因子必须大于0");
+        }
+        return redisTemplate.opsForValue().increment(key, delta);
+    }
+
+    @Override
+    public long decr(String key, long delta) {
+        if (delta < 0) {
+            throw new RuntimeException("递减因子必须大于0");
+        }
+        return redisTemplate.opsForValue().increment(key, -delta);
+    }
+
+    @Override
+    public Object hget(String key, String item) {
+        return redisTemplate.opsForHash().get(key, item);
+    }
+
+    @Override
+    public Map<Object, Object> hmget(String key) {
+        return redisTemplate.opsForHash().entries(key);
+    }
+
+    @Override
+    public boolean hmset(String key, Map<String, Object> map) {
+        try {
+            redisTemplate.opsForHash().putAll(key, map);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    @Override
+    public boolean hmset(String key, Map<String, Object> map, long time) {
+        try {
+            redisTemplate.opsForHash().putAll(key, map);
+            if (time > 0) {
+                expire(key, time);
+            }
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    @Override
+    public boolean hset(String key, String item, Object value) {
+        try {
+            redisTemplate.opsForHash().put(key, item, value);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    @Override
+    public boolean hset(String key, String item, Object value, long time) {
+        try {
+            redisTemplate.opsForHash().put(key, item, value);
+            if (time > 0) {
+                expire(key, time);
+            }
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    @Override
+    public void hdel(String key, Object... item) {
+        redisTemplate.opsForHash().delete(key, item);
+    }
+
+    @Override
+    public boolean hHasKey(String key, String item) {
+        return redisTemplate.opsForHash().hasKey(key, item);
+    }
+
+    @Override
+    public double hincr(String key, String item, double by) {
+        return redisTemplate.opsForHash().increment(key, item, by);
+    }
+
+    @Override
+    public double hdecr(String key, String item, double by) {
+        return redisTemplate.opsForHash().increment(key, item, -by);
+    }
+
+    @Override
+    public Set<Object> sGet(String key) {
+        try {
+            return redisTemplate.opsForSet().members(key);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    @Override
+    public boolean sHasKey(String key, Object value) {
+        try {
+            return redisTemplate.opsForSet().isMember(key, value);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    @Override
+    public long sSet(String key, Object... values) {
+        try {
+            return redisTemplate.opsForSet().add(key, values);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+
+    @Override
+    public long sSetAndTime(String key, long time, Object... values) {
+        try {
+            Long count = redisTemplate.opsForSet().add(key, values);
+            if (time > 0) {
+                expire(key, time);
+            }
+            return count;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+
+    @Override
+    public long sGetSetSize(String key) {
+        try {
+            return redisTemplate.opsForSet().size(key);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+
+    @Override
+    public long setRemove(String key, Object... values) {
+        try {
+            Long count = redisTemplate.opsForSet().remove(key, values);
+            return count;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+
+    @Override
+    public List<Object> lGet(String key, long start, long end) {
+        try {
+            return redisTemplate.opsForList().range(key, start, end);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    @Override
+    public long lGetListSize(String key) {
+        try {
+            return redisTemplate.opsForList().size(key);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+
+    @Override
+    public Object lGetIndex(String key, long index) {
+        try {
+            return redisTemplate.opsForList().index(key, index);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    @Override
+    public boolean lSetAll(String key, List<Object> value) {
+        try {
+            redisTemplate.opsForList().leftPushAll(key, value);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    @Override
+    public boolean lSet(String key, Object value) {
+        try {
+            redisTemplate.opsForList().leftPushIfPresent(key, value);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    @Override
+    public boolean lSet(String key, Object value, long time) {
+        try {
+            redisTemplate.opsForList().leftPush(key, value);
+            if (time > 0) {
+                expire(key, time);
+            }
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+
+    }
+
+    @Override
+    public boolean lSetAll(String key, List<Object> value, long time) {
+        try {
+            redisTemplate.opsForList().leftPushAll(key, value);
+            if (time > 0)
+                expire(key, time);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    @Override
+    public boolean rSet(String key, Object value) {
+        try {
+            redisTemplate.opsForList().rightPush(key, value);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    @Override
+    public boolean rSet(String key, Object value, long time) {
+        try {
+            redisTemplate.opsForList().rightPush(key, value);
+            if (time > 0) {
+                expire(key, time);
+            }
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+
+    }
+
+    @Override
+    public boolean rSetAll(String key, List<Object> value) {
+        try {
+            redisTemplate.opsForList().rightPushAll(key, value);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+
+    }
+
+    @Override
+    public boolean rSetAll(String key, List<Object> value, long time) {
+        try {
+            redisTemplate.opsForList().rightPushAll(key, value);
+            if (time > 0)
+                expire(key, time);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    @Override
+    public boolean lUpdateIndex(String key, long index, Object value) {
+        try {
+            redisTemplate.opsForList().set(key, index, value);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    @Override
+    public long lRemove(String key, long count, Object value) {
+        try {
+            Long remove = redisTemplate.opsForList().remove(key, count, value);
+            return remove;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+
+    @Override
+    public void rangeRemove(String key, Long stard, Long end) {
+        try {
+            redisTemplate.opsForList().trim(key, stard, end);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+}

+ 46 - 0
web/health-hb/src/main/java/com/gyee/frame/common/cache/ApplicationContextHolder.java

@@ -0,0 +1,46 @@
+package com.gyee.frame.common.cache;
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.stereotype.Component;
+
+@Component
+public class ApplicationContextHolder implements ApplicationContextAware {
+    private static ApplicationContext applicationContext;
+
+    @Override
+    public void setApplicationContext(ApplicationContext ctx) throws BeansException {
+        applicationContext = ctx;
+    }
+
+    /**
+     * Get application context from everywhere
+     *
+     * @return
+     */
+    public static ApplicationContext getApplicationContext() {
+        return applicationContext;
+    }
+
+    /**
+     * Get bean by class
+     *
+     * @param clazz
+     * @param <T>
+     * @return
+     */
+    public static <T> T getBean(Class<T> clazz) {
+        return applicationContext.getBean(clazz);
+    }
+
+    /**
+     * Get bean by class name
+     *
+     * @param name
+     * @param <T>
+     * @return
+     */
+    public static <T> T getBean(String name) {
+        return (T) applicationContext.getBean(name);
+    }
+}

+ 383 - 0
web/health-hb/src/main/java/com/gyee/frame/common/cache/IGlobalCache.java

@@ -0,0 +1,383 @@
+package com.gyee.frame.common.cache;
+
+import org.springframework.data.redis.core.RedisTemplate;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * 系统全局Cache接口,具体缓存方式需要实现该接口
+ *
+ * @author YuXD
+ * @date 2021-01-05 10:38
+ * @since v1.0
+ */
+public interface IGlobalCache {
+
+    /**
+     * 指定缓存失效时间
+     *
+     * @param key  键
+     * @param time 时间(秒)
+     * @return
+     */
+    boolean expire(String key, long time);
+
+    /**
+     * @param key 键 不能为null
+     * @return 时间(秒) 返回0代表为永久有效
+     */
+    long getExpire(String key);
+
+    /**
+     * 判断key是否存在
+     *
+     * @param key 键
+     * @return true 存在 false不存在
+     */
+    boolean hasKey(String key);
+
+    /**
+     * 删除缓存
+     *
+     * @param key 可以传一个值 或多个
+     */
+    void del(String... key);
+// ============================String=============================
+
+    /**
+     * 普通缓存获取
+     *
+     * @param key 键
+     * @return 值
+     */
+    Object get(String key);
+
+    /**
+     * 普通缓存放入
+     *
+     * @param key   键
+     * @param value 值
+     * @return true成功 false失败
+     */
+    boolean set(String key, Object value);
+
+    /**
+     * 普通缓存放入并设置时间
+     *
+     * @param key   键
+     * @param value 值
+     * @param time  时间(秒) time要大于0 如果time小于等于0 将设置无限期
+     * @return true成功 false 失败
+     */
+    boolean set(String key, Object value, long time);
+
+    /**
+     * 递增
+     *
+     * @param key   键
+     * @param delta 要增加几(大于0)
+     * @return
+     */
+    long incr(String key, long delta);
+
+    /**
+     * 递减
+     *
+     * @param key   键
+     * @param delta 要减少几(小于0)
+     * @return
+     */
+    long decr(String key, long delta);
+
+    /**
+     * HashGet
+     *
+     * @param key  键 不能为null
+     * @param item 项 不能为null
+     * @return 值
+     */
+    Object hget(String key, String item);
+
+    /**
+     * 获取hashKey对应的所有键值
+     *
+     * @param key 键
+     * @return 对应的多个键值
+     */
+    Map<Object, Object> hmget(String key);
+
+    /**
+     * HashSet
+     *
+     * @param key 键
+     * @param map 对应多个键值
+     * @return true 成功 false 失败
+     */
+    boolean hmset(String key, Map<String, Object> map);
+
+    /**
+     * HashSet 并设置时间
+     *
+     * @param key  键
+     * @param map  对应多个键值
+     * @param time 时间(秒)
+     * @return true成功 false失败
+     */
+    boolean hmset(String key, Map<String, Object> map, long time);
+
+    /**
+     * 向一张hash表中放入数据,如果不存在将创建
+     *
+     * @param key   键
+     * @param item  项
+     * @param value 值
+     * @return true 成功 false失败
+     */
+    boolean hset(String key, String item, Object value);
+
+    /**
+     * 向一张hash表中放入数据,如果不存在将创建
+     *
+     * @param key   键
+     * @param item  项
+     * @param value 值
+     * @param time  时间(秒) 注意:如果已存在的hash表有时间,这里将会替换原有的时间
+     * @return true 成功 false失败
+     */
+    boolean hset(String key, String item, Object value, long time);
+
+    /**
+     * 删除hash表中的值
+     *
+     * @param key  键 不能为null
+     * @param item 项 可以使多个 不能为null
+     */
+    void hdel(String key, Object... item);
+
+    /**
+     * 判断hash表中是否有该项的值
+     *
+     * @param key  键 不能为null
+     * @param item 项 不能为null
+     * @return true 存在 false不存在
+     */
+    boolean hHasKey(String key, String item);
+
+    /**
+     * hash递增 如果不存在,就会创建一个 并把新增后的值返回
+     *
+     * @param key  键
+     * @param item 项
+     * @param by   要增加几(大于0)
+     * @return
+     */
+    double hincr(String key, String item, double by);
+
+    /**
+     * hash递减
+     *
+     * @param key  键
+     * @param item 项
+     * @param by   要减少记(小于0)
+     * @return
+     */
+    double hdecr(String key, String item, double by);
+
+    /**
+     * 根据key获取Set中的所有值
+     *
+     * @param key 键
+     * @return
+     */
+    Set<Object> sGet(String key);
+
+    /**
+     * 根据value从一个set中查询,是否存在
+     *
+     * @param key   键
+     * @param value 值
+     * @return true 存在 false不存在
+     */
+    boolean sHasKey(String key, Object value);
+
+    /**
+     * 将数据放入set缓存
+     *
+     * @param key    键
+     * @param values 值 可以是多个
+     * @return 成功个数
+     */
+    long sSet(String key, Object... values);
+
+    /**
+     * 将set数据放入缓存
+     *
+     * @param key    键
+     * @param time   时间(秒)
+     * @param values 值 可以是多个
+     * @return 成功个数
+     */
+    long sSetAndTime(String key, long time, Object... values);
+
+
+    /**
+     * 获取set缓存的长度
+     *
+     * @param key 键
+     * @return
+     */
+    long sGetSetSize(String key);
+
+    /**
+     * 移除值为value的
+     *
+     * @param key    键
+     * @param values 值 可以是多个
+     * @return 移除的个数
+     */
+    long setRemove(String key, Object... values);
+
+    /**
+     * 获取list缓存的内容
+     *
+     * @param key   键
+     * @param start 开始
+     * @param end   结束 0 到 -1代表所有值
+     * @return
+     */
+    List<Object> lGet(String key, long start, long end);
+
+    /**
+     * 获取list缓存的长度
+     *
+     * @param key 键
+     * @return
+     */
+    long lGetListSize(String key);
+
+    /**
+     * 通过索引 获取list中的值
+     *
+     * @param key   键
+     * @param index 索引 index>=0时, 0 表头,1 第二个元素,依次类推;index<0时,-1,表尾,-2倒数第二个元素,依次类推
+     * @return
+     */
+    Object lGetIndex(String key, long index);
+
+    /**
+     * 将list放入缓存
+     *
+     * @param key   键
+     * @param value 值
+     * @return
+     */
+    boolean lSet(String key, Object value);
+
+    /**
+     * 将list放入缓存
+     *
+     * @param key   键
+     * @param value 值
+     * @return
+     */
+    boolean lSet(String key, Object value, long time);
+
+    /**
+     * 将list放入缓存
+     *
+     * @param key   键
+     * @param value 值
+     * @return
+     */
+    boolean lSetAll(String key, List<Object> value);
+
+
+    /**
+     * 将list放入缓存
+     *
+     * @param key   键
+     * @param value 值
+     * @param time  时间(秒)
+     * @return
+     */
+    boolean lSetAll(String key, List<Object> value, long time);
+
+    /**
+     * 将list放入缓存
+     *
+     * @param key   键
+     * @param value 值
+     * @return
+     */
+
+    boolean rSet(String key, Object value);
+
+    /**
+     * 将list放入缓存
+     *
+     * @param key   键
+     * @param value 值
+     * @param time  时间(秒)
+     * @return
+     */
+
+    boolean rSet(String key, Object value, long time);
+
+    /**
+     * 将list放入缓存
+     *
+     * @param key   键
+     * @param value 值
+     * @return
+     */
+    boolean rSetAll(String key, List<Object> value);
+
+    /**
+     * 将list放入缓存
+     *
+     * @param key   键
+     * @param value 值
+     * @param time  时间(秒)
+     * @return
+     */
+    boolean rSetAll(String key, List<Object> value, long time);
+
+    /**
+     * 根据索引修改list中的某条数据
+     *
+     * @param key   键
+     * @param index 索引
+     * @param value 值
+     * @return
+     */
+    boolean lUpdateIndex(String key, long index, Object value);
+
+    /**
+     * 移除N个值为value
+     *
+     * @param key   键
+     * @param count 移除多少个
+     * @param value 值
+     * @return 移除的个数
+     */
+    long lRemove(String key, long count, Object value);
+
+    /**
+     * 从redis集合中移除[start,end]之间的元素
+     *
+     * @param key
+     * @param stard
+     * @param end
+     * @return
+     */
+    void rangeRemove(String key, Long stard, Long end);
+
+    /**
+     * 返回当前redisTemplate
+     *
+     * @return
+     */
+    RedisTemplate getRedisTemplate();
+}

+ 72 - 0
web/health-hb/src/main/java/com/gyee/frame/common/cache/MybatisRedisCache.java

@@ -0,0 +1,72 @@
+//package com.gyee.frame.common.cache;
+//
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//import org.springframework.data.redis.core.RedisTemplate;
+//import org.apache.ibatis.cache.Cache;
+//import java.util.concurrent.locks.ReadWriteLock;
+//import java.util.concurrent.locks.ReentrantReadWriteLock;
+//
+//public class MybatisRedisCache implements Cache {
+//    private static final Logger log = LoggerFactory.getLogger(MybatisRedisCache.class);
+//    private String id;
+//    private final ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
+//    //private static final long EXPIRE_TIME_IN_MINUTES = 30; // redis过期时间
+//
+//
+//    public MybatisRedisCache(String id) {
+//        this.id = id;
+//    }
+//
+//    private RedisTemplate<Object, Object> getRedisTemplate(){
+//        return ApplicationContextHolder.getBean("redisTemplate");
+//    }
+//
+//    @Override
+//    public String getId() {
+//        return id;
+//    }
+//
+//    @Override
+//    public void putObject(Object key, Object value) {
+//        RedisTemplate redisTemplate = getRedisTemplate();
+//        redisTemplate.boundHashOps(getId()).put(key, value);
+//        log.info("[结果放入到缓存中: " + key + "=" + value+" ]");
+//
+//    }
+//
+//    @Override
+//    public Object getObject(Object key) {
+//        RedisTemplate redisTemplate = getRedisTemplate();
+//        Object value = redisTemplate.boundHashOps(getId()).get(key);
+//        log.info("[从缓存中获取了: " + key + "=" + value+" ]");
+//        return value;
+//    }
+//
+//    @Override
+//    public Object removeObject(Object key) {
+//        RedisTemplate redisTemplate = getRedisTemplate();
+//        Object value = redisTemplate.boundHashOps(getId()).delete(key);
+//        log.info("[从缓存删除了: " + key + "=" + value+" ]");
+//        return value;
+//    }
+//
+//    @Override
+//    public void clear() {
+//        RedisTemplate redisTemplate = getRedisTemplate();
+//        redisTemplate.delete(getId());
+//        log.info("清空缓存!!!");
+//    }
+//
+//    @Override
+//    public int getSize() {
+//        RedisTemplate redisTemplate = getRedisTemplate();
+//        Long size = redisTemplate.boundHashOps(getId()).size();
+//        return size == null ? 0 : size.intValue();
+//    }
+//
+//    @Override
+//    public ReadWriteLock getReadWriteLock() {
+//        return readWriteLock;
+//    }
+//}

+ 105 - 0
web/health-hb/src/main/java/com/gyee/frame/common/cache/RedisConfig.java

@@ -0,0 +1,105 @@
+package com.gyee.frame.common.cache;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
+import org.springframework.data.redis.connection.jedis.JedisClientConfiguration;
+import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+import redis.clients.jedis.JedisPool;
+import redis.clients.jedis.JedisPoolConfig;
+
+@EnableCaching
+@Configuration
+public class RedisConfig {
+
+    @Value("${spring.redis.host}")
+    private String host;
+    @Value("${spring.redis.database}")
+    private Integer database;
+    @Value("${spring.redis.port}")
+    private Integer port;
+    @Value("${spring.redis.password}")
+    private String pwd;
+
+    @Value("${spring.redis.pool.maxTotal}")
+    private Integer maxTotal;
+    @Value("${spring.redis.pool.maxIdle}")
+    private Integer maxIdle;
+    @Value("${spring.redis.pool.minIdle}")
+    private Integer minIdle;
+    @Value("${spring.redis.pool.maxwait}")
+    private Integer maxwait;
+
+    @Primary
+    @Bean(name = "jedisPoolConfig")
+    @ConfigurationProperties(prefix = "spring.redis.pool")
+    public JedisPoolConfig jedisPoolConfig() {
+        JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
+        jedisPoolConfig.setMaxTotal(maxTotal);
+        jedisPoolConfig.setMaxIdle(maxIdle);
+        jedisPoolConfig.setMinIdle(minIdle);
+        jedisPoolConfig.setMaxWaitMillis(maxwait);
+        return jedisPoolConfig;
+    }
+
+    @Primary
+    @Bean(name = "jedisPool")
+    public JedisPool redisPoolFactory(JedisPoolConfig jedisPoolConfig){
+
+        JedisPool jedisPool = new JedisPool(jedisPoolConfig,host,port,maxwait,pwd);
+
+        return  jedisPool;
+    }
+
+
+    @Bean
+    public RedisConnectionFactory redisConnectionFactory(JedisPoolConfig jedisPoolConfig) {
+        RedisStandaloneConfiguration redisStandaloneConfiguration = new RedisStandaloneConfiguration();
+        redisStandaloneConfiguration.setHostName(host);
+        redisStandaloneConfiguration.setDatabase(database);
+        redisStandaloneConfiguration.setPassword(pwd);
+        redisStandaloneConfiguration.setPort(port);
+        redisStandaloneConfiguration.setDatabase(database);
+
+        JedisClientConfiguration.JedisPoolingClientConfigurationBuilder jpcb = (JedisClientConfiguration.JedisPoolingClientConfigurationBuilder) JedisClientConfiguration.builder();
+        jpcb.poolConfig(jedisPoolConfig);
+        JedisClientConfiguration jedisClientConfiguration = jpcb.build();
+        return new JedisConnectionFactory(redisStandaloneConfiguration, jedisClientConfiguration);
+    }
+
+    /**
+     * 配置redisTemplate针对不同key和value场景下不同序列化的方式
+     *
+     * @param factory Redis连接工厂
+     * @return
+     */
+    @Primary
+    @Bean(name = "redisTemplate")
+    public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory) {
+        RedisTemplate<String, Object> template = new RedisTemplate<>();
+        template.setConnectionFactory(factory);
+        StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
+        template.setKeySerializer(stringRedisSerializer);
+        template.setHashKeySerializer(stringRedisSerializer);
+        Jackson2JsonRedisSerializer redisSerializer = new Jackson2JsonRedisSerializer(Object.class);
+        template.setValueSerializer(redisSerializer);
+        template.setHashValueSerializer(redisSerializer);
+        template.afterPropertiesSet();
+
+        return template;
+    }
+
+    @Bean(name = "globalCache")
+    IGlobalCache cache(RedisTemplate redisTemplate) {
+        return new AppRedisCacheManager(redisTemplate);
+    }
+
+}

+ 31 - 0
web/health-hb/src/main/java/com/gyee/frame/common/cache/RedisUtils.java

@@ -0,0 +1,31 @@
+package com.gyee.frame.common.cache;
+
+import org.springframework.stereotype.Service;
+import redis.clients.jedis.Jedis;
+import redis.clients.jedis.JedisPool;
+
+import javax.annotation.Resource;
+@Service
+public class RedisUtils {
+
+    @Resource
+    private  JedisPool jedisPool;
+
+
+
+    public  String get(String key, int indexdb) {
+        Jedis jedis = null;
+        String value = null;
+
+        try {
+            jedis = jedisPool.getResource();//获取一个jedis实例
+            jedis.select(indexdb);
+            value = jedis.get(key);
+        } catch (Exception e) {
+        System.out.println(e.getMessage());
+        } finally {
+            jedis.close();
+        }
+        return value;
+    }
+}

+ 13 - 0
web/health-hb/src/main/java/com/gyee/frame/common/conf/AjaxStatus.java

@@ -0,0 +1,13 @@
+package com.gyee.frame.common.conf;
+
+public enum  AjaxStatus {
+    success(200),
+    error(500),
+    logineroor(501),
+    loginexpire(502);
+
+    public int code;
+    AjaxStatus(int c) {
+        code = c;
+    }
+}

+ 25 - 0
web/health-hb/src/main/java/com/gyee/frame/common/conf/ExportConfig.java

@@ -0,0 +1,25 @@
+package com.gyee.frame.common.conf;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 庚顿数据导出配置
+ */
+@Data
+@Component
+@ConfigurationProperties(prefix = "exportcode")
+public class ExportConfig {
+
+    private List<String> template1;
+
+    private Map<String, String> template2swdl;
+
+    private Map<String, String> template2swgl;
+
+    private Map<String, String> template2cft;
+}

+ 30 - 0
web/health-hb/src/main/java/com/gyee/frame/common/conf/FileConfig.java

@@ -0,0 +1,30 @@
+package com.gyee.frame.common.conf;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * 读取项目相关配置
+ * 
+ * @author gyee
+ */
+@Component
+@ConfigurationProperties(prefix = "spring.servlet.multipart")
+public class FileConfig
+{
+    /**单个文件大小*/
+    private static String maxFileSize;
+
+	public static String getMaxFileSize() {
+		maxFileSize=maxFileSize.replace("MB", "");
+		return maxFileSize;
+	}
+
+	public void setMaxFileSize(String maxFileSize) {
+		FileConfig.maxFileSize = maxFileSize;
+	}
+   
+	
+	
+	
+}

+ 85 - 0
web/health-hb/src/main/java/com/gyee/frame/common/conf/KaptchaConfig.java

@@ -0,0 +1,85 @@
+package com.gyee.frame.common.conf;
+
+import java.util.Properties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import com.google.code.kaptcha.impl.DefaultKaptcha;
+import com.google.code.kaptcha.util.Config;
+
+/**
+ * 谷歌验证码配置文件
+ * @author gyee
+ * @date: 2018年9月12日 上午11:02:13
+ */
+@Configuration
+public class KaptchaConfig {
+	 @Bean(name = "captchaProducer")
+	    public DefaultKaptcha getKaptchaBean()
+	    {
+	        DefaultKaptcha defaultKaptcha = new DefaultKaptcha();
+	        Properties properties = new Properties();
+	        //是否有边框  默认为true  我们可以自己设置yes,no  
+	        properties.setProperty("kaptcha.border", "yes");
+	        //边框颜色   默认为Color.BLACK  
+	        properties.setProperty("kaptcha.border.color", "105,179,90");
+	        //验证码文本字符颜色  默认为Color.BLACK  
+	        properties.setProperty("kaptcha.textproducer.font.color", "blue");
+	        //验证码图片宽度  默认为200
+	        properties.setProperty("kaptcha.image.width", "200");
+	        //验证码图片高度  默认为50
+	        properties.setProperty("kaptcha.image.height", "50");
+	        // 验证码文本字符大小  默认为40
+	        properties.setProperty("kaptcha.textproducer.font.size", "40");
+	        //session key
+	        properties.setProperty("kaptcha.session.key", "kaptchaCode");
+	        // 验证码文本字符间距  默认为2  
+	        properties.setProperty("kaptcha.textproducer.char.spac", "35");
+	        //验证码文本字符长度  默认为5  
+	        properties.setProperty("kaptcha.textproducer.char.length", "4");
+	        //验证码文本字体样式  默认为new Font("Arial", 1, fontSize), new Font("Courier", 1, fontSize) 
+	        properties.setProperty("kaptcha.textproducer.font.names", "Arial,Courier");
+	        //验证码噪点颜色   默认为Color.BLACK  
+	        properties.setProperty("kaptcha.noise.color", "white");
+	        Config config = new Config(properties);
+	        defaultKaptcha.setConfig(config);
+	        return defaultKaptcha;
+	    }
+
+	    @Bean(name = "captchaProducerMath")
+	    public DefaultKaptcha getKaptchaBeanMath()
+	    {
+	        DefaultKaptcha defaultKaptcha = new DefaultKaptcha();
+	        Properties properties = new Properties();
+	        //是否有边框 默认为true 我们可以自己设置yes,no
+	        properties.setProperty("kaptcha.border", "yes");
+	        //边框颜色 默认为Color.BLACK
+	        properties.setProperty("kaptcha.border.color", "158,167,179");
+	        //验证码文本字符颜色 默认为Color.BLACK
+	        properties.setProperty("kaptcha.textproducer.font.color", "blue");
+	        //验证码图片宽度 默认为200
+	        properties.setProperty("kaptcha.image.width", "100");
+	        //验证码图片高度 默认为50
+	        properties.setProperty("kaptcha.image.height", "30");
+	        //验证码文本字符大小 默认为40
+	        properties.setProperty("kaptcha.textproducer.font.size", "30");
+	        //KAPTCHA_SESSION_KEY
+	        properties.setProperty("kaptcha.session.key", "kaptchaCodeMath");
+	        //验证码文本生成器
+	        properties.setProperty("kaptcha.textproducer.impl", "com.gyee.frame.common.support.KaptchaTextCreator");
+	        //验证码文本字符间距 默认为2
+	        properties.setProperty("kaptcha.textproducer.char.spac", "5");
+	        //验证码文本字符长度 默认为5
+	        properties.setProperty("kaptcha.textproducer.char.length", "6");
+	        //验证码文本字体样式 默认为new Font("Arial", 1, fontSize), new Font("Courier", 1, fontSize)
+	        properties.setProperty("kaptcha.textproducer.font.names", "Arial,Courier");
+	        //验证码噪点颜色 默认为Color.BLACK
+	        properties.setProperty("kaptcha.noise.color", "white");
+	        //干扰实现类
+	        properties.setProperty("kaptcha.noise.impl", "com.google.code.kaptcha.impl.NoNoise");
+	        //图片样式 水纹com.google.code.kaptcha.impl.WaterRipple 鱼眼com.google.code.kaptcha.impl.FishEyeGimpy 阴影com.google.code.kaptcha.impl.ShadowGimpy
+	        properties.setProperty("kaptcha.obscurificator.impl", "com.google.code.kaptcha.impl.ShadowGimpy");
+	        Config config = new Config(properties);
+	        defaultKaptcha.setConfig(config);
+	        return defaultKaptcha;
+	    }
+}

+ 99 - 0
web/health-hb/src/main/java/com/gyee/frame/common/conf/MybatisConfig.java

@@ -0,0 +1,99 @@
+package com.gyee.frame.common.conf;
+
+import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
+import com.gyee.frame.common.dataSources.DataSourceType;
+import com.gyee.frame.common.dataSources.DynamicDataSource;
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.mybatis.spring.SqlSessionFactoryBean;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+import org.springframework.core.io.Resource;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.jdbc.datasource.DataSourceTransactionManager;
+import org.springframework.transaction.PlatformTransactionManager;
+
+import javax.sql.DataSource;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Mybatis多数据源配置
+ * 参考文章:https://www.cnblogs.com/geekdc/p/10963476.html
+ * @ClassName: MybatisConfig
+ * @author gyee
+ * @date 2019-12-06 21:11
+ */
+@Configuration
+@MapperScan(basePackages = "com.gyee.frame.mapper")
+public class MybatisConfig {
+
+    @Bean(name = "master")
+    @ConfigurationProperties("spring.datasource.druid.master")
+    public DataSource masterDataSource()
+    {
+        return DruidDataSourceBuilder.create().build();
+    }
+
+    @Bean(name = "slave")
+    @ConfigurationProperties("spring.datasource.druid.slave")
+//    @ConditionalOnProperty(prefix = "spring.datasource.druid.slave", name = "enabled", havingValue = "true")
+    public DataSource slaveDataSource()
+    {
+        return DruidDataSourceBuilder.create().build();
+    }
+
+    @Bean(name = "ticket")
+    @ConfigurationProperties("spring.datasource.druid.ticket")
+//    @ConditionalOnProperty(prefix = "spring.datasource.druid.ticket", name = "enabled", havingValue = "true")
+    public DataSource ticketDataSource()
+    {
+        return DruidDataSourceBuilder.create().build();
+    }
+    @Bean(name = "dynamicDataSource")
+    @Primary
+    public DynamicDataSource dataSource(@Qualifier("master")DataSource masterDataSource, @Qualifier("slave")DataSource slaveDataSource)
+    {
+        Map<Object, Object> targetDataSources = new HashMap<>();
+        targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
+    	targetDataSources.put(DataSourceType.SLAVE.name(),slaveDataSource);
+        return new DynamicDataSource(masterDataSource(), targetDataSources);
+    }
+
+    @Bean(name = "dynamicDataSource")
+    @Primary
+    public DynamicDataSource dataSource(@Qualifier("master")DataSource masterDataSource, @Qualifier("slave")DataSource slaveDataSource, @Qualifier("ticket")DataSource ticketDataSource)
+    {
+        Map<Object, Object> targetDataSources = new HashMap<>();
+        targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
+        targetDataSources.put(DataSourceType.SLAVE.name(),slaveDataSource);
+        targetDataSources.put(DataSourceType.TICKET.name(),ticketDataSource);
+        return new DynamicDataSource(masterDataSource(), targetDataSources);
+    }
+
+    @Bean
+    public SqlSessionFactory sqlSessionFactory(DynamicDataSource dynamicDataSource) throws Exception {
+        SqlSessionFactoryBean factoryBean = new SqlSessionFactoryBean();
+        factoryBean.setDataSource(dynamicDataSource);
+//        factoryBean.setTypeAliasesPackage();
+        // 设置mapper.xml的位置路径
+        Resource[] resources = new PathMatchingResourcePatternResolver().getResources("classpath*:mybatis/*/*.xml");
+        factoryBean.setMapperLocations(resources);
+        return factoryBean.getObject();
+    }
+    
+    /**
+     * 配置@Transactional注解事务
+     * @param dynamicDataSource
+     * @return
+     * @author gyee
+     * @Date 2019年12月7日 上午11:31:33
+     */
+    @Bean
+    public PlatformTransactionManager transactionManager(DynamicDataSource dynamicDataSource){
+        return new DataSourceTransactionManager(dynamicDataSource);
+    }
+}

+ 34 - 0
web/health-hb/src/main/java/com/gyee/frame/common/conf/PageHelperConf.java

@@ -0,0 +1,34 @@
+package com.gyee.frame.common.conf;
+
+import java.util.Properties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import com.github.pagehelper.PageHelper;
+
+/**
+* 分页插件配置类
+* @ClassName: PageHelperConf
+* @Description: 这里用一句话描述这个类的作用
+* @author gyee
+* @date 2018年6月3日
+*
+ */
+@Configuration
+public class PageHelperConf {
+
+    /**
+     * 分页插件处理
+     * @return
+     */
+    @Bean
+    public PageHelper pageHelper() {
+        PageHelper pageHelper = new PageHelper();
+        Properties properties = new Properties();
+        properties.setProperty("offsetAsPageNum", "true");
+        properties.setProperty("rowBoundsWithCount", "true");
+        properties.setProperty("reasonable", "true");
+        properties.setProperty("dialect", "mysql");    //配置mysql数据库的方言
+        pageHelper.setProperties(properties);
+        return pageHelper;
+    }
+}

+ 83 - 0
web/health-hb/src/main/java/com/gyee/frame/common/conf/Swagger.java

@@ -0,0 +1,83 @@
+package com.gyee.frame.common.conf;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+import javax.annotation.Resource;
+
+/**
+* Swagger 配置文件
+* @ClassName: Swagger
+* @Description: 配置文件
+* @author gyee
+* @date 2018年6月3日
+*
+ */
+@Configuration(value="true")
+@EnableSwagger2 //启动swagger注解 启动服务,浏览器输入"http://localhost:8080/swagger-ui.html"
+public class Swagger  implements WebMvcConfigurer {
+
+
+	@Resource
+	private V2Config v2Config;
+
+	@Bean
+	public Docket createRestApi() {
+		return new Docket(DocumentationType.SWAGGER_2)
+				.host(v2Config.getSwaggerip())
+				// 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
+				.apiInfo(apiInfo())
+				// 设置哪些接口暴露给Swagger展示
+				.select()
+				 // 扫描所有有注解的api,用这种方式更灵活
+				.apis(RequestHandlerSelectors.basePackage("com.gyee.frame"))
+				// 扫描指定包中的swagger注解
+				//.apis(RequestHandlerSelectors.basePackage("com.gyee.frame.controller"))
+				// 扫描所有 .apis(RequestHandlerSelectors.any())
+				.paths(PathSelectors.any())
+				.build();
+	}
+	
+	private ApiInfo apiInfo() {
+		return new ApiInfoBuilder()
+				//设置标题
+				.title("Gyee_Frame_HF API文档")
+				//描述
+				.description("Gyee_Frame_NX项目")
+				 //作者信息
+                //.contact(new Contact(v2Config.getName(), null, V2Config.getEmail_account()))
+                //服务条款URL
+				.termsOfServiceUrl("")
+				//版本
+				.version("版本号:"+v2Config.getVersion())
+				.build();
+	}
+
+	@Override
+
+	public void addResourceHandlers(ResourceHandlerRegistry registry) {
+
+		// 解决静态资源无法访问
+
+		registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");
+
+		// 解决swagger无法访问
+
+		registry.addResourceHandler("/swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
+
+		// 解决swagger的js文件无法访问
+
+		registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
+
+	}
+
+}

+ 79 - 0
web/health-hb/src/main/java/com/gyee/frame/common/conf/TemperatureConfig.java

@@ -0,0 +1,79 @@
+package com.gyee.frame.common.conf;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * 预警配置
+ */
+@Component
+@ConfigurationProperties(prefix = "temperature")
+public class TemperatureConfig {
+
+
+    private static List<String> yyz;
+    private static List<String> clx;
+    private static List<String> fdj;
+    private static List<String> bj;
+    private static List<String> qt;
+    private static List<String> zz;
+    private static List<String> zd;
+
+    public static List<String> getYyz() {
+        return yyz;
+    }
+
+    public  void setYyz(List<String> yyz) {
+        this.yyz = yyz;
+    }
+
+    public static List<String> getClx() {
+        return clx;
+    }
+
+    public  void setClx(List<String> clx) {
+        this.clx = clx;
+    }
+
+    public static List<String> getFdj() {
+        return fdj;
+    }
+
+    public  void setFdj(List<String> fdj) {
+        this.fdj = fdj;
+    }
+
+    public static List<String> getBj() {
+        return bj;
+    }
+
+    public  void setBj(List<String> bj) {
+        this.bj = bj;
+    }
+
+    public static List<String> getQt() {
+        return qt;
+    }
+
+    public  void setQt(List<String> qt) {
+        this.qt = qt;
+    }
+
+    public static List<String> getZz() {
+        return zz;
+    }
+
+    public  void setZz(List<String> zz) {
+        this.zz = zz;
+    }
+
+    public  static List<String> getZd() {
+        return zd;
+    }
+
+    public  void setZd(List<String> zd) {
+        this.zd = zd;
+    }
+}

+ 56 - 0
web/health-hb/src/main/java/com/gyee/frame/common/conf/ThreadPoolTaskConfig.java

@@ -0,0 +1,56 @@
+package com.gyee.frame.common.conf;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+
+import java.util.concurrent.ThreadPoolExecutor;
+
+@Configuration
+public class ThreadPoolTaskConfig {
+    /**
+     *   默认情况下,在创建了线程池后,线程池中的线程数为0,当有任务来之后,就会创建一个线程去执行任务,
+     *	当线程池中的线程数目达到corePoolSize后,就会把到达的任务放到缓存队列当中;
+     *  当队列满了,就继续创建线程,当线程数量大于等于maxPoolSize后,开始使用拒绝策略拒绝
+     */
+
+    /** 核心线程数(默认线程数) */
+    private static final int corePoolSize = 100;
+    /** 最大线程数 */
+    private static final int maxPoolSize = 500;
+    /** 允许线程空闲时间(单位:默认为秒) */
+    private static final int keepAliveTime = 60;
+    /** 缓冲队列大小 */
+    private static final int queueCapacity = 500;
+    /** 允许等待最长时间 */
+    private static final int awaitTime = 10;
+    /** 线程池名前缀 */
+    private static final String threadNamePrefix = "GYEE-Thread-";
+
+    private ThreadPoolTaskExecutor executor;
+
+    public ThreadPoolTaskExecutor getExecutor(){
+        if (executor == null)
+            executor = taskExecutor();
+
+        return executor;
+    }
+
+
+    private ThreadPoolTaskExecutor taskExecutor(){
+        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
+        executor.setCorePoolSize(corePoolSize);
+        executor.setMaxPoolSize(maxPoolSize);
+        executor.setQueueCapacity(queueCapacity);
+        executor.setKeepAliveSeconds(keepAliveTime);
+        executor.setThreadNamePrefix(threadNamePrefix);
+        executor.setAwaitTerminationSeconds(awaitTime);
+
+        // 线程池对拒绝任务的处理策略
+        // CallerRunsPolicy:由调用线程(提交任务的线程)处理该任务
+        executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
+        // 初始化
+        executor.initialize();
+        return executor;
+    }
+
+}

+ 229 - 0
web/health-hb/src/main/java/com/gyee/frame/common/conf/V2Config.java

@@ -0,0 +1,229 @@
+package com.gyee.frame.common.conf;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * 读取项目相关配置
+ * 
+ * @author gyee
+ */
+@Component
+@ConfigurationProperties(prefix = "gyee")
+public class V2Config
+{
+    /** 项目名称 */
+    private String name;
+    /** 版本 */
+    private String version;
+    /** 版权年份 */
+    private String copyrightYear;
+    /** 上传路径 */
+    private static String defaultBaseDir;
+    /** 是否开启 上传static **/
+    private static String isstatic;
+    /** 开启存放静态文件夹后目录 **/
+    private static String isroot_dir;
+    /** 邮箱发送smtp */
+    private static String email_smtp;
+    /** 发送邮箱端口 */
+    private static String email_port;
+    /** 发送邮箱登录账号 */
+    private static String email_account;
+    /** 发送邮箱登录密码 */
+    private static String email_password;
+    /** 演示模式 **/
+    private static String demoEnabled;
+    /** 滚动验证码 **/
+    private static Boolean rollVerification;
+    /** 实时数据库 **/
+    private  static String realtimedataBase;
+    /**数据适配器网址 **/
+    private static String baseurl;
+    /** swaggerip指定IP **/
+    private  static  String swaggerip;
+    /** 小数位数 **/
+    private  static  Integer digit;
+    /** 气象采集指定IP **/
+    private  static  String weatherurl;
+    /** 区域公司key指定IP **/
+    private  static  String weatherqygs;
+    /** 海拔信息配置 **/
+    private static Map<String,Double> hbmaps;
+
+    /**测点初始码**/
+    private  static  String initialcode;
+
+    public static String getInitialcode() {
+        return initialcode;
+    }
+
+    public  void setInitialcode(String initialcode) {
+        V2Config.initialcode = initialcode;
+    }
+
+    public static Map<String, Double> getHbmaps() {
+        return hbmaps;
+    }
+
+    public  void setHbmaps(Map<String, Double> hbmaps) {
+        V2Config.hbmaps = hbmaps;
+    }
+
+    public static String getWeatherurl() {
+        return weatherurl;
+    }
+
+    public  void setWeatherurl(String weatherurl) {
+        V2Config.weatherurl = weatherurl;
+    }
+
+    public static String getWeatherqygs() {
+        return weatherqygs;
+    }
+
+    public  void setWeatherqygs(String weatherqygs) {
+        V2Config.weatherqygs = weatherqygs;
+    }
+
+    public static  Integer getDigit() {
+        return digit;
+    }
+
+    public  void setDigit(Integer digit) {
+        this.digit = digit;
+    }
+
+    public  static String getSwaggerip() {
+        return swaggerip;
+    }
+
+    public  void setSwaggerip(String swaggerip) {
+        this.swaggerip = swaggerip;
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    public String getVersion()
+    {
+        return version;
+    }
+
+    public void setVersion(String version)
+    {
+        this.version = version;
+    }
+
+    public String getCopyrightYear()
+    {
+        return copyrightYear;
+    }
+
+    public void setCopyrightYear(String copyrightYear)
+    {
+        this.copyrightYear = copyrightYear;
+    }
+
+
+	public static String getDefaultBaseDir() {
+		return defaultBaseDir;
+	}
+
+	public  void setDefaultBaseDir(String defaultBaseDir) {
+		V2Config.defaultBaseDir = defaultBaseDir;
+	}
+
+	public static String getIsstatic() {
+		return isstatic;
+	}
+
+	public  void setIsstatic(String isstatic) {
+
+        V2Config.isstatic = isstatic;
+	}
+
+	public static String getIsroot_dir() {
+		return isroot_dir;
+	}
+
+	public void setIsroot_dir(String isroot_dir) {
+
+        V2Config.isroot_dir = isroot_dir;
+	}
+
+	public static String getEmail_smtp() {
+		return email_smtp;
+	}
+
+	public void setEmail_smtp(String email_smtp) {
+		V2Config.email_smtp = email_smtp;
+	}
+
+	public static String getEmail_port() {
+		return email_port;
+	}
+
+	public void setEmail_port(String email_port) {
+		V2Config.email_port = email_port;
+	}
+
+	public static String getEmail_account() {
+		return email_account;
+	}
+
+	public void setEmail_account(String email_account) {
+		V2Config.email_account = email_account;
+	}
+
+	public static String getEmail_password() {
+		return email_password;
+	}
+
+	public void setEmail_password(String email_password) {
+		V2Config.email_password = email_password;
+	}
+
+	public static String getDemoEnabled() {
+		return demoEnabled;
+	}
+
+	public void setDemoEnabled(String demoEnabled) {
+		V2Config.demoEnabled = demoEnabled;
+	}
+
+	public static Boolean getRollVerification() {
+		return rollVerification;
+	}
+
+	public void setRollVerification(Boolean rollVerification) {
+		V2Config.rollVerification = rollVerification;
+	}
+
+
+
+
+    public static String getRealtimedataBase() {
+        return realtimedataBase;
+    }
+
+    public  void setRealtimedataBase(String realtimedataBase) {
+        V2Config.realtimedataBase = realtimedataBase;
+    }
+    public static String getBaseurl() {
+        return baseurl;
+    }
+
+    public  void setBaseurl(String baseurl) {
+        V2Config.baseurl = baseurl;
+    }
+}

+ 27 - 0
web/health-hb/src/main/java/com/gyee/frame/common/conf/ZmConfig.java

@@ -0,0 +1,27 @@
+package com.gyee.frame.common.conf;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 预警配置
+ */
+@Component
+@ConfigurationProperties(prefix = "zmconfig")
+public class ZmConfig {
+
+
+    private static Map<String,List<String>> maps;
+
+
+    public static Map<String, List<String>> getMaps() {
+        return maps;
+    }
+
+    public void setMaps(Map<String, List<String>> maps) {
+        this.maps = maps;
+    }
+}

+ 45 - 0
web/health-hb/src/main/java/com/gyee/frame/common/conf/monitor/LeaderConfig.java

@@ -0,0 +1,45 @@
+package com.gyee.frame.common.conf.monitor;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.context.annotation.PropertySources;
+import org.springframework.stereotype.Component;
+
+
+@Component
+@PropertySources({
+        @PropertySource("classpath:config/leader.properties"),
+})
+public class LeaderConfig {
+
+    @Value("${Leader.FDL}")
+    private String FDL;
+    @Value("${Leader.FS}")
+    private String FS;
+    @Value("${Leader.GL}")
+
+    private String GL;
+    public String getFDL() {
+        return FDL;
+    }
+
+    public void setFDL(String FDL) {
+        this.FDL = FDL;
+    }
+
+    public String getFS() {
+        return FS;
+    }
+
+    public void setFS(String FS) {
+        this.FS = FS;
+    }
+
+    public String getGL() {
+        return GL;
+    }
+
+    public void setGL(String GL) {
+        this.GL = GL;
+    }
+}

+ 45 - 0
web/health-hb/src/main/java/com/gyee/frame/common/conf/monitor/StatusConfig.java

@@ -0,0 +1,45 @@
+package com.gyee.frame.common.conf.monitor;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.context.annotation.PropertySources;
+import org.springframework.stereotype.Component;
+
+
+@Component
+@PropertySources({
+        @PropertySource("classpath:config/status.properties"),
+})
+public class StatusConfig {
+
+    @Value("${Status.FDL}")
+    private String FDL;
+    @Value("${Status.FS}")
+    private String FS;
+    @Value("${Status.GL}")
+
+    private String GL;
+    public String getFDL() {
+        return FDL;
+    }
+
+    public void setFDL(String FDL) {
+        this.FDL = FDL;
+    }
+
+    public String getFS() {
+        return FS;
+    }
+
+    public void setFS(String FS) {
+        this.FS = FS;
+    }
+
+    public String getGL() {
+        return GL;
+    }
+
+    public void setGL(String GL) {
+        this.GL = GL;
+    }
+}

+ 21 - 0
web/health-hb/src/main/java/com/gyee/frame/common/dataSources/DataSource.java

@@ -0,0 +1,21 @@
+package com.gyee.frame.common.dataSources;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 自定义注解,用于类或方法上,优先级:方法>类
+ * @ClassName: DataSource
+ * @author gyee
+ * @date 2019-12-06 21:15
+ */
+@Target({ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface DataSource {
+	/**
+     * 切换数据源名称
+     */
+	DataSourceType value() default DataSourceType.MASTER;
+}

+ 77 - 0
web/health-hb/src/main/java/com/gyee/frame/common/dataSources/DataSourceAspect.java

@@ -0,0 +1,77 @@
+package com.gyee.frame.common.dataSources;
+
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.springframework.core.annotation.Order;
+import org.springframework.stereotype.Component;
+
+import com.gyee.frame.util.StringUtils;
+
+import java.lang.reflect.Method;
+/**
+ * 多数据源处理
+ * @ClassName: DataSourceAspect
+ * @author gyee
+ * @date 2019-12-07 18:40
+ */
+@Aspect
+@Component
+@Order(1)
+//@EnableAsync
+public class DataSourceAspect {
+	//private static final Logger log = LoggerFactory.getLogger(DataSourceAspect.class);
+
+	@Pointcut("@annotation(com.gyee.frame.common.dataSources.DataSource)")
+    public void dsPointCut()
+    {
+
+    }
+
+	@Around("dsPointCut()")
+    public Object around(ProceedingJoinPoint point) throws Throwable
+    {
+        MethodSignature signature = (MethodSignature) point.getSignature();
+
+        Method method = signature.getMethod();
+
+        DataSource dataSource = method.getAnnotation(DataSource.class);
+
+        if (null!=dataSource)
+        {
+            DataSourceContextHolder.setDataSource(dataSource.value().name());
+        }
+
+        try
+        {
+            return point.proceed();
+        }
+        finally
+        {
+            // 销毁数据源 在执行方法之后
+        	DataSourceContextHolder.clearDataSource();
+        }
+    }
+
+	 /**
+     * 获取需要切换的数据源
+     */
+    public DataSource getDataSource(ProceedingJoinPoint point)
+    {
+        MethodSignature signature = (MethodSignature) point.getSignature();
+        Class<? extends Object> targetClass = point.getTarget().getClass();
+        DataSource targetDataSource = targetClass.getAnnotation(DataSource.class);
+        if (StringUtils.isNotNull(targetDataSource))
+        {
+            return targetDataSource;
+        }
+        else
+        {
+            Method method = signature.getMethod();
+            DataSource dataSource = method.getAnnotation(DataSource.class);
+            return dataSource;
+        }
+    }
+}

+ 50 - 0
web/health-hb/src/main/java/com/gyee/frame/common/dataSources/DataSourceContextHolder.java

@@ -0,0 +1,50 @@
+package com.gyee.frame.common.dataSources;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * 动态数据源上下文管理:设置数据源,获取数据源,清除数据源
+ * @ClassName: DataSourceContextHolder
+ * @author gyee
+ * @date 2019-12-06 21:08
+ */
+public class DataSourceContextHolder {
+	private static final Logger log = LoggerFactory.getLogger(DataSourceContextHolder.class);
+   /**
+    * 使用ThreadLocal维护变量,ThreadLocal为每个使用该变量的线程提供独立的变量副本,
+    * 所以每一个线程都可以独立地改变自己的副本,而不会影响其它线程所对应的副本。
+    */
+    private static final ThreadLocal<String> CONTEXT_HOLDER = new ThreadLocal<>();
+
+    /**
+     * 设置数据源
+     * @param type
+     * @author gyee
+     * @Date 2019年12月7日 下午6:38:55
+     */
+    public static void setDataSource(String type){
+
+        log.info("当前使用的数据源为:{}", type);
+    	CONTEXT_HOLDER.set(type);
+    }
+
+    /**
+     * 获得数据源的变量
+     * @return
+     * @author gyee
+     * @Date 2019年12月7日 下午6:39:00
+     */
+    public static String getDataSource(){
+        return CONTEXT_HOLDER.get();
+    }
+
+    /**
+     * 清除数据源
+     * @author gyee
+     * @Date 2019年12月7日 下午6:39:06
+     */
+    public static void clearDataSource(){
+    	CONTEXT_HOLDER.remove();
+    }
+}

+ 13 - 0
web/health-hb/src/main/java/com/gyee/frame/common/dataSources/DataSourceType.java

@@ -0,0 +1,13 @@
+package com.gyee.frame.common.dataSources;
+
+/**
+ * 列出所有数据源
+ * @ClassName: DataSourceType
+ * @author gyee
+ * @date 2019-12-06 21:02
+ */
+public enum DataSourceType {
+	MASTER,
+	SLAVE,
+	TICKET
+}

+ 27 - 0
web/health-hb/src/main/java/com/gyee/frame/common/dataSources/DynamicDataSource.java

@@ -0,0 +1,27 @@
+package com.gyee.frame.common.dataSources;
+
+import java.util.Map;
+import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
+
+/**
+ * 动态数据源
+ * @ClassName: DynamicDataSource
+ * @author gyee
+ * @date 2019-12-07 18:39
+ */
+public class DynamicDataSource extends AbstractRoutingDataSource {
+	
+	public DynamicDataSource(javax.sql.DataSource dataSource, Map<Object, Object> targetDataSources)
+    {
+        super.setDefaultTargetDataSource(dataSource);
+        super.setTargetDataSources(targetDataSources);
+        super.afterPropertiesSet();
+    }
+
+	@Override
+	protected Object determineCurrentLookupKey() {
+		
+		return DataSourceContextHolder.getDataSource();
+	}
+
+}

+ 104 - 0
web/health-hb/src/main/java/com/gyee/frame/common/domain/AjaxResult.java

@@ -0,0 +1,104 @@
+package com.gyee.frame.common.domain;
+
+import java.util.HashMap;
+
+/**
+* @ClassName: AjaxResult
+* @Description: ajax操作消息提醒
+* @author gyee
+* @date 2018年8月18日
+*
+ */
+public class AjaxResult extends HashMap<String, Object>
+{
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 初始化一个新创建的 Message 对象
+     */
+    public AjaxResult()
+    {
+    }
+
+    /**
+     * 返回错误消息
+     * 
+     * @return 错误消息
+     */
+    public static AjaxResult error()
+    {
+        return error(1, "操作失败");
+    }
+
+    /**
+     * 返回错误消息
+     * 
+     * @param msg 内容
+     * @return 错误消息
+     */
+    public static AjaxResult error(String msg)
+    {
+        return error(500, msg);
+    }
+
+    /**
+     * 返回错误消息
+     * 
+     * @param code 错误码
+     * @param msg 内容
+     * @return 错误消息
+     */
+    public static AjaxResult error(int code, String msg)
+    {
+        AjaxResult json = new AjaxResult();
+        json.put("code", code);
+        json.put("msg", msg);
+        return json;
+    }
+
+    /**
+     * 返回成功消息
+     * 
+     * @param msg 内容
+     * @return 成功消息
+     */
+    public static AjaxResult success(String msg)
+    {
+        AjaxResult json = new AjaxResult();
+        json.put("msg", msg);
+        json.put("code", 200);
+        return json;
+    }
+    
+    /**
+     * 返回成功消息
+     * 
+     * @return 成功消息
+     */
+    public static AjaxResult success()
+    {
+        return AjaxResult.success("操作成功");
+    }
+    
+    public static AjaxResult successData(int code, Object value){
+    	 AjaxResult json = new AjaxResult();
+    	 json.put("code", code);
+         json.put("data", value);
+         return json;
+    }
+   
+    
+    /**
+     * 返回成功消息
+     * 
+     * @param key 键值
+     * @param value 内容
+     * @return 成功消息
+     */
+    @Override
+    public AjaxResult put(String key, Object value)
+    {
+        super.put(key, value);
+        return this;
+    }
+}

+ 80 - 0
web/health-hb/src/main/java/com/gyee/frame/common/druid/RemoveDruidAdConfig.java

@@ -0,0 +1,80 @@
+package com.gyee.frame.common.druid;
+
+import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
+import com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties;
+import com.alibaba.druid.util.Utils;
+import org.springframework.boot.autoconfigure.AutoConfigureAfter;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
+import org.springframework.boot.web.servlet.FilterRegistrationBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import javax.servlet.*;
+import java.io.IOException;
+
+
+/**
+ * 类名称:RemoveDruidAdConfig
+ * 类描述: 去除druid底部的广告配置类
+ *
+ * @author: taohongchao
+ * 创建时间:2019/2/15 13:14
+ * Version 1.0
+ */
+
+@Configuration
+@ConditionalOnWebApplication
+@AutoConfigureAfter(DruidDataSourceAutoConfigure.class)
+@ConditionalOnProperty(name = "spring.datasource.druid.stat-view-servlet.enabled", havingValue = "true", matchIfMissing = true)
+public class RemoveDruidAdConfig {
+
+
+    /**
+     * 方法名: removeDruidAdFilterRegistrationBean
+     * 方法描述:  除去页面底部的广告
+     * @param properties
+     * @return org.springframework.boot.web.servlet.FilterRegistrationBean
+     * @throws
+     */
+    @SuppressWarnings("rawtypes")
+	@Bean
+    public FilterRegistrationBean removeDruidAdFilterRegistrationBean(DruidStatProperties properties) {
+        // 获取web监控页面的参数
+        DruidStatProperties.StatViewServlet config = properties.getStatViewServlet();
+        // 提取common.js的配置路径
+        String pattern = config.getUrlPattern() != null ? config.getUrlPattern() : "/druid/*";
+        String commonJsPattern = pattern.replaceAll("\\*", "js/common.js");
+
+        final String filePath = "support/http/resources/js/common.js";
+
+        //创建filter进行过滤
+        Filter filter = new Filter() {
+            @Override
+            public void init(FilterConfig filterConfig) throws ServletException {
+            }
+
+            @Override
+            public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
+                chain.doFilter(request, response);
+                // 重置缓冲区,响应头不会被重置
+                response.resetBuffer();
+                // 获取common.js
+                String text = Utils.readFromResource(filePath);
+                // 正则替换banner, 除去底部的广告信息
+                text = text.replaceAll("<a.*?banner\"></a><br/>", "");
+                text = text.replaceAll("powered.*?shrek.wang</a>", "");
+                response.getWriter().write(text);
+            }
+
+            @Override
+            public void destroy() {
+            }
+        };
+        FilterRegistrationBean<Filter> registrationBean = new FilterRegistrationBean<Filter>();
+        registrationBean.setFilter(filter);
+        registrationBean.addUrlPatterns(commonJsPattern);
+        return registrationBean;
+    }
+}
+

+ 141 - 0
web/health-hb/src/main/java/com/gyee/frame/common/exception/GlobalExceptionResolver.java

@@ -0,0 +1,141 @@
+package com.gyee.frame.common.exception;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.shiro.authz.AuthorizationException;
+import org.apache.shiro.authz.UnauthenticatedException;
+import org.apache.shiro.authz.UnauthorizedException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.validation.BindException;
+import org.springframework.web.HttpRequestMethodNotSupportedException;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+import org.springframework.web.servlet.ModelAndView;
+import com.gyee.frame.common.domain.AjaxResult;
+import com.gyee.frame.common.exception.demo.DemoModeException;
+import com.gyee.frame.util.ServletUtils;
+import org.thymeleaf.exceptions.TemplateInputException;
+
+/**
+ * 全局异常处理
+ * @author gyee
+ * @date: 2018年9月9日 下午10:52:55
+ */
+@RestControllerAdvice
+public class GlobalExceptionResolver{
+	private static Logger logger = LoggerFactory.getLogger(GlobalExceptionResolver.class);
+	
+	
+	
+	 /**
+     * 权限校验失败 如果请求为ajax返回json,普通请求跳转页面
+     */
+    @ExceptionHandler(AuthorizationException.class)
+    public Object handleAuthorizationException(HttpServletRequest request, AuthorizationException e)
+    {
+		//开发环境打印异常,正式环境请注销
+    	logger.error(" 权限校验异常》》"+e.getMessage(), e);
+        if (ServletUtils.isAjaxRequest(request))
+        {
+            return AjaxResult.error(e.getMessage());
+        }
+        else
+        {
+        	ModelAndView mv;
+        	//shiro异常拦截 
+          if(e instanceof UnauthorizedException){
+          	//未授权异常
+              mv = new ModelAndView("/error/403");
+              return mv;
+          }else if(e instanceof UnauthenticatedException){
+          	//未认证异常
+              mv = new ModelAndView("/error/403");
+              return mv;
+          }
+          else {
+              mv = new ModelAndView();
+              return mv;
+  
+          }
+        }
+    }
+	
+	
+   
+    
+    /**
+     * 自定义验证异常
+     */
+    @ExceptionHandler(BindException.class)
+    public AjaxResult validatedBindException(BindException e)
+    {
+    	logger.error("自定义验证异常", e);
+        String message = e.getAllErrors().get(0).getDefaultMessage();
+        return AjaxResult.error(message);
+    }
+    
+    
+    /**
+     * 请求方式不支持
+     */
+    @ExceptionHandler({ HttpRequestMethodNotSupportedException.class })
+    public AjaxResult handleException(HttpRequestMethodNotSupportedException e)
+    {
+    	logger.error("请求方式不支持异常:", e);
+        return AjaxResult.error("不支持' " + e.getMethod() + "'请求");
+    }
+  
+    
+    
+
+    /**
+     * 系统异常
+     */
+    @ExceptionHandler(Exception.class) 
+    public ModelAndView handle(Exception e){ 
+    	logger.error("系统异常:", e);
+	    ModelAndView mv = new ModelAndView(); 
+	    mv.addObject("message", e.getMessage()); 
+	    mv.setViewName("/error/999"); 
+	    return mv; 
+    }
+    
+    /**
+     * 演示模式异常
+     */
+    @ExceptionHandler(DemoModeException.class)
+    public AjaxResult demoModeException(DemoModeException e)
+    {
+        return AjaxResult.error("演示模式,不允许操作");
+    }
+    
+    /**
+     * 拦截未知的运行时异常
+     */
+    @ExceptionHandler(RuntimeException.class)
+    public AjaxResult notFount(RuntimeException e)
+    {
+    	logger.error("运行时异常:", e);
+        return AjaxResult.error("运行时异常:" + e.getMessage());
+    }
+
+    /**
+     * 拦截自定义异常
+     */
+    @ExceptionHandler(QiNiuException.class)
+    public AjaxResult qiniuException(QiNiuException e)
+    {
+        logger.error(e.getMessage());
+        return AjaxResult.error(e.getCode(), e.getMessage());
+    }
+
+
+    @ExceptionHandler(TemplateInputException.class)
+    public AjaxResult templateException(TemplateInputException e)
+    {
+        logger.error(e.getMessage());
+        return AjaxResult.error(e.getMessage());
+    }
+
+}

+ 65 - 0
web/health-hb/src/main/java/com/gyee/frame/common/exception/QiNiuException.java

@@ -0,0 +1,65 @@
+package com.gyee.frame.common.exception;
+
+import com.gyee.frame.common.exception.enums.QiNiuErrorEnum;
+
+/**
+ * QiNiuException
+ *
+ * @author bobbi
+ * @date 2018/10/07 13:54
+ * @email 571002217@qq.com
+ * @description 自定义异常
+ */
+public class QiNiuException extends RuntimeException{
+	private static final long serialVersionUID = 1L;
+	private String msg;
+    private int code = 500;
+
+    public QiNiuException(){
+        super(QiNiuErrorEnum.UNKNOWN.getMsg());
+        this.msg= QiNiuErrorEnum.UNKNOWN.getMsg();
+    }
+
+
+    public QiNiuException(QiNiuErrorEnum eEnum, Throwable e){
+        super(eEnum.getMsg(),e);
+        this.msg=eEnum.getMsg();
+        this.code=eEnum.getCode();
+    }
+
+    public QiNiuException(QiNiuErrorEnum eEnum){
+        this.msg=eEnum.getMsg();
+        this.code=eEnum.getCode();
+    }
+
+    public QiNiuException(String exception){
+       this.msg=exception;
+    }
+
+
+	public String getMsg() {
+		return msg;
+	}
+
+
+	public void setMsg(String msg) {
+		this.msg = msg;
+	}
+
+
+	public int getCode() {
+		return code;
+	}
+
+
+	public void setCode(int code) {
+		this.code = code;
+	}
+
+	public QiNiuException(String msg, int code) {
+		super();
+		this.msg = msg;
+		this.code = code;
+	}
+    
+}

+ 17 - 0
web/health-hb/src/main/java/com/gyee/frame/common/exception/demo/DemoModeException.java

@@ -0,0 +1,17 @@
+package com.gyee.frame.common.exception.demo;
+
+/**
+ * 演示模式异常
+* @ClassName: DemoModeException
+* @author gyee
+* @date 2019-11-08 15:45
+*
+ */
+public class DemoModeException extends RuntimeException
+{
+    private static final long serialVersionUID = 1L;
+
+    public DemoModeException()
+    {
+    }
+}

+ 55 - 0
web/health-hb/src/main/java/com/gyee/frame/common/exception/enums/QiNiuErrorEnum.java

@@ -0,0 +1,55 @@
+package com.gyee.frame.common.exception.enums;
+
+/**
+ * QiNiuErrorEnum
+ * @description error类型枚举类
+ */
+public enum QiNiuErrorEnum {
+
+    // 系统错误
+    UNKNOWN(500,"系统内部错误,请联系管理员"),
+    PATH_NOT_FOUND(404,"路径不存在,请检查路径"),
+    NO_AUTH(403,"没有权限,请联系管理员"),
+    DUPLICATE_KEY(501,"数据库中已存在该记录"),
+    TOKEN_GENERATOR_ERROR(502,"token生成失败"),
+    NO_UUID(503,"uuid为空"),
+    SQL_ILLEGAL(504,"sql非法"),
+	TEMPLATE_NO_SUPPORT(505,"模板不支持"),
+
+    //用户权限错误
+    INVALID_TOKEN(1001,"token不合法"),
+
+    //七牛OSS错误
+    OSS_CONFIG_ERROR(10050,"七牛配置信息错误"),
+    OSS_UPLOAD_ERROR(10051,"OSSBookNote上传失败"),
+
+	//数据库错误
+	ERROR_CONNECT(4005, "数据库连接异常"),
+	ERROR_DATA(4006, "数据查询失败");
+
+    private int code;
+    private String msg;
+	public int getCode() {
+		return code;
+	}
+	public void setCode(int code) {
+		this.code = code;
+	}
+	public String getMsg() {
+		return msg;
+	}
+	public void setMsg(String msg) {
+		this.msg = msg;
+	}
+	/**
+	 * @param code
+	 * @param msg
+	 * @author gyee
+	 * @Date 2019年11月20日 下午9:28:34
+	 */
+	private QiNiuErrorEnum(int code, String msg) {
+		this.code = code;
+		this.msg = msg;
+	}
+	
+}

+ 41 - 0
web/health-hb/src/main/java/com/gyee/frame/common/exception/file/FileNameLengthLimitExceededException.java

@@ -0,0 +1,41 @@
+package com.gyee.frame.common.exception.file;
+
+import org.apache.commons.fileupload.FileUploadException;
+
+/**
+ * 文件名超长 误异常类
+ * 
+ * @author gyee
+ */
+public class FileNameLengthLimitExceededException extends FileUploadException
+{
+
+    private static final long serialVersionUID = 1L;
+    private int length;
+    private int maxLength;
+    private String filename;
+
+    public FileNameLengthLimitExceededException(String filename, int length, int maxLength)
+    {
+        super("file name : [" + filename + "], length : [" + length + "], max length : [" + maxLength + "]");
+        this.length = length;
+        this.maxLength = maxLength;
+        this.filename = filename;
+    }
+
+    public String getFilename()
+    {
+        return filename;
+    }
+
+    public int getLength()
+    {
+        return length;
+    }
+
+    public int getMaxLength()
+    {
+        return maxLength;
+    }
+
+}

+ 73 - 0
web/health-hb/src/main/java/com/gyee/frame/common/exception/file/InvalidExtensionException.java

@@ -0,0 +1,73 @@
+package com.gyee.frame.common.exception.file;
+
+import java.util.Arrays;
+import org.apache.commons.fileupload.FileUploadException;
+
+/**
+ * 文件上传 误异常类
+ * 
+ * @author gyee
+ */
+public class InvalidExtensionException extends FileUploadException
+{
+
+    private static final long serialVersionUID = 1L;
+
+    private String[] allowedExtension;
+    private String extension;
+    private String filename;
+
+    public InvalidExtensionException(String[] allowedExtension, String extension, String filename)
+    {
+        super("filename : [" + filename + "], extension : [" + extension + "], allowed extension : [" + Arrays.toString(allowedExtension) + "]");
+        this.allowedExtension = allowedExtension;
+        this.extension = extension;
+        this.filename = filename;
+    }
+
+    public String[] getAllowedExtension()
+    {
+        return allowedExtension;
+    }
+
+    public String getExtension()
+    {
+        return extension;
+    }
+
+    public String getFilename()
+    {
+        return filename;
+    }
+
+    public static class InvalidImageExtensionException extends InvalidExtensionException
+    {
+        private static final long serialVersionUID = 1L;
+
+        public InvalidImageExtensionException(String[] allowedExtension, String extension, String filename)
+        {
+            super(allowedExtension, extension, filename);
+        }
+    }
+
+    public static class InvalidFlashExtensionException extends InvalidExtensionException
+    {
+        private static final long serialVersionUID = 1L;
+
+        public InvalidFlashExtensionException(String[] allowedExtension, String extension, String filename)
+        {
+            super(allowedExtension, extension, filename);
+        }
+    }
+
+    public static class InvalidMediaExtensionException extends InvalidExtensionException
+    {
+        private static final long serialVersionUID = 1L;
+
+        public InvalidMediaExtensionException(String[] allowedExtension, String extension, String filename)
+        {
+            super(allowedExtension, extension, filename);
+        }
+    }
+
+}

+ 37 - 0
web/health-hb/src/main/java/com/gyee/frame/common/feign/IAdapterService.java

@@ -0,0 +1,37 @@
+package com.gyee.frame.common.feign;
+
+import com.alibaba.fastjson.JSONObject;
+import com.gyee.frame.model.custom.export.TsPointData;
+import com.gyee.frame.util.golden.timeseries.TsData;
+import feign.Headers;
+import feign.Param;
+import feign.RequestLine;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.List;
+
+
+public interface IAdapterService {
+
+
+    @Headers({"Content-Type: application/json", "Accept: application/json"})
+    @RequestLine("GET /ts/latest?keys={points}")
+    JSONObject getLatest(@Param(value = "points") String points);
+
+
+    @Headers({"Content-Type: application/json", "Accept: application/json"})
+    @RequestLine("GET /ts/history/snap?tagName={tagName}&startTs={startTs}&endTs={endTs}&interval={interval}")
+    List<TsPointData> getHistorySnap(@Param(value = "tagName") String tagName, @Param(value = "startTs") long startTs,
+                                     @Param(value = "endTs") long endTs, @Param(value = "interval") Integer interval);
+
+    @Headers({"Content-Type: application/json", "Accept: application/json"})
+    @RequestLine("GET /ts/history/raw?tagName={tagName}&startTs={startTs}&endTs={endTs}")
+    List<TsPointData> getHistoryRaw(@Param(value = "tagName") String tagName, @Param(value = "startTs") long startTs,
+                                     @Param(value = "endTs") long endTs);
+
+    @Headers({"Content-Type: application/json", "Accept: application/json"})
+    @RequestLine("GET /ts/history/section?tagNames={tagNames}&ts={ts}")
+    List<TsPointData> getHistorySection(@Param(value = "tagNames") String tagNames, @Param(value = "ts") long ts);
+
+}

+ 30 - 0
web/health-hb/src/main/java/com/gyee/frame/common/feign/RemoteServiceBuilder.java

@@ -0,0 +1,30 @@
+package com.gyee.frame.common.feign;
+
+import feign.Feign;
+import feign.Request;
+import feign.Retryer;
+import feign.jackson.JacksonDecoder;
+import feign.jackson.JacksonEncoder;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+
+@Slf4j
+@Configuration
+public class RemoteServiceBuilder {
+
+    @Value("${goldenUrl:http://10.155.32.4:8011}")
+    private String shardingUrlString;
+
+    @Bean
+    public IAdapterService ShardingService() {
+        return Feign.builder()
+                .encoder(new JacksonEncoder())
+                .decoder(new JacksonDecoder())
+                .options(new Request.Options(5000, 600000))
+                .retryer(new Retryer.Default(10000, 10000, 3))
+                .target(IAdapterService.class, shardingUrlString);
+    }
+}

+ 83 - 0
web/health-hb/src/main/java/com/gyee/frame/common/file/ClassUtil.java

@@ -0,0 +1,83 @@
+package com.gyee.frame.common.file;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Author:
+ * @Date:
+ * @Description:关于类的操作的工具类
+ */
+public final class ClassUtil {
+
+    private ClassUtil() {
+        throw new Error("工具类不允许实例化!");
+    }
+
+    /**
+     * 获取类属性
+     * @param targetObj 要获取属性的类
+     * @return 含有类属性的集合
+     */
+    public static Field[] getClassAttribute(Object targetObj){
+
+        Class<?> objectClass = targetObj.getClass();
+        return objectClass.getDeclaredFields();
+
+    }
+
+    /**
+     * 获取对象的所有get或set方法
+     * @param targetObj 要获取属性的类
+     * @param methodKeyword get或者set关键字
+     * @return 含有类get或set方法的集合
+     */
+    public static List<Method> getMethod(Object targetObj,String methodKeyword){
+        List<Method> methodList = new ArrayList<>();
+
+        Class<?> objectClass = targetObj.getClass();
+
+        Field[] field = objectClass.getDeclaredFields();
+        for (int i = 0;i<field.length;i++){
+
+            if(!field[i].getName().equals("serialVersionUID"))
+            {
+
+                //获取属性名并组装方法名
+                String fieldName = field[i].getName();
+                String getMethodName = methodKeyword
+                        + fieldName.substring(0, 1).toUpperCase()
+                        + fieldName.substring(1);
+
+                try {
+                    Method method = objectClass.getMethod(getMethodName,new Class[]{});
+                    methodList.add(method);
+                } catch (NoSuchMethodException e) {
+                    e.printStackTrace();
+                }
+
+            }
+        }
+        return methodList;
+    }
+
+    /**
+     * 获取对象的所有get方法
+     * @param targetObj 要获取属性的类
+     * @return 含有类方法的集合
+     */
+    public static List<Method> getMethodGet(Object targetObj){
+        return getMethod(targetObj,"get");
+    }
+
+    /**
+     * 获取对象的所有set方法
+     * @param targetObj 要获取属性的类
+     * @return 含有类方法的集合
+     */
+    public static List<Method> getMethodSet(Object targetObj){
+        return getMethod(targetObj,"set");
+    }
+}

+ 272 - 0
web/health-hb/src/main/java/com/gyee/frame/common/file/ExcelExport.java

@@ -0,0 +1,272 @@
+package com.gyee.frame.common.file;
+
+import com.gyee.frame.util.StringUtils;
+import org.apache.poi.hssf.usermodel.HSSFCellStyle;
+import org.apache.poi.hssf.usermodel.HSSFFont;
+import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.CellType;
+import org.apache.poi.ss.usermodel.HorizontalAlignment;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.util.CellRangeAddress;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Author:
+ * @Date:
+ * @Description:Excel导出工具类,依赖于ClassUtil工具类
+ */
+public final class ExcelExport {
+
+    /**
+     * 将传入的数据导出excel表并下载
+     * @param response 返回的HttpServletResponse
+     * @param importlist 要导出的对象的集合
+     * @param attributeNames 含有每个对象属性在excel表中对应的标题字符串的数组(请按对象中属性排序调整字符串在数组中的位置)
+     * @param heardName 导出文件 标题名称
+     * @param cnt 合并单元格数 (一般标题字符串的数组长度-1)
+     */
+    public static void export(HttpServletResponse response, List<?> importlist, String[] attributeNames,
+                              String heardName, int cnt ) {
+        //获取数据集
+        List<?> datalist = importlist;
+
+        //声明一个工作薄
+        HSSFWorkbook workbook = new HSSFWorkbook();
+        //生成一个表格
+        HSSFSheet sheet = workbook.createSheet();
+        //设置表格默认列宽度为15个字节
+        sheet.setDefaultColumnWidth((short) 18);
+        //用于设置表格字体
+        HSSFCellStyle style = workbook.createCellStyle();
+
+        //获取字段名数组
+        String[] tableAttributeName = attributeNames;
+        //获取对象属性
+        Field[] fields = ClassUtil.getClassAttribute(importlist.get(0));
+        //获取对象get方法
+        List<Method> methodList = ClassUtil.getMethodGet(importlist.get(0));
+
+        //设置标题样式
+        HSSFCellStyle headerStyle = workbook.createCellStyle();
+        HSSFFont headerFont = workbook.createFont();
+        headerFont.setFontHeightInPoints((short) 14);
+        headerFont.setBold(true);
+        headerStyle.setAlignment(HorizontalAlignment.CENTER);
+        headerStyle.setFont(headerFont);
+        CellRangeAddress cra0 = new CellRangeAddress(0, 1, 0, cnt);// 合并单元格
+        sheet.addMergedRegion(cra0);
+        //创建标标题题
+        Row row = sheet.createRow(0);
+        Cell cell1 = row.createCell(0);
+        cell1.setCellValue(heardName);
+        cell1.setCellStyle(headerStyle);
+
+        // 设置字体样式
+        HSSFFont titleFont = workbook.createFont();
+        titleFont.setBold(true);
+        titleFont.setFontHeightInPoints((short) 10);
+
+        style.setFont(titleFont);
+        style.setAlignment(HorizontalAlignment.CENTER);
+        //循环字段名数组,创建标题行
+        row = sheet.createRow(2);
+        for (int j = 0; j< tableAttributeName.length; j++){
+            //创建列
+            Cell cell = row.createCell(j);
+            cell.setCellStyle(style);
+            //设置单元类型为String
+            cell.setCellType(CellType.STRING);
+            cell.setCellValue(transCellType(tableAttributeName[j]));
+        }
+        //创建普通行
+        for (int i = 0;i<datalist.size();i++){
+            //因为第一行已经用于创建标题行,故从第二行开始创建
+            row = sheet.createRow(i+3);
+            //如果是第一行就让其为标题行
+            Object targetObj = datalist.get(i);
+            for (int j = 0;j<fields.length;j++){
+                //创建列
+                Cell cell = row.createCell(j);
+                cell.setCellType(CellType.STRING);
+                //
+                try {
+                    Object value = methodList.get(j).invoke(targetObj, new Object[]{});
+                    cell.setCellValue(transCellType(value));
+                } catch (IllegalAccessException e) {
+                    e.printStackTrace();
+                } catch (InvocationTargetException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        response.setContentType("application/octet-stream");
+        //默认Excel名称
+        response.setHeader("Content-Disposition", "attachment;fileName="+"test.xls");
+        try {
+            OutputStream outputStream = response.getOutputStream();
+            workbook.write(outputStream);
+            outputStream.flush();
+            outputStream.close();
+
+//            response.flushBuffer();
+//            workbook.write(response.getOutputStream());
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+    }
+
+
+
+    /**
+     * 将传入的数据导出excel表并下载
+     * @param importlist 要导出的对象的集合
+     * @param attributeNames 含有每个对象属性在excel表中对应的标题字符串的数组(请按对象中属性排序调整字符串在数组中的位置)
+     * @param heardName 导出文件 标题名称
+     * @param cnt 合并单元格数 (一般标题字符串的数组长度-1)
+     * @param filename 文件名称
+     */
+    public static void exportToPath( List<?> importlist, String[] attributeNames,
+                              String heardName, int cnt,String filename ) throws IOException {
+        //获取数据集
+        List<?> datalist = importlist;
+
+        //声明一个工作薄
+        HSSFWorkbook workbook = new HSSFWorkbook();
+        //生成一个表格
+        HSSFSheet sheet = workbook.createSheet();
+        //设置表格默认列宽度为15个字节
+        sheet.setDefaultColumnWidth((short) 18*2);
+        //用于设置表格字体
+        HSSFCellStyle style = workbook.createCellStyle();
+
+        //获取字段名数组
+        String[] tableAttributeName = attributeNames;
+        //获取对象属性
+        Field[] fields = ClassUtil.getClassAttribute(importlist.get(0));
+        //获取对象get方法
+        List<Method> methodList = ClassUtil.getMethodGet(importlist.get(0));
+
+        //设置标题样式
+        HSSFCellStyle headerStyle = workbook.createCellStyle();
+        HSSFFont headerFont = workbook.createFont();
+        headerFont.setFontHeightInPoints((short) 14);
+        headerFont.setBold(true);
+        headerStyle.setAlignment(HorizontalAlignment.CENTER);
+        headerStyle.setFont(headerFont);
+//        CellRangeAddress cra0 = new CellRangeAddress(0, 1, 0, cnt);// 合并单元格
+//        sheet.addMergedRegion(cra0);
+//        //创建标标题题
+//        Row row = sheet.createRow(0);
+//        Cell cell1 = row.createCell(0);
+//        cell1.setCellValue(heardName);
+//        cell1.setCellStyle(headerStyle);
+
+        // 设置字体样式
+        HSSFFont titleFont = workbook.createFont();
+        titleFont.setBold(true);
+        titleFont.setFontHeightInPoints((short) 10);
+
+        style.setFont(titleFont);
+        style.setAlignment(HorizontalAlignment.CENTER);
+        //循环字段名数组,创建标题行
+        Row row = sheet.createRow(0);
+        for (int j = 0; j< tableAttributeName.length; j++){
+            //创建列
+            Cell cell = row.createCell(j);
+            cell.setCellStyle(style);
+            //设置单元类型为String
+            cell.setCellType(CellType.STRING);
+            cell.setCellValue(transCellType(tableAttributeName[j]));
+        }
+
+        int index = 0;
+        //创建普通行
+        for (int i = 0;i<datalist.size();i++){
+            //因为第一行已经用于创建标题行,故从第二行开始创建
+
+
+            if ((i + 1) % 65535 == 0) {
+                sheet = workbook.createSheet("sheet" + (index+1));
+                row = sheet.createRow(0);
+                for (int j = 0; j< tableAttributeName.length; j++){
+                    //创建列
+                    Cell cell = row.createCell(j);
+                    cell.setCellStyle(style);
+                    //设置单元类型为String
+                    cell.setCellType(CellType.STRING);
+                    cell.setCellValue(transCellType(tableAttributeName[j]));
+                }
+                index++;
+            }
+            row = sheet.createRow((i + 1) - (index * 65535));
+
+            //如果是第一行就让其为标题行
+            Object targetObj = datalist.get(i);
+            for (int j = 0;j<fields.length;j++){
+
+                if(!fields[j].getName().equals("serialVersionUID"))
+                {
+                    //创建列
+                    Cell cell = row.createCell(j);
+                    cell.setCellType(CellType.STRING);
+                    //
+                    try {
+                        Object value = methodList.get(j).invoke(targetObj, new Object[]{});
+                        cell.setCellValue(transCellType(value));
+                    } catch (IllegalAccessException e) {
+                        e.printStackTrace();
+                    } catch (InvocationTargetException e) {
+                        e.printStackTrace();
+                    }
+                }
+
+            }
+        }
+
+        if(StringUtils.notEmp(filename))
+        {
+            StringBuilder sb=new StringBuilder("/usr/local/gyee/monitor/");
+            sb.append(filename);
+            sb.append(".xls");
+
+            FileUtils.deleteFile(String.valueOf(sb));
+
+            FileOutputStream fileOutputStream = new FileOutputStream(String.valueOf(sb));
+
+            workbook.write(fileOutputStream);
+            fileOutputStream.close();
+
+        }
+
+    }
+    private static String transCellType(Object value){
+        String str = null;
+        if (value instanceof Date){
+            Date date = (Date) value;
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            str = sdf.format(date);
+        }else{
+            str = String.valueOf(value);
+            if (str == "null"){
+                str = "";
+            }
+        }
+
+        return str;
+    }
+
+
+}

+ 179 - 0
web/health-hb/src/main/java/com/gyee/frame/common/file/FileUploadUtils.java

@@ -0,0 +1,179 @@
+package com.gyee.frame.common.file;
+
+import java.io.File;
+import java.io.IOException;
+import org.apache.commons.fileupload.FileUploadBase.FileSizeLimitExceededException;
+import org.apache.shiro.crypto.hash.Md5Hash;
+import org.springframework.util.ClassUtils;
+import org.springframework.web.multipart.MultipartFile;
+import com.gyee.frame.common.conf.FileConfig;
+import com.gyee.frame.common.conf.V2Config;
+import com.gyee.frame.common.exception.file.FileNameLengthLimitExceededException;
+import com.gyee.frame.util.StringUtils;
+
+/**
+ * 文件上传工具类
+ * @author gyee
+ * @date: 2018年9月22日 下午10:33:23
+ */
+public class FileUploadUtils {
+
+    private FileUploadUtils(){}
+    
+    /**
+     * spring.servlet.multipart.maxFileSize
+     */
+    public static  long DEFAULT_MAX_SIZE=Long.valueOf(FileConfig.getMaxFileSize())*1024*1024;
+    /**
+     * 默认上传的地址
+     */
+    private static String defaultBaseDir = V2Config.getDefaultBaseDir();
+    
+    /**
+     * 是否上传到static
+     */
+    private static String isstatic=V2Config.getIsstatic();
+    
+    /**
+     * 默认的文件名最大长度
+     */
+    public static final int DEFAULT_FILE_NAME_LENGTH = 100;
+    /**
+     * 默认文件类型jpg
+     */
+    public static final String IMAGE_JPG_EXTENSION = ".jpg";
+
+    private static int counter = 0;
+
+    public static void setDefaultBaseDir(String defaultBaseDir)
+    {
+        FileUploadUtils.defaultBaseDir = defaultBaseDir;
+    }
+
+    public static String getDefaultBaseDir()
+    {
+        return defaultBaseDir;
+    }
+
+    public static String getIsstatic() {
+		return isstatic;
+	}
+
+	public static void setIsstatic(String isstatic) {
+		FileUploadUtils.isstatic = isstatic;
+	}
+	
+	/**
+	 * 静态文件上传后存放的目录
+	 */
+	public static String getRoot_dir() {
+		String url=ClassUtils.getDefaultClassLoader().getResource("").getPath()+V2Config.getIsroot_dir();
+		return url;
+	}
+
+
+	/**
+     * 以默认配置进行文件上传
+     *
+     * @param file 上传的文件
+     * @return 文件名称
+     * @throws Exception
+     */
+    public static final String upload(MultipartFile file) throws IOException
+    {
+        try
+        {
+        	if("Y".equals(getIsstatic())) {//获取根目录
+        		
+        		 return upload(getRoot_dir(), file);
+        	}else {//自定义目录
+        		 return upload(getDefaultBaseDir(), file);
+        	}
+        }
+        catch (Exception e)
+        {
+            throw new IOException(e);
+        }
+    }
+
+    /**
+     * 文件上传
+     *
+     * @param baseDir 相对应用的基目录
+     * @param file 上传的文件
+     * @param needDatePathAndRandomName 是否需要日期目录和随机文件名前缀
+     * @param extension 上传文件类型
+     * @return 返回上传成功的文件名
+     * @throws FileSizeLimitExceededException 如果超出最大大小
+     * @throws FileNameLengthLimitExceededException 文件名太长
+     * @throws IOException 比如读写文件出错时
+     */
+    public static final String upload(String baseDir, MultipartFile file)
+            throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException
+    {
+    	String fileName=file.getOriginalFilename();
+    	// 获得文件后缀名称
+    	String suffixName = fileName.substring(fileName.lastIndexOf(".")).toLowerCase();
+    	if(StringUtils.isEmpty(suffixName)) {
+    		//如果没有后缀默认后缀
+    		suffixName=FileUploadUtils.IMAGE_JPG_EXTENSION;
+    	}
+    	
+        int fileNamelength = fileName.length();
+        if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH)
+        {
+            throw new FileNameLengthLimitExceededException(fileName, fileNamelength,
+                    FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
+        }
+
+        assertAllowed(file);
+
+        String new_fileName = encodingFilename(fileName, suffixName);
+
+        File desc = getAbsoluteFile(baseDir, baseDir + new_fileName);
+        file.transferTo(desc);
+        return new_fileName;
+    }
+
+    private static final File getAbsoluteFile(String uploadDir, String filename) throws IOException
+    {
+        File desc = new File(File.separator + filename);
+
+        if (!desc.getParentFile().exists())
+        {
+            desc.getParentFile().mkdirs();
+        }
+        if (!desc.exists())
+        {
+            desc.createNewFile();
+        }
+        return desc;
+    }
+
+    /**
+     * 编码文件名
+     */
+    private static final String encodingFilename(String filename, String extension)
+    {
+        filename = filename.replace("_", " ");
+        filename = new Md5Hash(filename + System.nanoTime() + counter++).toHex().toString() + extension;
+        return filename;
+    }
+
+    /**
+     * 文件大小校验
+     *
+     * @param file 上传的文件
+     * @return
+     * @throws FileSizeLimitExceededException 如果超出最大大小
+     */
+    public static final void assertAllowed(MultipartFile file) throws FileSizeLimitExceededException
+    {
+        long size = file.getSize();
+        if (DEFAULT_MAX_SIZE != -1 && size > DEFAULT_MAX_SIZE)
+        {
+            throw new FileSizeLimitExceededException("超过默认大小", size, DEFAULT_MAX_SIZE);
+        }
+    }
+
+}

+ 110 - 0
web/health-hb/src/main/java/com/gyee/frame/common/file/FileUtils.java

@@ -0,0 +1,110 @@
+package com.gyee.frame.common.file;
+
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.ss.usermodel.WorkbookFactory;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.util.ClassUtils;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+
+/**
+ * 文件处理工具类
+ *
+ * @author gyee
+ * @date: 2018年9月22日 下午10:33:31
+ */
+public class FileUtils {
+
+    // 设置目标文件的映射路径
+    @Value("classpath:static/syz")
+    private Resource syz;
+
+    private FileUtils() {
+    }
+
+    /**
+     * 输出指定文件的byte数组
+     *
+     * @return
+     */
+    public static void writeBytes(String filePath, OutputStream os) throws IOException {
+        FileInputStream fis = null;
+        try {
+            File file = new File(filePath);
+            if (!file.exists()) {
+                throw new FileNotFoundException(filePath);
+            }
+            fis = new FileInputStream(file);
+            byte[] b = new byte[1024];
+            int length;
+            while ((length = fis.read(b)) > 0) {
+                os.write(b, 0, length);
+            }
+        } catch (IOException e) {
+            throw e;
+        } finally {
+            if (os != null) {
+                try {
+                    os.close();
+                } catch (IOException e1) {
+                    e1.printStackTrace();
+                }
+            }
+            if (fis != null) {
+                try {
+                    fis.close();
+                } catch (IOException e1) {
+                    e1.printStackTrace();
+                }
+            }
+        }
+    }
+
+    /**
+     * 删除文件
+     *
+     * @param filePath 文件
+     * @return
+     */
+    public static boolean deleteFile(String filePath) {
+        boolean flag = false;
+        File file = new File(filePath);
+        // 路径为文件且不为空则进行删除
+        if (file.isFile() && file.exists()) {
+            file.delete();
+            flag = true;
+        }
+        return flag;
+    }
+
+    /**
+     * 读取图片地址 输出到页面
+     *
+     * @param request
+     * @param response
+     * @param fileurl
+     * @throws IOException
+     */
+    public static void readIMGTohtml(HttpServletRequest request, HttpServletResponse response, String fileurl) throws IOException {
+        //设置发送到客户端的响应内容类型
+        response.setContentType("image/*");
+        //读取本地图片输入流
+        try (FileInputStream inputStream = new FileInputStream(fileurl); OutputStream out = response.getOutputStream()) {
+            int i = inputStream.available();
+            //byte数组用于存放图片字节数据
+            byte[] buff = new byte[i];
+            inputStream.read(buff);
+            out.write(buff);
+        }
+    }
+
+
+
+
+
+
+
+}

+ 174 - 0
web/health-hb/src/main/java/com/gyee/frame/common/interceptor/MyInterceptor.java

@@ -0,0 +1,174 @@
+package com.gyee.frame.common.interceptor;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.gyee.frame.model.auto.TsysUser;
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.authc.UsernamePasswordToken;
+import org.apache.shiro.subject.Subject;
+import org.springframework.web.servlet.HandlerInterceptor;
+import org.springframework.web.servlet.ModelAndView;
+import com.gyee.frame.common.conf.V2Config;
+import com.gyee.frame.common.exception.demo.DemoModeException;
+import cn.hutool.core.util.StrUtil;
+/**
+ * 自定义拦截器
+ * @author fc
+ *
+ */
+public class MyInterceptor  implements HandlerInterceptor {
+
+	/*************演示模式需要 start*************/
+	/**需要被拦截的post请求url**/
+	public static List<String> posturllist=new ArrayList<String>();
+	/**需要被拦截的get请求url**/
+	public static List<String> geturllist=new ArrayList<String>();
+
+	/**
+	 * 初始化静态块,避免多次创建调用
+	 * 需要拦截的请求集合
+	 */
+	static {
+		//用户POST请求
+		posturllist.add("/UserController/add");
+		posturllist.add("/UserController/remove");
+		posturllist.add("/UserController/edit");
+		posturllist.add("/UserController/editPwd");
+		//自动生成POST请求
+		posturllist.add("/autoCodeController/addGlobal");
+		posturllist.add("/autoCodeController/saveOne");
+		//字典表POST请求
+		posturllist.add("/DictDataController/add");
+		posturllist.add("/DictDataController/remove");
+		posturllist.add("/DictDataController/edit");
+		posturllist.add("/DictTypeController/add");
+		posturllist.add("/DictTypeController/remove");
+		posturllist.add("/DictTypeController/edit");
+		//邮箱POST请求
+		posturllist.add("/EmailController/add");
+		posturllist.add("/EmailController/edit");
+		//文件上传POST请求
+		posturllist.add("/FileController/upload");
+		posturllist.add("/FileController/add");
+		posturllist.add("/FileController/remove");
+		posturllist.add("/FileController/del_file");
+		posturllist.add("/FileController/edit");
+		//日志POST请求
+		posturllist.add("/LogController/remove");
+		//权限POST请求
+		posturllist.add("/PermissionController/add");
+		posturllist.add("/PermissionController/remove");
+		posturllist.add("/PermissionController/edit");
+		//定时器POST请求
+		posturllist.add("/SysQuartzJobController/add");
+		posturllist.add("/SysQuartzJobController/remove");
+		posturllist.add("/SysQuartzJobController/edit");
+		posturllist.add("/SysQuartzJobController/changeStatus");
+		posturllist.add("/SysQuartzJobController/run");
+		posturllist.add("/SysQuartzJobLogController/remove");
+		//角色POST请求
+		posturllist.add("/RoleController/add");
+		posturllist.add("/RoleController/remove");
+		posturllist.add("/RoleController/edit");
+		//公告POST请求
+		posturllist.add("/SysNoticeController/add");
+		posturllist.add("/SysNoticeController/remove");
+		posturllist.add("/SysNoticeController/viewinfo");
+		posturllist.add("/SysNoticeController/edit");
+		//省份POST请求
+		posturllist.add("/SysProvinceController/add");
+		posturllist.add("/SysProvinceController/remove");
+		posturllist.add("/SysProvinceController/edit");
+		//地区POST请求
+		posturllist.add("/SysAreaController/add");
+		posturllist.add("/SysAreaController/remove");
+		posturllist.add("/SysAreaController/edit");
+		//城市POST请求
+		posturllist.add("/SysCityController/add");
+		posturllist.add("/SysCityController/remove");
+		posturllist.add("/SysCityController/edit");
+		//街道POST请求
+		posturllist.add("/SysStreetController/add");
+		posturllist.add("/SysStreetController/remove");
+		posturllist.add("/SysStreetController/edit");
+		//百度编辑器POST请求
+		posturllist.add("/UeditorController/ueditor");
+		posturllist.add("/UeditorController/");
+		posturllist.add("/UeditorController/imgUpload");
+		//七牛POST请求
+		posturllist.add("/QiNiuCloudController/uploadToQiNiu");
+		//定时器GET请求
+		geturllist.add("/quartz/stop");
+		geturllist.add("/quartz/resume");
+		geturllist.add("/quartz/update");
+		geturllist.add("/quartz/delete");
+
+	}
+	/*************演示模式需要 end*************/
+	@Override
+	public void afterCompletion(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2, Exception arg3)throws Exception {
+		// //System.out.println(">>>MyInterceptor1>>>>>>>在整个请求结束之后被调用,也就是在DispatcherServlet 渲染了对应的视图之后执行(主要是用于进行资源清理工作)");
+	}
+
+	@Override
+	public void postHandle(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2, ModelAndView arg3)throws Exception {
+		// //System.out.println(">>>MyInterceptor1>>>>>>>请求处理之后进行调用,但是在视图被渲染之前(Controller方法调用之后)");
+	}
+
+	@Override
+	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object arg2) throws Exception {
+		//String url2=request.getScheme()+"://"+ request.getServerName();
+		////System.out.println("xxxxxxxxx==="+"http://localhost:8081/");
+		////System.out.println(">>>MyInterceptor1>>>>>>>在请求处理之前进行调用(Controller方法调用之前)");
+		//设置前端的全局 地址,如果前端网页错乱请修改这儿
+
+		// by Wang Jiawen 2020-01-07 临时补丁  调试需要暂时取消shiro大管家的登入限制
+//		TsysUser user = new TsysUser("1","admin","admin","管理员");
+//		Subject currentUser = SecurityUtils.getSubject();
+//		UsernamePasswordToken token =new UsernamePasswordToken("admin",user.getPassword());
+//		token.setRememberMe(true);
+//		currentUser.login(token);
+		//结束
+
+
+		request.setAttribute("rootPath", request.getContextPath());
+		if(V2Config.getDemoEnabled().equals("true")) {
+			Boolean b = ifurl(request, response);
+			if(b) {
+				throw new DemoModeException();
+			}
+		}
+		return true;// 只有返回true才会继续向下执行,返回false取消当前请求
+	}
+
+	/**
+	 * 判断是否需要拦截的用于展示演示模式
+	 * @param request
+	 * @param response
+	 * @return
+	 * @author gyee
+	 * @Date 2019年11月11日 下午5:17:30
+	 */
+	public Boolean ifurl(HttpServletRequest request, HttpServletResponse response) {
+		//当前请求
+		String requesturl=request.getRequestURI();
+		if(request.getMethod().equals("POST")) {
+			for (String postrul : posturllist) {
+				if(StrUtil.containsAnyIgnoreCase(requesturl, postrul)) {
+					return true;
+				}
+			}
+		}else {
+			for (String geturl : geturllist) {
+				if(StrUtil.containsAnyIgnoreCase(requesturl, geturl)) {
+					return true;
+				}
+			}
+		}
+
+		return false;
+	}
+}

+ 108 - 0
web/health-hb/src/main/java/com/gyee/frame/common/interceptor/MyWebAppConfigurer.java

@@ -0,0 +1,108 @@
+package com.gyee.frame.common.interceptor;
+
+import com.gyee.frame.common.conf.V2Config;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.*;
+
+/**
+ * 拦截器
+* @ClassName: MyWebAppConfigurer
+* @author gyee
+* @date 2018年6月3日
+*
+ */
+@Configuration
+public class MyWebAppConfigurer  extends  WebMvcConfigurationSupport  {
+	
+	private static Logger logger=LoggerFactory.getLogger(WebMvcConfigurationSupport.class);
+	/**
+     * 默认上传的地址
+     */
+    private  String defaultBaseDir = V2Config.getDefaultBaseDir();
+    
+    /**
+     * 静态文件夹后目录
+     */
+    private  String isrootDir=V2Config.getIsroot_dir();
+    
+    /**
+     * 是否上传到static
+     */
+    private   String isstatic=V2Config.getIsstatic();
+	
+	
+	/** 解决跨域问题 **/
+	@Override
+	public void addCorsMappings(CorsRegistry registry){
+
+
+        registry.addMapping("/**")
+			// 设置允许跨域请求的域名
+			.allowedOrigins("*")
+			// 是否允许证书
+			.allowCredentials(true)
+			// 设置允许的方法
+			.allowedMethods("GET", "POST", "DELETE", "PUT")
+			// 设置允许的header属性
+			.allowedHeaders("*")
+				// 跨域允许时间
+			.maxAge(3600);
+			super.addCorsMappings(registry);
+
+	}
+	
+	/** 添加拦截器 **/
+	@Override
+	protected void addInterceptors(InterceptorRegistry registry){
+		registry.addInterceptor(new MyInterceptor());
+		super.addInterceptors(registry);
+	}
+	
+	/** 这里配置视图解析器 **/
+	@Override
+	protected void configureViewResolvers(ViewResolverRegistry registry){
+		super.configureViewResolvers(registry);
+	}
+	
+	/** 配置内容裁决的一些选项 **/
+	@Override
+	protected void configureContentNegotiation(ContentNegotiationConfigurer configurer){
+		super.configureContentNegotiation(configurer);
+	}
+	
+	/** 视图跳转控制器 **/
+	@Override
+	protected void addViewControllers(ViewControllerRegistry registry) {
+		
+		super.addViewControllers(registry);
+	}
+	
+	
+	/** 静态资源处理 **/
+	@Override
+    protected void addResourceHandlers(ResourceHandlerRegistry registry) {
+		//配置虚拟路径为项目得static下面
+        registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
+        if(!"Y".equals(isstatic)) {
+        	 //配置上传路径为D盘
+            registry.addResourceHandler("/static/file_upload/**").addResourceLocations("file:"+defaultBaseDir);
+            logger.info("初始化文件上传路径为项目【"+defaultBaseDir+"】路径");
+        }else {
+        	logger.info("初始化文件上传路径为项目【"+isrootDir+"】路径");
+        }
+       
+    }
+	/** 默认静态资源处理器 **/
+	
+	protected void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
+		//super.configureDefaultServletHandling(configurer);
+		//configurer.enable("stati");
+		configurer.enable();
+	}
+	
+	
+	
+	
+}

+ 31 - 0
web/health-hb/src/main/java/com/gyee/frame/common/log/Log.java

@@ -0,0 +1,31 @@
+package com.gyee.frame.common.log;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 自定义操作日志记录注解
+ * @author gyee
+ * @date: 2018年9月30日 下午3:36:05
+ */
+@Target({ ElementType.PARAMETER, ElementType.METHOD })
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface Log
+{
+    /** 模块 */
+    String title() default "";
+
+    /** 功能 */
+    String action() default "";
+
+    /** 渠道 */
+    String channel() default "1";//1后台
+
+    /** 是否保存请求的参数 */
+    boolean isSaveRequestData() default true;
+
+}

+ 186 - 0
web/health-hb/src/main/java/com/gyee/frame/common/log/LogAspect.java

@@ -0,0 +1,186 @@
+package com.gyee.frame.common.log;
+
+import java.lang.reflect.Method;
+import java.util.Date;
+import java.util.Map;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.Signature;
+import org.aspectj.lang.annotation.AfterReturning;
+import org.aspectj.lang.annotation.AfterThrowing;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import javax.annotation.Resource;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.stereotype.Component;
+import com.gyee.frame.model.auto.TsysOperLog;
+import com.gyee.frame.model.auto.TsysUser;
+import com.gyee.frame.service.SysOperLogService;
+import com.gyee.frame.shiro.util.ShiroUtils;
+import com.gyee.frame.util.ServletUtils;
+import com.gyee.frame.util.StringUtils;
+import com.google.gson.Gson;
+
+/**
+ * 操作日志记录处理
+ * @author gyee
+ * @date: 2018年9月30日 下午1:40:33
+ */
+@Aspect
+@Component
+@EnableAsync
+public class LogAspect
+{
+    private static final Logger log = LoggerFactory.getLogger(LogAspect.class);
+
+    @Resource
+    private SysOperLogService operLogService;
+
+    // 配置织入点
+    @Pointcut("@annotation(com.gyee.frame.common.log.Log)")
+    public void logPointCut()
+    {
+    }
+
+    /**
+     * 前置通知 用于拦截操作
+     *
+     * @param joinPoint 切点
+     */
+    @AfterReturning(pointcut = "logPointCut()")
+    public void doBefore(JoinPoint joinPoint)
+    {
+        handleLog(joinPoint, null);
+    }
+
+    /**
+     * 拦截异常操作
+     * 
+     * @param joinPoint
+     * @param e
+     */
+    @AfterThrowing(value = "logPointCut()", throwing = "e")
+    public void doAfter(JoinPoint joinPoint, Exception e)
+    {
+        handleLog(joinPoint, e);
+    }
+
+    @Async
+    protected void handleLog(final JoinPoint joinPoint, final Exception e)
+    {
+        try
+        {
+            // 获得注解
+            Log controllerLog = getAnnotationLog(joinPoint);
+            if (controllerLog == null)
+            {
+                return;
+            }
+
+            // 获取当前的用户
+            TsysUser currentUser = ShiroUtils.getUser();
+
+            // *========数据库日志=========*//
+            TsysOperLog operLog = new TsysOperLog();
+           
+            //赋值操作
+            /*String ip = ShiroUtils.getIp();
+            operLog.setOperIp(ip);*/
+            // 操作地点
+            //operLog.setOperLocation(AddressUtils.getRealAddressByIP(ip));
+            // 请求的地址
+            operLog.setOperUrl(ServletUtils.getRequest().getRequestURI());
+            if (currentUser != null)
+            {
+//            	//操作人
+                operLog.setOperName(currentUser.getUsername());
+//                if (StringUtils.isNotNull(currentUser.getDept())
+//                        && StringUtils.isNotEmpty(currentUser.getDept().getDeptName()))
+//                {
+//                    operLog.setDeptName(currentUser.getDept().getDeptName());
+//                }
+            }
+
+            if (e != null)
+            {
+            	//错误日志
+            	operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000));
+            }
+            // 设置方法名称
+            String className = joinPoint.getTarget().getClass().getName();
+            String methodName = joinPoint.getSignature().getName();
+            operLog.setMethod(className + "." + methodName + "()");
+            operLog.setOperTime(new Date());
+            // 处理设置注解上的参数
+            getControllerMethodDescription(controllerLog, operLog);
+            // 保存数据库
+            //System.out.println("-----------------");
+            //System.out.println(new Gson().toJson(operLog));
+            //System.out.println("-----------------");
+            operLogService.insertSelective(operLog);
+        }
+        catch (Exception exp)
+        {
+            // 记录本地异常日志
+            log.error("==前置通知异常==");
+            log.error("异常信息:{}", exp.getMessage());
+            exp.printStackTrace();
+        }
+    }
+
+    /**
+     * 获取注解中对方法的描述信息 用于Controller层注解
+     * 
+     * @param joinPoint 切点
+     * @return 方法描述
+     * @throws Exception
+     */
+    public void getControllerMethodDescription(Log log, TsysOperLog operLog) throws Exception
+    {
+        // 设置action动作
+       // operLog.setAction(log.action());
+        // 设置标题
+        operLog.setTitle(log.title());
+        // 设置channel
+        //operLog.setChannel(log.channel());
+        // 是否需要保存request,参数和值
+        if (log.isSaveRequestData())
+        {
+            // 获取参数的信息,传入到数据库中。
+            setRequestValue(operLog);
+        }
+    }
+
+    /**
+     * 获取请求的参数,放到log中
+     * 
+     * @param operLog
+     * @param request
+     */
+    private void setRequestValue(TsysOperLog operLog)
+    {
+        Map<String, String[]> map = ServletUtils.getRequest().getParameterMap();
+        Gson gson=new Gson();
+        String params = gson.toJson(map);
+        operLog.setOperParam(StringUtils.substring(params, 0, 255));
+    }
+
+    /**
+     * 是否存在注解,如果存在就获取
+     */
+    private Log getAnnotationLog(JoinPoint joinPoint) throws Exception
+    {
+        Signature signature = joinPoint.getSignature();
+        MethodSignature methodSignature = (MethodSignature) signature;
+        Method method = methodSignature.getMethod();
+
+        if (method != null)
+        {
+            return method.getAnnotation(Log.class);
+        }
+        return null;
+    }
+}

+ 100 - 0
web/health-hb/src/main/java/com/gyee/frame/common/quartz/AbstractQuartzJob.java

@@ -0,0 +1,100 @@
+package com.gyee.frame.common.quartz;
+
+import com.gyee.frame.model.auto.SysQuartzJob;
+import org.quartz.Job;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
+
+import java.util.Date;
+
+/**
+ * @CLASSNAME AbstractQuartzJob
+ * @Description
+ * @Auther Jan  橙寂
+ * @DATE 2019/9/5 0005 15:05
+ */
+
+public abstract class AbstractQuartzJob implements Job {
+
+    private static final Logger log = LoggerFactory.getLogger(AbstractQuartzJob.class);
+
+    /**
+     * 线程本地变量
+     */
+    private static ThreadLocal<Date> threadLocal = new ThreadLocal<>();
+
+    @Override
+    public void execute(JobExecutionContext context) throws JobExecutionException
+    {
+    	SysQuartzJob sysJob = new SysQuartzJob();
+        BeanUtils.copyProperties(context.getMergedJobDataMap().get(ScheduleConstants.TASK_PROPERTIES),sysJob);
+        try
+        {
+            before(context, sysJob);
+            if (sysJob != null)
+            {
+                doExecute(context, sysJob);
+            }
+            after(context, sysJob, null);
+        }
+        catch (Exception e)
+        {
+            log.error("任务执行异常  - :", e);
+            after(context, sysJob, e);
+        }
+    }
+
+    /**
+     * 执行前
+     *
+     * @param context 工作执行上下文对象
+     * @param sysJob 系统计划任务
+     */
+    protected void before(JobExecutionContext context, SysQuartzJob sysJob)
+    {
+        threadLocal.set(new Date());
+    }
+
+    /**
+     * 执行后
+     *
+     * @param context 工作执行上下文对象
+     * @param sysJob 系统计划任务
+     */
+    protected void after(JobExecutionContext context, SysQuartzJob sysJob, Exception e)
+    {
+        Date startTime = threadLocal.get();
+        threadLocal.remove();
+
+//        final SysQuartzJobLog sysJobLog = new SysQuartzJobLog();
+//        sysJobLog.setJobName(sysJob.getJobName());
+//        sysJobLog.setJobGroup(sysJob.getJobGroup());
+//        sysJobLog.setInvokeTarget(sysJob.getInvokeTarget());
+//        sysJobLog.setStartTime(startTime);
+//        sysJobLog.setEndTime(new Date());
+//        long runMs = sysJobLog.getEndTime().getTime() - sysJobLog.getStartTime().getTime();
+//        sysJobLog.setJobMessage(sysJobLog.getJobName() + " 总共耗时:" + runMs + "毫秒");
+//        if (e != null)
+//        {
+//            sysJobLog.setStatus(ScheduleConstants.FAIL_STATUS);
+//            String errorMsg = StringUtils.substring(ExceptionUtil.getMessage(e), 0, 2000);
+//            sysJobLog.setExceptionInfo(errorMsg);
+//        }
+//        else
+//        {
+//            sysJobLog.setStatus(ScheduleConstants.SUCCESS_STATUS);
+//        }
+//        //  这里获取service然后插入库中
+//        SpringUtils.getBean(SysQuartzJobLogService.class).insertSelective(sysJobLog);
+    }
+
+    /**
+     * 子类去实现
+     * @param jobExecutionContext
+     * @param sysJob
+     */
+    protected abstract void doExecute(JobExecutionContext jobExecutionContext, SysQuartzJob sysJob) throws Exception;
+}

+ 29 - 0
web/health-hb/src/main/java/com/gyee/frame/common/quartz/QuartzConfig.java

@@ -0,0 +1,29 @@
+package com.gyee.frame.common.quartz;
+
+import org.quartz.Scheduler;
+import org.quartz.SchedulerException;
+import org.quartz.SchedulerFactory;
+import org.quartz.impl.StdSchedulerFactory;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * @CLASSNAME QuartzConfig
+ * @Description  Quartz配置类
+ * @Auther Jan  橙寂
+ * @DATE 2019/9/2 0002 15:21
+ */
+@Configuration
+public class QuartzConfig {
+
+    /**
+     * 初始注入scheduler
+     * @return
+     * @throws SchedulerException
+     */
+    @Bean
+    public Scheduler scheduler() throws SchedulerException{
+        SchedulerFactory schedulerFactoryBean = new StdSchedulerFactory();
+        return schedulerFactoryBean.getScheduler();
+    }
+}

+ 23 - 0
web/health-hb/src/main/java/com/gyee/frame/common/quartz/QuartzDisallowConcurrentExecution.java

@@ -0,0 +1,23 @@
+package com.gyee.frame.common.quartz;
+
+import com.gyee.frame.common.quartz.utils.JobInvokeUtil;
+import com.gyee.frame.model.auto.SysQuartzJob;
+
+import org.quartz.DisallowConcurrentExecution;
+import org.quartz.JobExecutionContext;
+
+/**
+ * 定时任务处理(禁止并发执行)
+ * 
+ * @author jan 橙寂
+ *
+ */
+@DisallowConcurrentExecution
+public class QuartzDisallowConcurrentExecution extends AbstractQuartzJob
+{
+    @Override
+    protected void doExecute(JobExecutionContext context, SysQuartzJob sysJob) throws Exception
+    {
+        JobInvokeUtil.invokeMethod(sysJob);
+    }
+}

+ 22 - 0
web/health-hb/src/main/java/com/gyee/frame/common/quartz/QuartzJobExecution.java

@@ -0,0 +1,22 @@
+package com.gyee.frame.common.quartz;
+
+import com.gyee.frame.common.quartz.utils.JobInvokeUtil;
+import com.gyee.frame.model.auto.SysQuartzJob;
+
+import org.quartz.JobExecutionContext;
+
+/**
+ * 定时任务处理(允许并发执行)
+ * 
+ * @author  jan  橙寂
+ *
+ */
+public class QuartzJobExecution extends AbstractQuartzJob
+{
+    @Override
+    protected void doExecute(JobExecutionContext context, SysQuartzJob sysJob) throws Exception {
+        JobInvokeUtil.invokeMethod(sysJob);
+    }
+
+
+}

+ 410 - 0
web/health-hb/src/main/java/com/gyee/frame/common/quartz/QuartzSchedulerUtil.java

@@ -0,0 +1,410 @@
+package com.gyee.frame.common.quartz;
+
+import com.gyee.frame.common.spring.SpringUtils;
+import com.gyee.frame.model.auto.SysQuartzJob;
+import com.gyee.frame.model.auto.SysQuartzJobExample;
+import com.gyee.frame.service.SysQuartzJobService;
+import com.gyee.frame.util.StringUtils;
+import org.quartz.*;
+import org.quartz.impl.JobDetailImpl;
+import org.quartz.impl.matchers.GroupMatcher;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+
+import javax.annotation.PostConstruct;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @CLASSNAME QuartzConfig
+ * @Description  Quartz配置类
+ * @Auther Jan  橙寂
+ * @DATE 2019/9/2 0002 15:21
+ */
+@Configuration
+public class QuartzSchedulerUtil {
+
+    @Autowired
+    private  Scheduler scheduler;
+    @Autowired
+    private SysQuartzJobService sysQuartzJobService; 
+
+    //这个东西可以放在配置文件中
+    //cron表达式 一分钟执行一次
+    private final  String TEST_CRON="0 0/1 * * * ?";
+
+    /**
+     * 容器初始化时执行此方法
+     * 也就是类初始化的时候
+     */
+    @PostConstruct
+    public void init() throws SchedulerException {
+    	
+    	List<SysQuartzJob> quartzJobs=sysQuartzJobService.selectByExample(new SysQuartzJobExample());
+    	for (SysQuartzJob job : quartzJobs) {
+    		try {
+    		    if(job.getId().indexOf("/topic/")!=-1)
+                {
+                    //防止因为数据问题重复创建
+                    if(checkJobExists(job))
+                    {
+                        deleteJob(job);
+                    }
+                    createSchedule(job);
+                }
+
+	        } catch (SchedulerException e) {
+	            e.printStackTrace();
+	        }
+		}
+        //这一块可以从数据库中查
+//        for (int i=1;i<=1;i++)
+//        {
+//            SysQuartzJob job=new SysQuartzJob();
+//            job.setId("332182389491109888");
+//            job.setJobName("v2Task2");
+//            job.setJobGroup("SYSTEM");
+//            job.setCronExpression("*/6 * * * * ?");
+//            //并发执行
+//            job.setConcurrent("0");
+//            //0启用
+//            job.setStatus(1);
+//            //执行的job类
+//            job.setInvokeTarget("v2Task.runTask2(1,2l,'asa',true,2D)");
+//            try {
+//                //防止因为数据问题重复创建
+//                if(checkJobExists(job))
+//                {
+//                    deleteJob(job);
+//                }
+//                createSchedule(job);
+//	        } catch (SchedulerException e) {
+//	            e.printStackTrace();
+//	        }
+//        }
+
+        start();
+
+    }
+
+    /**
+     * 启动定时器
+     */
+    public void start()
+{
+    try {
+        scheduler.start();
+    } catch (SchedulerException e) {
+        e.printStackTrace();
+        System.out.println("定时任务执行失败");
+    }
+}
+
+
+    /**
+     * 创建一个定时任务
+     * @param job
+     * @throws SchedulerException
+     */
+    public void createSchedule(SysQuartzJob job) throws SchedulerException {
+        if (!checkJobExists(job)) {
+            //获取指定的job工作类
+            Class<? extends Job> jobClass = getQuartzJobClass(job);
+            // 通过JobBuilder构建JobDetail实例,JobDetail规定只能是实现Job接口的实例
+            // JobDetail 是具体Job实例
+            JobDetail jobDetail = JobBuilder.newJob((Class<? extends Job>) jobClass).withIdentity(ScheduleConstants.TASK_CLASS_NAME+job.getId(),job.getJobGroup()).build();
+            // 基于表达式构建触发器
+            CronScheduleBuilder cronScheduleBuilder =null;
+            if(StringUtils.isNotEmpty(job.getCronExpression())) {
+            	cronScheduleBuilder = CronScheduleBuilder.cronSchedule(job.getCronExpression());
+            }else {
+            	cronScheduleBuilder = CronScheduleBuilder.cronSchedule(TEST_CRON);
+            }
+           
+            // CronTrigger表达式触发器 继承于Trigger  //cronScheduleBuilder.withMisfireHandlingInstructionDoNothing()错过60分钟后不在补偿 拉下的执行次数
+            // TriggerBuilder 用于构建触发器实例
+            CronTrigger cronTrigger = TriggerBuilder.newTrigger().withIdentity(ScheduleConstants.TASK_CLASS_NAME+job.getId(),job.getJobGroup())
+              .withSchedule(cronScheduleBuilder.withMisfireHandlingInstructionDoNothing()).build();
+            //放入参数,运行时的方法可以获取
+            jobDetail.getJobDataMap().put(ScheduleConstants.TASK_PROPERTIES, job);
+            scheduler.scheduleJob(jobDetail, cronTrigger);
+            
+            //如果这个工作的状态为1
+            if (job.getStatus().equals(1))
+            {
+                pauseJob(job);
+            }
+        }
+    }
+
+
+
+
+    /**
+     * 修改定时任务
+     * @param job
+     * @return
+     * @throws SchedulerException
+     */
+    public boolean modifyJob(SysQuartzJob job) {
+
+        try {
+            //先删除
+            if(checkJobExists(job))
+            {
+                deleteJob(job);
+            }
+            createSchedule(job);
+        } catch (SchedulerException e) {
+            e.printStackTrace();
+            return  false;
+        }
+        return  true;
+    }
+
+
+    /**
+     *  继续执行定时任务
+     * @param job
+     * @return
+     */
+    public boolean resumeJob(SysQuartzJob job) {
+        boolean bl = false;
+        try {
+            //JobKey定义了job的名称和组别
+            JobKey jobKey = JobKey.jobKey(ScheduleConstants.TASK_CLASS_NAME+job.getId(), job.getJobGroup());
+            if (jobKey != null) {
+                //继续任务
+                scheduler.resumeJob(jobKey);
+                bl = true;
+            }
+        } catch (SchedulerException e) {
+            System.out.println("继续调度任务异常:" + e);
+        } catch (Exception e) {
+            System.out.println("继续调度任务异常:" + e);
+        }
+        return bl;
+    }
+
+    /**
+     *  删除定时任务
+     * @param job
+     * @return
+     */
+    public boolean deleteJob(SysQuartzJob job) {
+        boolean bl = false;
+        try {
+            //JobKey定义了job的名称和组别
+            JobKey jobKey = JobKey.jobKey(ScheduleConstants.TASK_CLASS_NAME+job.getId(), job.getJobGroup());
+            if (jobKey != null) {
+                //删除定时任务
+                scheduler.deleteJob(jobKey);
+                bl = true;
+            }
+        } catch (SchedulerException e) {
+            System.out.println("删除调度任务异常:" + e);
+        } catch (Exception e) {
+            System.out.println("删除调度任务异常:" + e);
+        }
+        return bl;
+    }
+    
+    /**
+     * 获取jobKey
+     */
+    public  JobKey getJobKey(SysQuartzJob job)
+    {
+        return JobKey.jobKey(ScheduleConstants.TASK_CLASS_NAME + job.getId(),job.getJobGroup());
+    }
+    
+    /**
+     * 立即执行任务
+     */
+    public  void run(SysQuartzJob job) throws SchedulerException
+    {
+        // 参数
+        JobDataMap dataMap = new JobDataMap();
+        dataMap.put(ScheduleConstants.TASK_PROPERTIES, job);
+        scheduler.triggerJob(getJobKey(job), dataMap);
+    }
+    /**
+     * 暂停任务
+     * @param job
+     * @return
+     */
+    public boolean pauseJob(SysQuartzJob job) {
+        boolean bl = false;
+        try {
+            //JobKey定义了job的名称和组别
+            JobKey jobKey = JobKey.jobKey(ScheduleConstants.TASK_CLASS_NAME+job.getId(), job.getJobGroup());
+            //暂停任务
+            if (jobKey != null) {
+                scheduler.pauseJob(jobKey);
+                bl = true;
+            }
+        } catch (SchedulerException e) {
+             System.out.println("暂停调度任务异常:" + e);
+        } catch (Exception e) {
+        	 System.out.println("暂停调度任务异常:"+ e);
+        }
+        return bl;
+    }
+
+    /**
+     * 判断定时任务是否已经存在
+     * @param job
+     * @return
+     * @throws SchedulerException
+     */
+    public boolean checkJobExists(SysQuartzJob job) throws SchedulerException {
+        TriggerKey triggerKey = TriggerKey.triggerKey(ScheduleConstants.TASK_CLASS_NAME+job.getId(), job.getJobGroup());
+        return scheduler.checkExists(triggerKey);
+    }
+
+
+    /**
+     * 获取定时任务的具体执行类
+     * @param sysJob
+     * @return
+     */
+    private static Class<? extends Job> getQuartzJobClass(SysQuartzJob sysJob)
+    {
+        boolean isConcurrent = "0".equals(sysJob.getConcurrent());
+        return isConcurrent ? QuartzJobExecution.class : QuartzDisallowConcurrentExecution.class;
+    }
+    
+    
+    @SuppressWarnings({ "unchecked", "rawtypes" })
+	public void getquartzList() throws SchedulerException {
+
+        List<String> triggerGroupNames = scheduler.getTriggerGroupNames();
+        for (String groupName : triggerGroupNames) {
+        	 //组装group的匹配,为了模糊获取所有的triggerKey或者jobKey 
+        	GroupMatcher groupMatcher = GroupMatcher.groupEquals(groupName);
+        	//获取所有的triggerKey
+        	 Set<TriggerKey> triggerKeySet = scheduler.getTriggerKeys(groupMatcher);
+        	 for (TriggerKey triggerKey : triggerKeySet) {
+        		 //通过triggerKey在scheduler中获取trigger对象
+                 CronTrigger trigger = (CronTrigger) scheduler.getTrigger(triggerKey);
+                 //获取trigger拥有的Job
+                 JobKey jobKey =trigger.getJobKey();
+                 JobDetailImpl jobDetail2 = (JobDetailImpl) scheduler.getJobDetail(jobKey);
+                 System.out.println(groupName);
+                 System.out.println(jobDetail2.getName());
+                 System.out.println(trigger.getCronExpression());
+        	 }
+        }
+    }
+
+    /**
+     * @purpose 根据socket 对一些job任务进行管制
+     */
+    @Configuration
+    public static class SocketTaskUtil {
+        private QuartzSchedulerUtil quartzSchedulerUtil = SpringUtils.getBean(QuartzSchedulerUtil.class);
+        private SysQuartzJobService sysQuartzJobService = SpringUtils.getBean(SysQuartzJobService.class);
+
+        String template="*";
+
+        public void pauseJob(SysQuartzJob sysQuartzJob){
+            quartzSchedulerUtil.pauseJob(sysQuartzJob);
+        }
+        public void startJob(SysQuartzJob sysQuartzJob){
+
+            try {
+                quartzSchedulerUtil.run(sysQuartzJob);
+            } catch (SchedulerException e) {
+                e.printStackTrace();
+            }
+        }
+        public void deleteJob(SysQuartzJob sysQuartzJob){
+            quartzSchedulerUtil.deleteJob(sysQuartzJob);
+        }
+        /**
+         *
+         *@description: 该方法通过计算jobid来找到job,通过job的对象来进一步控制job任务,用来重启某一具体的任务
+         *
+         *@param:[jobid] job的编码
+         *
+         *@return:void
+         *
+         *@createTime:2020/1/9
+         *
+         */
+        public void restartJob(String jobid){
+
+            List<SysQuartzJob> quartzJobs=sysQuartzJobService.selectByExample(new SysQuartzJobExample());
+            SysQuartzJob sysQuartzJob1 = null;
+            //找到具体的任务
+            for(SysQuartzJob sysQuartzJob:quartzJobs){
+                if(sysQuartzJob.getId().equalsIgnoreCase(jobid)){
+                    sysQuartzJob1=sysQuartzJob;
+                    break;
+                }
+            }
+            this.deleteJob(sysQuartzJob1);//符合标准步骤删除-创建-启动流程
+            try {
+               // //System.out.println(sysQuartzJob1.getJobName());
+
+                sysQuartzJob1.setStatus(0);//开启任务
+
+                quartzSchedulerUtil.createSchedule(sysQuartzJob1);
+
+                //startJob(sysQuartzJob1);
+            } catch (SchedulerException e) {
+                e.printStackTrace();
+            }
+            //this.startJob(sysQuartzJob1);
+        }
+
+
+        public void restartJob(String jobid,String params){
+
+            List<SysQuartzJob> quartzJobs=sysQuartzJobService.selectByExample(new SysQuartzJobExample());
+            SysQuartzJob sysQuartzJob1 = null;
+            //找到具体的任务
+            for(SysQuartzJob sysQuartzJob:quartzJobs){
+                if(sysQuartzJob.getId().equalsIgnoreCase(jobid)){
+                    sysQuartzJob1=sysQuartzJob;
+                    break;
+                }
+            }
+            this.deleteJob(sysQuartzJob1);//符合标准步骤删除-创建-启动流程
+            try {
+                // //System.out.println(sysQuartzJob1.getJobName());
+
+                sysQuartzJob1.setStatus(0);//开启任务
+
+                if(StringUtils.notEmp(params))
+                {
+                    String temp=sysQuartzJob1.getInvokeTarget().replace(template,params);
+                    sysQuartzJob1.setInvokeTarget(temp);
+                }
+
+                quartzSchedulerUtil.createSchedule(sysQuartzJob1);
+
+                //startJob(sysQuartzJob1);
+            } catch (SchedulerException e) {
+                e.printStackTrace();
+            }
+            //this.startJob(sysQuartzJob1);
+        }
+        public void deleteJob(String jobid){
+
+            List<SysQuartzJob> quartzJobs=sysQuartzJobService.selectByExample(new SysQuartzJobExample());
+            SysQuartzJob sysQuartzJob1 = null;
+            //找到具体的任务
+            for(SysQuartzJob sysQuartzJob:quartzJobs){
+                if(sysQuartzJob.getId().equalsIgnoreCase(jobid)){
+                    sysQuartzJob1=sysQuartzJob;
+                    break;
+                }
+            }
+            if(sysQuartzJob1!=null)
+            {
+                this.deleteJob(sysQuartzJob1);
+            }
+
+        }
+    }
+}

+ 66 - 0
web/health-hb/src/main/java/com/gyee/frame/common/quartz/ScheduleConstants.java

@@ -0,0 +1,66 @@
+package com.gyee.frame.common.quartz;
+
+/**
+ * 任务调度通用常量
+ * 
+ * @author jan 橙寂
+ */
+public interface ScheduleConstants
+{
+    public static final String TASK_CLASS_NAME = "TASK_CLASS_NAME";
+
+    /** 执行目标key */
+    public static final String TASK_PROPERTIES = "TASK_PROPERTIES";
+
+    /** 默认 */
+    public static final Integer MISFIRE_DEFAULT = 0;
+
+    /** 立即触发执行 */
+    public static final Integer MISFIRE_IGNORE_MISFIRES = 1;
+
+    /** 触发一次执行 */
+    public static final Integer MISFIRE_FIRE_AND_PROCEED = 2;
+
+    /** 不触发立即执行 */
+    public static final Integer MISFIRE_DO_NOTHING = 3;
+
+    /**
+     * 失败状态
+     */
+    public static final Integer FAIL_STATUS = 1;
+
+    /**
+     * 成功状态
+     */
+    public static final Integer SUCCESS_STATUS = 0;
+
+
+    /**
+     * 任务的关闭的状态
+     */
+    public static final Integer STOP_STATUS = 2;
+
+    public enum Status
+    {
+        /**
+         * 正常
+         */
+        NORMAL(0),
+        /**
+         * 暂停
+         */
+        PAUSE(1);
+
+        private Integer value;
+
+        private Status(Integer value)
+        {
+            this.value = value;
+        }
+
+        public Integer getValue()
+        {
+            return value;
+        }
+    }
+}

+ 191 - 0
web/health-hb/src/main/java/com/gyee/frame/common/quartz/utils/JobInvokeUtil.java

@@ -0,0 +1,191 @@
+package com.gyee.frame.common.quartz.utils;
+
+import com.gyee.frame.common.spring.SpringUtils;
+import com.gyee.frame.model.auto.SysQuartzJob;
+import com.gyee.frame.util.StringUtils;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * 任务执行工具
+ *
+ * @author ruoyi
+ */
+public class JobInvokeUtil
+{
+    /**
+     * 执行方法
+     *
+     * @param sysJob 系统任务
+     */
+    public static void invokeMethod(SysQuartzJob sysJob) throws Exception
+    {
+        String invokeTarget = sysJob.getInvokeTarget();
+        String beanName = getBeanName(invokeTarget);
+        String methodName = getMethodName(invokeTarget);
+        List<Object[]> methodParams = getMethodParams(invokeTarget);
+
+        if (!isValidClassName(beanName))
+        {
+            Object bean = SpringUtils.getBean(beanName);
+            if (null != bean) {
+                invokeMethod(bean, methodName, methodParams);
+            }else {
+                System.out.println("找不到class["+ beanName +"]");
+            }
+        }
+        else
+        {
+            Object bean = Class.forName(beanName).newInstance();
+            if (null != bean) {
+                invokeMethod(bean, methodName, methodParams);
+            }else {
+                System.out.println("找不到class["+ beanName +"]");
+            }
+        }
+    }
+
+    /**
+     * 调用任务方法
+     *
+     * @param bean 目标对象
+     * @param methodName 方法名称
+     * @param methodParams 方法参数
+     */
+    private static void invokeMethod(Object bean, String methodName, List<Object[]> methodParams)
+            throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException,
+            InvocationTargetException
+    {
+        if (StringUtils.isNotNull(methodParams) && methodParams.size() > 0)
+        {
+            Method method = bean.getClass().getDeclaredMethod(methodName, getMethodParamsType(methodParams));
+            method.invoke(bean, getMethodParamsValue(methodParams));
+        }
+        else
+        {
+            Method method = bean.getClass().getDeclaredMethod(methodName);
+            method.invoke(bean);
+        }
+    }
+
+    /**
+     * 校验是否为为class包名
+     * 
+     * @param str 名称
+     * @return true是 false否
+     */
+    public static boolean isValidClassName(String invokeTarget)
+    {
+        return StringUtils.countMatches(invokeTarget, ".") > 1;
+    }
+
+    /**
+     * 获取bean名称
+     * 
+     * @param invokeTarget 目标字符串
+     * @return bean名称
+     */
+    public static String getBeanName(String invokeTarget)
+    {
+        String beanName = StringUtils.substringBefore(invokeTarget, "(");
+        return StringUtils.substringBeforeLast(beanName, ".");
+    }
+
+    /**
+     * 获取bean方法
+     * 
+     * @param invokeTarget 目标字符串
+     * @return method方法
+     */
+    public static String getMethodName(String invokeTarget)
+    {
+        String methodName = StringUtils.substringBefore(invokeTarget, "(");
+        return StringUtils.substringAfterLast(methodName, ".");
+    }
+
+    /**
+     * 获取method方法参数相关列表
+     * 
+     * @param invokeTarget 目标字符串
+     * @return method方法相关参数列表
+     */
+    public static List<Object[]> getMethodParams(String invokeTarget)
+    {
+        String methodStr = StringUtils.substringBetween(invokeTarget, "(", ")");
+        if (StringUtils.isEmpty(methodStr))
+        {
+            return null;
+        }
+        String[] methodParams = methodStr.split(",");
+        List<Object[]> classs = new LinkedList<>();
+        for (int i = 0; i < methodParams.length; i++)
+        {
+            String str = StringUtils.trimToEmpty(methodParams[i]);
+            // String字符串类型,包含'
+            if (StringUtils.contains(str, "'"))
+            {
+                classs.add(new Object[] { StringUtils.replace(str, "'", ""), String.class });
+            }
+            // boolean布尔类型,等于true或者false
+            else if (StringUtils.equals(str, "true") || StringUtils.equalsIgnoreCase(str, "false"))
+            {
+                classs.add(new Object[] { Boolean.valueOf(str), Boolean.class });
+            }
+            // long长整形,包含L
+            else if (StringUtils.containsIgnoreCase(str, "L"))
+            {
+                classs.add(new Object[] { Long.valueOf(StringUtils.replaceIgnoreCase(str, "L", "")), Long.class });
+            }
+            // double浮点类型,包含D
+            else if (StringUtils.containsIgnoreCase(str, "D"))
+            {
+                classs.add(new Object[] { Double.valueOf(StringUtils.replaceIgnoreCase(str, "D", "")), Double.class });
+            }
+            // 其他类型归类为整形
+            else
+            {
+                classs.add(new Object[] { Integer.valueOf(str), Integer.class });
+            }
+        }
+        return classs;
+    }
+
+    /**
+     * 获取参数类型
+     * 
+     * @param methodParams 参数相关列表
+     * @return 参数类型列表
+     */
+    public static Class<?>[] getMethodParamsType(List<Object[]> methodParams)
+    {
+        Class<?>[] classs = new Class<?>[methodParams.size()];
+        int index = 0;
+        for (Object[] os : methodParams)
+        {
+            classs[index] = (Class<?>) os[1];
+            index++;
+        }
+        return classs;
+    }
+
+    /**
+     * 获取参数值
+     * 
+     * @param methodParams 参数相关列表
+     * @return 参数值列表
+     */
+    public static Object[] getMethodParamsValue(List<Object[]> methodParams)
+    {
+        Object[] classs = new Object[methodParams.size()];
+        int index = 0;
+        for (Object[] os : methodParams)
+        {
+            classs[index] = (Object) os[0];
+            index++;
+        }
+        return classs;
+    }
+}

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 590 - 0
web/health-hb/src/main/java/com/gyee/frame/common/spring/Constant.java


+ 397 - 0
web/health-hb/src/main/java/com/gyee/frame/common/spring/ConstantTR.java

@@ -0,0 +1,397 @@
+package com.gyee.frame.common.spring;
+
+/**
+ * 
+ * 
+ * 项目名称:nxfd 类名称:Constant 类描述: 创建人:石林 创建时间:2014-3-4 上午10:07:03 修改人:shilinno1
+ * 修改时间:2014-3-4 上午10:07:03 修改备注:
+ * 
+ * @version
+ * 
+ */
+public class ConstantTR {
+
+	public static final String QSZSWDL = "JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0136"; // 全省上网电量
+	public static final String AQTS = "HB_GD_QYG_JS_XX_XX_XXX_CI0182"; // 全省安全天数
+	public static final String QSZZGL = "JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0135"; // 全省总功率
+	public static final String QSZRFDL = "JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0088"; // 全省日累计发电量
+	public static final String QSZYFDL = "JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0146"; // 全省月累计发电量
+	public static final String QSZNFDL = "JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0037"; // 全省年累计发电量
+
+	public static final String FCRFDL = "JSFW.NX_GD_FDC_XX_XX_XXX_XXX_CI0088"; // 风场日累计发电量
+	public static final String FCYFDL = "JSFW.NX_GD_FDC_XX_XX_XXX_XXX_CI0146"; // 风场月累计发电量
+	public static final String FCNFDL = "JSFW.NX_GD_FDC_XX_XX_XXX_XXX_CI0037"; // 风场年累计发电量
+	public static final String GFRFDL = "JSFW.NX_GD_GDC_XX_XX_XXX_XXX_CI0088"; // 光伏日累计发电量
+	public static final String GFYFDL = "JSFW.NX_GD_GDC_XX_XX_XXX_XXX_CI0146"; // 光伏月累计发电量
+	public static final String GFNFDL = "JSFW.NX_GD_GDC_XX_XX_XXX_XXX_CI0037"; // 光伏年累计发电量
+	public static final String JPEYHT = "JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0216"; // 减排二氧化碳
+	public static final String JYBM = "JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0217"; // 节约标煤
+	public static final String JPEYHL = "JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0218"; // 减排二氧化硫
+	public static final String JYS = "JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0219"; // 节约水
+	public static final String FCSWDL = "JSFW.NX_GD_FDC_XX_XX_XXX_XXX_CI0136"; // 风场上网电量
+	public static final String FCZGL = "JSFW.NX_GD_FDC_XX_XX_XXX_XXX_CI0135"; // 风场总功率
+	public static final String FCFS = "JSFW.NX_GD_FDC_XX_XX_XXX_XXX_CI0134"; // 风场风速
+	public static final String GFSWDL = "JSFW.NX_GD_GDC_XX_XX_XXX_XXX_CI0136"; // 光伏上网电量
+	public static final String GFZGL = "JSFW.NX_GD_GDC_XX_XX_XXX_XXX_CI0135"; // 光伏总功率
+	public static final String FCQFDL = "JSFW.NX_GD_FDC_XX_XX_XXX_XXX_CI0110"; // 风电日欠发损失电
+
+	
+	
+	/******************************************** 麻黄山风电场 *****************************************/
+	public static final String JSFW_MHSFJZD ="MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0215"; //麻黄山风机是否中断
+	public static final String JSFW_MHSDQZD ="MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0216";//麻黄山电气是否中断
+	public static final String JSFW_MHSCFTZD ="MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0218";//麻黄山测风塔是否中断
+	public static final String JSFW_MHSDJLZD ="MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0217";//麻黄山电计量是否中断
+	public static final String JSFW_MHSAGCZD ="MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0219";//麻黄山AGC是否中断
+	
+	
+	
+	
+	
+	
+	public static final String JSFW_MHRFDLB = "MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0088"; // 麻黄山日发电量
+	public static final String JSFW_MHYFDLB = "MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0146"; // 麻黄山月发电量
+	public static final String JSFW_MHNFDLB = "MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0037"; // 麻黄山年发电量
+	public static final String JSFW_MHSWDLB = "MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0136"; // 麻黄山上网电量
+	public static final String JSFW_MHSSZGL = "MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0135"; // 麻黄山总功率
+	public static final String JSFW_MHSSFS = "MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0134"; // 麻黄山风速
+	public static final String JSFW_MHRQFSS = "MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0110"; // 麻黄山日欠发损失电量
+	public static final String MHSFGL_AI000305 = "MHSFGL.NX_GD_MHSF_YC_P1_L1_001_FGLTEM"; // 麻黄山测风塔温度
+	public static final String MHSFGL_AI000306 = "MHSFGL.NX_GD_MHSF_YC_P1_L1_001_FGLHUM"; // 麻黄山测风塔湿度
+	public static final String MHSFGL_AI000307 = "MHSFGL.NX_GD_MHSF_YC_P1_L1_001_FGLPRE"; // 麻黄山测风塔压强
+	public static final String MHSDQ_DI000006 = "MHSDQ.NX_GD_MHSF_DQ_P1_L1_001_DI0006"; // 111断路器位置
+	public static final String MHSDQ_DI000141 = "MHSDQ.NX_GD_MHSF_DQ_P1_L1_001_DI0141"; // 301断路器合闸位置
+	public static final String MHSDQ_DI000363 = "MHSDQ.NX_GD_MHSF_DQ_P1_L1_001_DI0363"; // [风场Ⅰ线9611CS]断路器位置
+	public static final String MHSDQ_DI000423 = "MHSDQ.NX_GD_MHSF_DQ_P1_L1_001_DI0423"; // [风场Ⅱ线9611CS]断路器位置
+	public static final String MHSDQ_DI000483 = "MHSDQ.NX_GD_MHSF_DQ_P1_L1_001_DI0483"; // [风场Ⅲ线9611CS]断路器位置
+
+	public static final String MHSDQ_101DLQ = "MHSDQ.NX_GD_MHSF_DQ_P1_L1_001_DI0006"; // 101断路器位置
+	public static final String MHSDQ_102DLQ = "MHSDQ.NX_GD_MHSF_DQ_P1_L1_001_DI0006"; // 102断路器位置
+	public static final String MHSDQ_302DLQ = "MHSDQ.NX_GD_MHSF_DQ_P1_L1_001_DI0141"; // 302断路器合闸位置
+	public static final String MHSDQ_321DLQ = "MHSDQ.NX_GD_MHSF_DQ_P1_L1_001_DI0985"; // 321断路器合闸位置
+
+	public static final String MHSFGL_AI000314 = "MHSFGL.NX_GD_MHSF_YC_P1_L1_001_FGLS70";// 麻黄山70m风速
+	public static final String MHSFGL_AI000315 = "MHSFGL.NX_GD_MHSF_YC_P1_L1_001_FGLD70";// 麻黄山70m风向
+	/******************************************** 麻黄山风电场 *****************************************/
+
+	/******************************************** 石板泉风电场 *****************************************/
+	public static final String JSFW_SBQFJZD ="SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0215"; //石板泉风机是否中断
+	public static final String JSFW_SBQDQZD ="SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0216";//石板泉电气是否中断
+	public static final String JSFW_SBQCFTZD ="SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0218";//石板泉测风塔是否中断
+	public static final String JSFW_SBQDJLZD ="SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0217";//石板泉电计量是否中断
+	public static final String JSFW_SBQAGCZD ="SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0219";//石板泉AGC是否中断
+
+	
+	
+	
+	
+	
+	
+	public static final String JSFW_SBRFDLB = "SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0088"; // 石板泉日发电量
+	public static final String JSFW_SBYFDLB = "SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0146"; // 石板泉月发电量
+	public static final String JSFW_SBNFDLB = "SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0037"; // 石板泉年发电量
+	public static final String JSFW_SBSWDLB = "SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0136"; // 石板泉上网电量
+	public static final String JSFW_SBSSZGL = "SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0135"; // 石板泉总功率
+	public static final String JSFW_SBSSFS = "SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0134"; // 石板泉风速
+	public static final String JSFW_SBRQFSS = "SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0110"; // 石板泉日欠发损失电量
+	public static final String SBQFGL_AI000305 = "SBQFJ.NX_GD_SBQF_FJ_P4_L9_100_AI0165"; // 石板泉测风塔温度
+	
+//	public static final String SBQFGL_AI000305 = "SBQFGL.NX_GD_SBQF_YC_P1_L1_001_FGLTEM"; // 石板泉测风塔温度
+
+	public static final String SBQFGL_AI000319 = "SBQFGL.NX_GD_SBQF_YC_P1_L1_001_FGLHUM"; // 石板泉测风塔湿度
+	public static final String SBQFGL_AI000320 = "SBQFGL.NX_GD_SBQF_YC_P1_L1_001_FGLPRE"; // 石板泉测风塔压强
+
+	public static final String SBQDQ_DI000001 = "SBQXLDQ.NX_GD_SBQF_DQ_P1_L1_001_DI0001"; // 1#进线路测控装置断路器111
+	public static final String SBQDQ_DI000161 = "SBQXLDQ.NX_GD_SBQF_DQ_P1_L1_001_DI0161"; // 1号主变测控装置高压侧断路器101
+	public static final String SBQDQ_DI000175 = "SBQXLDQ.NX_GD_SBQF_DQ_P1_L1_001_DI0175"; // 1号主变测控装置低压侧断路器301
+	public static final String SBQDQ_DI000966 = "SBQXLDQ.NX_GD_SBQF_DQ_P1_L1_001_DI0966"; // 35kV1A出线保护断路器312
+	public static final String SBQDQ_DI001030 = "SBQXLDQ.NX_GD_SBQF_DQ_P1_L1_001_DI1030"; // 35kV1B出线保护断路器313
+	public static final String SBQDQ_DI001158 = "SBQXLDQ.NX_GD_SBQF_DQ_P1_L1_001_DI1158"; // 35kV1C出线保护断路器314
+
+	public static final String SBQDQ_DI000081 = "SBQNWDQ.NX_GD_SBQF_DQ_P1_L1_001_DI0081"; // 2#进线路测控装置断路器121合闸
+	public static final String SBQDQ_DI000241 = "SBQNWDQ.NX_GD_SBQF_DQ_P1_L1_001_DI0241"; // 2号主变测控装置高压侧断路器102合闸
+	public static final String SBQDQ_DI000255 = "SBQNWDQ.NX_GD_SBQF_DQ_P1_L1_001_DI0255"; // 2号主变测控装置低压侧断路器302合位
+	public static final String SBQDQ_DI001419 = "SBQNWDQ.NX_GD_SBQF_DQ_P1_L1_001_DI1419"; // 35kV2A出线保护321断路器合位
+	public static final String SBQDQ_DI001483 = "SBQNWDQ.NX_GD_SBQF_DQ_P1_L1_001_DI1483"; // 35kV2B出线保护322断路器合位
+	public static final String SBQDQ_DI001611 = "SBQNWDQ.NX_GD_SBQF_DQ_P1_L1_001_DI1611"; // 35kV2C出线保护323断路器合位
+
+	public static final String SBQDQ_DI002536 = "SBQNWDQ.NX_GD_SBQF_DQ_P1_L1_001_DI2569"; // 35kV1A出线保护断路器331
+	public static final String SBQDQ_DI002600 = "SBQNWDQ.NX_GD_SBQF_DQ_P1_L1_001_DI2633"; // 35kV1B出线保护断路器332
+	public static final String SBQDQ_DI002915 = "SBQNWDQ.NX_GD_SBQF_DQ_P1_L1_001_DI2915"; // 2#进线路测控装置断路器151合闸
+	public static final String SBQDQ_DI000425 = "SBQNWDQ.NX_GD_SBQF_DQ_P1_L1_001_DI0425"; // 2号主变测控装置高压侧断路器105合闸
+	// public static final String SBQDQ_DI000255="SBQDQ_DI000255";
+	// //2号主变测控装置低压侧断路器305合位
+	public static final String SBQDQ_DI003272 = "SBQNWDQ.NX_GD_SBQF_DQ_P1_L1_001_DI3305"; // 35kV2A出线保护351断路器合位
+	public static final String SBQDQ_DI003336 = "SBQNWDQ.NX_GD_SBQF_DQ_P1_L1_001_DI3369"; // 35kV2B出线保护352断路器合位
+	public static final String SBQDQ_DI003400 = "SBQNWDQ.NX_GD_SBQF_DQ_P1_L1_001_DI3433"; // 35kV2C出线保护353断路器合位
+
+	public static final String SBQFGL_AI000327 = "SBQFGL.NX_GD_SBQF_YC_P1_L1_001_FGLS70";// 石板泉70m风速
+	public static final String SBQFGL_AI000328 = "SBQFGL.NX_GD_SBQF_YC_P1_L1_001_FGLD70";// 石板泉70m风向
+	/******************************************* 石板泉风电场 *****************************************/
+
+	/******************************************** 青山风电场 *****************************************/
+	public static final String JSFW_QSFJZD ="SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0215"; //石板泉风机是否中断
+	public static final String JSFW_QSDQZD ="SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0216";//石板泉电气是否中断
+	public static final String JSFW_QSCFTZD ="SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0218";//石板泉测风塔是否中断
+	public static final String JSFW_QSDJLZD ="SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0217";//石板泉电计量是否中断
+	public static final String JSFW_QSAGCZD ="SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0219";//石板泉AGC是否中断
+
+	
+	
+	
+	
+	
+	
+	
+	public static final String QSRFDL = "QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0088"; // 青山日发电量
+	public static final String QSYFDL = "QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0146"; // 青山月发电量
+	public static final String QSNFDL = "QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0037"; // 青山年发电量
+	public static final String QSSWDL = "QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0136"; // 青山上网电量
+	public static final String QSZGL = "QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0135"; // 青山总功率
+	public static final String QSFS = "QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0134"; // 青山风速
+	public static final String QSQFDL = "QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0110"; // 青山日欠发损失电量
+	public static final String QSWD = "QSFGL.NX_GD_QSF_YC_P1_L1_001_CFT019"; // 青山测风塔温度
+	// public static final String QSWD = "QSFGL_AI000323"; // 青山测风塔湿度
+	public static final String QSFGL_AI000324 = "QSFGL.NX_GD_QSF_YC_P1_L1_001_CFT020"; // 青山测风塔压强
+	public static final String QSPJFS = "QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0134"; // 青山平均风速
+
+	public static final String QSDQ_DI000377 = "QSDQ.NX_GD_QSF_DQ_P1_L1_001_DI0377"; // 110kV线路测控隔刀111-1分位
+	public static final String QSDQ_DI000530 = "QSDQ.NX_GD_QSF_DQ_P1_L1_001_DI0530"; // 1#主变测控断路器101分
+	public static final String QSDQ_DI000858 = "QSDQ.NX_GD_QSF_DQ_P1_L1_001_DI0858"; // 2#主变测控断路器102
+	public static final String QSDQ_DI000193 = "QSDQ.NX_GD_QSF_DQ_P1_L1_001_DI0193"; // 35kV公用测控1#主变35KV手车分
+	public static final String QSDQ_DI000195 = "QSDQ.NX_GD_QSF_DQ_P1_L1_001_DI0195"; // 35kV公用测控2#主变35KV手车分
+	public static final String QSDQ_DI001186 = "QSDQ.NX_GD_QSF_DQ_P1_L1_001_DI1186"; // 35kVI段集线线路1A311断路器
+	public static final String QSDQ_DI001232 = "QSDQ.NX_GD_QSF_DQ_P1_L1_001_DI1232"; // 35kVI段集线线路1B312断路器
+	public static final String QSDQ_DI001278 = "QSDQ.NX_GD_QSF_DQ_P1_L1_001_DI1278"; // 35kVI段集线线路1C313断路器
+	public static final String QSDQ_DI001416 = "QSDQ.NX_GD_QSF_DQ_P1_L1_001_DI1416"; // 35kV分段300断路器
+	public static final String QSDQ_DI001462 = "QSDQ.NX_GD_QSF_DQ_P1_L1_001_DI1462"; // 35kVII段集线线路2A323断路器
+	public static final String QSDQ_DI001508 = "QSDQ.NX_GD_QSF_DQ_P1_L1_001_DI1508"; // 35kVII段集线线路2B324断路器
+	public static final String QSDQ_DI001554 = "QSDQ.NX_GD_QSF_DQ_P1_L1_001_DI1554"; // 35kVII段集线线路2C325断路器
+
+	public static final String SLDQ_DI000103 = "SLDQ.NX_GD_QSF_DQ_P1_L1_001_DI0071";
+	public static final String SLDQ_DI000303 = "SLDQ.NX_GD_QSF_DQ_P1_L1_001_DI0123";
+	public static final String SLDQ_DI000331 = "SLDQ.NX_GD_QSF_DQ_P1_L1_001_DI1615";
+	public static final String SLDQ_DI000332 = "SLDQ.NX_GD_QSF_DQ_P1_L1_001_DI1701";
+
+	public static final String QSFGL_AI000313 = "QSFGL.NX_GD_QSF_YC_P1_L1_001_CFT009";// 青山70m风速
+	public static final String QSFGL_AI000314 = "QSFGL.NX_GD_QSF_YC_P1_L1_001_CFT010";// 青山70m风向
+	/******************************************** 青山风电场 *****************************************/
+
+	/******************************************** 牛首山风电场 *****************************************/
+	public static final String NSSRFDL = "NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0088"; // 牛首山日发电量
+	public static final String NSSYFDL = "NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0146"; // 牛首山月发电量
+	public static final String NSSNFDL = "NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0037"; // 牛首山年发电量
+	public static final String NSSSWDL = "NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0136"; // 牛首山上网电量
+	public static final String NSSZGL = "NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0135"; // 牛首山总功率
+	public static final String NSSFS = "NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0134"; // 牛首山风速
+	public static final String NSSQFDL = "NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0110"; // 牛首山日欠发损失电量
+	//public static final String NSSWD = "NSSFGL.NX_GD_NSSF_YC_P1_L1_001_FGLTEM"; // 牛首山测风塔温度
+	public static final String NSSWD = "NSSFJ.NX_GD_NSSF_FJ_P1_L2_013_AI0056"; // 牛首山测风塔温度
+	
+	public static final String NSSFGL_AI000306 = "NSSFGL.NX_GD_NSSF_YC_P1_L1_001_FGLHUM"; // 牛首山测风塔湿度
+	public static final String NSSFGL_AI000307 = "NSSFGL.NX_GD_NSSF_YC_P1_L1_001_FGLPRE"; // 牛首山测风塔压强
+	public static final String NSSPJFS = "NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0134"; // 牛首山平均风速
+
+	public static final String NSSZ111 = "NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_DI0003"; // 首风II甲线111开关位置
+	public static final String NSSZ101 = "NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_DI0019"; // 101开关位置
+	public static final String NSSZ102 = "NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_DI0034"; // 102开关位置
+	public static final String NSSZ301 = "NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_DI0025"; // 301开关位置
+	public static final String NSSZ302 = "NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_DI0040"; // 302开关位置
+	public static final String NSSZ312 = "NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_DI0070"; // 集电线路一312开关位置
+	public static final String NSSZ313 = "NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_DI0076"; // 集电线路二313开关位置
+	public static final String NSSZ314 = "NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_DI0082"; // 集电线路三314开关位置
+	public static final String NSSZ321 = "NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_DI0098"; // 集电线路四321开关位置
+	public static final String NSSZ322 = "NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_DI0104"; // 集电线路五322开关位置
+	public static final String NSSZ323 = "NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_DI0110"; // 集电线路六323开关位置
+	public static final String NSSZ121 = "NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_DI0011"; // 首风II乙线121开关位置
+	public static final String NSSZ103 = "NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_DI0049"; // 103开关位置
+	public static final String NSSZ303 = "NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_DI0055"; // 303开关位置
+	public static final String NSSZ351 = "NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_DI0126"; // 集电线路七351开关位置
+	public static final String NSSZ353 = "NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_DI0132"; // 集电线路八353开关位置
+	public static final String NSSZ354 = "NSSDQN.NX_GD_NSSF_DQ_P1_L1_001_DI0138"; // 集电线路九354开关位置
+
+	public static final String NSSDQ_AI000703 = "NSSFGL.NX_GD_NSSF_YC_P1_L1_001_FGLS70";// 牛首山70m风速
+	public static final String NSSDQ_AI000704 = "NSSFGL.NX_GD_NSSF_YC_P1_L1_001_FGLD70";// 牛首山70m风向
+	/******************************************** 牛首山风电场 *****************************************/
+
+	/******************************************** 大武口风电场 *****************************************/
+	public static final String DWKRFDL = "DWKGDCJSFW.NX_GD_DWKG_XX_XX_XXX_XXX_CI0088"; // 大武口日发电量
+	public static final String DWKYFDL = "DWKGDCJSFW.NX_GD_DWKG_XX_XX_XXX_XXX_CI0146"; // 大武口月发电量
+	public static final String DWKNFDL = "DWKGDCJSFW.NX_GD_DWKG_XX_XX_XXX_XXX_CI0037"; // 大武口年发电量
+	public static final String DWKSWDL = "DWKGDCJSFW.NX_GD_DWKG_XX_XX_XXX_XXX_CI0136"; // 大武口上网电量
+	public static final String DWKZGL = "DWKDQ.NX_GD_DWKG_DQ_P1_L1_001_AI0002"; // 大武口总功率
+	public static final String DWKFS = "DWKGDCJSFW.NX_GD_DWKG_XX_XX_XXX_XXX_CI0134";// 大武口日照强度;
+	// public static final String DWKFS =
+	// "DWKGF.NX_GD_DWKG_GF_P1_L2_010_AI0672";// "JSFW_DWSSFS";
+	// //
+	// 大武口日照强度
+	//public static final String DWKWD = "DWKGGL.NX_GD_DWKG_YC_P1_L1_001_QXZ004"; // 大武口测风塔温度
+	public static final String DWKWD = "DWKGF.NX_GD_DWKG_GF_P1_L2_010_AI0663"; // 大武口测风塔温度
+	
+	public static final String DWKPJFS = "DWKGDCJSFW.NX_GD_DWKG_XX_XX_XXX_XXX_CI0134"; // 大武口平均风速
+
+	public static final String DWKZ310 = "DWKDQ.NX_GD_DWKG_DQ_P1_L1_001_DI0024"; // 35kV出线柜310开关位置
+	public static final String DWKZ314 = "DWKDQ.NX_GD_DWKG_DQ_P1_L1_001_DI0027"; // 35kV#1光伏进线柜314开关位置
+	public static final String DWKZ315 = "DWKDQ.NX_GD_DWKG_DQ_P1_L1_001_DI0028"; // 35kV#2光伏进线柜315开关位置
+	/******************************************** 大武口风电场 *****************************************/
+
+	/******************************************** 平罗电场 *****************************************/
+	public static final String PLRFDL = "PLGDCJSFW.NX_GD_PLG_XX_XX_XXX_XXX_CI0088"; // 平罗日发电量
+	public static final String PLYFDL = "PLGDCJSFW.NX_GD_PLG_XX_XX_XXX_XXX_CI0146"; // 平罗月发电量
+	public static final String PLNFDL = "PLGDCJSFW.NX_GD_PLG_XX_XX_XXX_XXX_CI0037"; // 平罗年发电量
+	public static final String PLSWDL = "PLGDCJSFW.NX_GD_PLG_XX_XX_XXX_XXX_CI0136"; // 平罗上网电量
+	public static final String PLZGL = "PLGDCJSFW.NX_GD_PLG_XX_XX_XXX_XXX_CI0135"; // 平罗总功率
+	public static final String PLFS = "PLGGL.NX_GD_PLG_YC_P1_L1_001_QXZ0001"; // 平罗日照强度
+	public static final String PLWD = "PLGGL.NX_GD_PLG_YC_P1_L1_001_QXZ004"; // 平罗测风塔温度
+	public static final String PLPJFS = "PLGGL.NX_GD_PLG_YC_P1_L1_001_QXZ0001"; // 平罗平均风速
+
+	// 平罗1
+	public static final String PLZ1310 = "PLSJ1.NX_GD_PLG_DQ_P1_L1_001_DI0001"; // 35kV出线柜310开关位置
+	public static final String PLZ1313 = "PLSJ1.NX_GD_PLG_DQ_P1_L1_001_DI0005"; // I期313开关断路器合位
+	public static final String PLZ1314 = "PLSJ1.NX_GD_PLG_DQ_P1_L1_001_DI0007"; // I期314开关断路器合位
+	public static final String PLZ1315 = "PLSJ1.NX_GD_PLG_DQ_P1_L1_001_DI0009"; // I期315开关断路器合位
+	public static final String PLZ1316 = "PLSJ1.NX_GD_PLG_DQ_P1_L1_001_DI0011"; // I期316开关断路器合位
+	public static final String PLZ1317 = "PLSJ1.NX_GD_PLG_DQ_P1_L1_001_DI0013"; // I期317开关断路器合位
+	// 平罗2
+	public static final String PLZ2310 = "PLSJ2.NX_GD_PLG_DD_P1_L1_001_DI0001"; // 20#逆变器电网交流过压
+	public static final String PLZ2322 = "PLSJ2.NX_GD_PLG_DD_P1_L1_001_DI0017"; // 20#逆变器防雷器故障
+	public static final String PLZ2323 = "PLSJ2.NX_GD_PLG_DD_P1_L1_001_DI0019"; // 20#逆变器防反放电保护
+	/******************************************** 平罗电场 *****************************************/
+
+	/******************************************** 马场湖风电场 *****************************************/
+
+	public static final String MCHRFDL = "JSFW_MCRFDLB"; // 马场湖日发电量
+	public static final String MCHYFDL = "JSFW_MCYFDLB"; // 马场湖月发电量
+	public static final String MCHNFDL = "JSFW_MCNFDLB"; // 马场湖年发电量
+	public static final String MCHSWDL = "JSFW_MCSWDLB"; // 马场湖上网电量
+	public static final String MCHZGL = "JSFW_MCSSZGL"; // 马场湖总功率
+	public static final String MCHFS = "JSFW_MCSSFSX"; // 马场湖日照强度
+	public static final String MCHWD = "MCHGGL_AI000308"; // 马场湖测风塔温度
+	public static final String MCHPJFS = "JSFW_MCSSFS"; // 马场湖平均风速
+
+	public static final String MCHZ511 = "MCHDQ_DI110749"; // 马场湖光伏开关站xj-断路器位置
+	public static final String MCHZ510 = "MCHDQ_DI110027"; // 马场湖光伏开关站10ah-3
+	// 1#进线柜-断路器位置
+	public static final String MCHZ512 = "MCHDQ_DI110317"; // 马场湖光伏开关站10ah-4
+	// 2#进线-断路器位置
+	public static final String MCHZ513 = "MCHDQ_DI110197"; // 马场湖光伏开关站10ah-5
+	// 3#进线-断路器位置
+	public static final String MCHZ514 = "MCHDQ_DI110080"; // 马场湖光伏开关站10ah-14
+	// 电容器-断路器位置
+	public static final String MCHZ515 = "MCHDQ_DI110137"; // 马场湖光伏开关站10ah-7
+	// 5#进线-断路器位置
+	public static final String MCHZ516 = "MCHDQ_DI110377"; // 马场湖光伏开关站10ah-8
+	// 6#进线-断路器位置
+	public static final String MCHZ517 = "MCHDQ_DI110437"; // 马场湖光伏开关站10ah-9
+	// 7#进线-断路器位置
+	public static final String MCHZ518 = "MCHDQ_DI110497"; // 马场湖光伏开关站10ah-10
+	// 8#进线-断路器位置
+	public static final String MCHZ519 = "MCHDQ_DI110557"; // 马场湖光伏开关站10ah-11
+	// 9#进线-断路器位置
+	public static final String MCHZ520 = "MCHDQ_DI110617"; // 马场湖光伏开关站10ah-12
+	// 10#进线-断路器位置
+	/******************************************** 马场湖风电场 *****************************************/
+
+	/******************************************** 宣和风电场 *****************************************/
+	public static final String XHRFDL = "XHGDCJSFW.NX_GD_XHG_XX_XX_XXX_XXX_CI0088"; // 宣和日发电量
+	public static final String XHYFDL = "XHGDCJSFW.NX_GD_XHG_XX_XX_XXX_XXX_CI0146"; // 宣和月发电量
+	public static final String XHNFDL = "XHGDCJSFW.NX_GD_XHG_XX_XX_XXX_XXX_CI0037"; // 宣和年发电量
+	public static final String XHSWDL = "XHGDCJSFW.NX_GD_XHG_XX_XX_XXX_XXX_CI0136"; // 宣和上网电量
+	public static final String XHZGL = "XHDQ.NX_GD_XHG_DQ_P1_L1_001_AI0002"; // 宣和总功率
+	public static final String XHFS = "XHGGL.NX_GD_XHG_YC_P1_L1_001_QXZ001"; // 宣和日照强度
+																				// XHDQ.NX_GD_XHG_DQ_P1_L1_001_AI0192
+	// public static final String XHFS =
+	// "XHGDCJSFW.NX_GD_XHG_XX_XX_XXX_XXX_CI0134"; // 宣和日照强度
+	public static final String XHWD = "XHGDCJSFW.NX_GD_XHG_XX_XX_XXX_XXX_CI0134"; // 宣和测风塔温度
+	public static final String XHPJFS = "XHGDCJSFW.NX_GD_XHG_XX_XX_XXX_XXX_CI0134"; // 宣和平均风速
+
+	public static final String XHZ311 = "XHDQ.NX_GD_XHG_DQ_P1_L1_001_DI0001"; // 35kV草光I线开关位置
+	public static final String XHZ313 = "XHDQ.NX_GD_XHG_DQ_P1_L1_001_DI0025"; // 35kV1#进线313开关位置
+	public static final String XHZ314 = "XHDQ.NX_GD_XHG_DQ_P1_L1_001_DI0027"; // 35kV2#进线314开关位置
+	public static final String XHZ316 = "XHDQ.NX_GD_XHG_DQ_P1_L1_001_DI0031"; // 35kV4#进线316开关位置
+	public static final String XHZ315 = "XHDQ.NX_GD_XHG_DQ_P1_L1_001_DI0029"; // 35kV3#进线315开关位置
+	/******************************************** 宣和风电场 *****************************************/
+
+	/******************************************** 海子井风电场 *****************************************/
+	public static final String HZJWD = "HZJGDCJSFW.NX_GD_HZJG_XX_XX_XXX_XXX_CI0134"; // 宣和测风塔温度
+	public static final String HZJPJFS = "HZJGDCJSFW.NX_GD_HZJG_XX_XX_XXX_XXX_CI0134"; // 宣和平均风速
+	/******************************************** 海子井风电场 *****************************************/
+
+	/******************************************** 香山风电场 *****************************************/
+	public static final String XSRFDL = "XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0088"; // 香山日发电量
+	public static final String XSYFDL = "XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0146"; // 香山月发电量
+	public static final String XSNFDL = "XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0037"; // 香山年发电量
+	public static final String XSSWDL = "XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0136"; // 香山上网电量
+	public static final String XSZGL = "XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0135"; // 香山总功率
+	public static final String XSFS = "XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0134"; // 香山风速
+	public static final String XSQFDL = "XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0110"; // 香山日欠发损失电量
+
+	public static final String XSWD = "XSFGL.NX_GD_XSF_YC_P1_L1_001_FGLTEM"; // 香山测风塔温度
+	public static final String XSFGL_AI000007 = "XSFGL.NX_GD_XSF_YC_P1_L1_001_FGLHUM"; // 香山测风塔湿度
+	public static final String XSFGL_AI000008 = "XSFGL.NX_GD_XSF_YC_P1_L1_001_FGLPRE"; // 香山测风塔压强
+	public static final String XSPJFS = "XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0134"; // 香山平均风速
+
+	public static final String XSDQ_DI000034 = "XSDQ.NX_GD_XSF_DQ_P1_L1_001_DI0034"; // #111断路器
+	public static final String XSDQ_DI000169 = "XSDQ.NX_GD_XSF_DQ_P1_L1_001_DI0169"; // 101断路器
+	public static final String XSDQ_DI000308 = "XSDQ.NX_GD_XSF_DQ_P1_L1_001_DI0308"; // 102断路器
+	public static final String XSDQ_DI000192 = "XSDQ.NX_GD_XSF_DQ_P1_L1_001_DI0192"; // 301断路器
+	public static final String XSDQ_DI000331 = "XSDQ.NX_GD_XSF_DQ_P1_L1_001_DI0331"; // 302断路器
+	// 香山电气点没有,采用类似点,目前不一定准确
+	public static final String XSDQ_DI000850 = "XSDQ.NX_GD_XSF_DQ_P1_L1_001_DI1368"; // 311断路器
+	public static final String XSDQ_DI000915 = "XSDQ.NX_GD_XSF_DQ_P1_L1_001_DI1629"; // 312断路器
+	public static final String XSDQ_DI001210 = "XSDQ.NX_GD_XSF_DQ_P1_L1_001_DI1501"; // 323断路器
+	public static final String XSDQ_DI001145 = "XSDQ.NX_GD_XSF_DQ_P1_L1_001_DI1501"; // 322断路器
+
+	public static final String XSFGL_AI000003 = "XSFGL.NX_GD_XSF_YC_P1_L1_001_FGLS70";// 香山70m风速
+	public static final String XSFGL_AI000005 = "XSFGL.NX_GD_XSF_YC_P1_L1_001_FGLD70";// 香山70m风向
+	/******************************************** 香山风电场 *****************************************/
+
+	public static final String DWKGDCJSFW_CI0195 = "DWKGDCJSFW.NX_GD_DWKG_XX_XX_XXX_XXX_CI0195"; // 风机设备在线状态
+	public static final String DWKGDCJSFW_CI0196 = "DWKGDCJSFW.NX_GD_DWKG_XX_XX_XXX_XXX_CI0196"; // 升压站在线状态
+	public static final String DWKGDCJSFW_CI0197 = "DWKGDCJSFW.NX_GD_DWKG_XX_XX_XXX_XXX_CI0197"; // 电计量在线状态
+	public static final String DWKGDCJSFW_CI0198 = "DWKGDCJSFW.NX_GD_DWKG_XX_XX_XXX_XXX_CI0198"; // 测风塔在线状态
+	public static final String DWKGDCJSFW_CI0199 = "DWKGDCJSFW.NX_GD_DWKG_XX_XX_XXX_XXX_CI0199"; // agc在线状态
+
+	public static final String MHSFCJSFW_CI0215 = "MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0215"; // 风机设备在线状态
+	public static final String MHSFCJSFW_CI0216 = "MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0216"; // 升压站在线状态
+	public static final String MHSFCJSFW_CI0217 = "MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0217"; // 电计量在线状态
+	public static final String MHSFCJSFW_CI0218 = "MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0218"; // 测风塔在线状态
+	public static final String MHSFCJSFW_CI0219 = "MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0219"; // agc在线状态
+
+	public static final String NSSFCJSFW_CI0215 = "NSSFCJSFW_NX_GD_NSSF_XX_XX_XXX_XXX_CI0215"; // 风机设备在线状态
+	public static final String NSSFCJSFW_CI0216 = "NSSFCJSFW_NX_GD_NSSF_XX_XX_XXX_XXX_CI0216"; // 升压站在线状态
+	public static final String NSSFCJSFW_CI0217 = "NSSFCJSFW_NX_GD_NSSF_XX_XX_XXX_XXX_CI0217"; // 电计量在线状态
+	public static final String NSSFCJSFW_CI0218 = "NSSFCJSFW_NX_GD_NSSF_XX_XX_XXX_XXX_CI0218"; // 测风塔在线状态
+	public static final String NSSFCJSFW_CI0219 = "NSSFCJSFW_NX_GD_NSSF_XX_XX_XXX_XXX_CI0219"; // agc在线状态
+
+	public static final String PLGDCJSFW_CI0195 = "PLGDCJSFW.NX_GD_PLG_XX_XX_XXX_XXX_CI0195"; // 风机设备在线状态
+	public static final String PLGDCJSFW_CI0196 = "PLGDCJSFW.NX_GD_PLG_XX_XX_XXX_XXX_CI0196"; // 升压站在线状态
+	public static final String PLGDCJSFW_CI0197 = "PLGDCJSFW.NX_GD_PLG_XX_XX_XXX_XXX_CI0197"; // 电计量在线状态
+	public static final String PLGDCJSFW_CI0198 = "PLGDCJSFW.NX_GD_PLG_XX_XX_XXX_XXX_CI0198"; // 测风塔在线状态
+	public static final String PLGDCJSFW_CI0199 = "PLGDCJSFW.NX_GD_PLG_XX_XX_XXX_XXX_CI0199"; // agc在线状态
+
+	public static final String QSFCJSFW_CI0215 = "QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0215"; // 风机设备在线状态
+	public static final String QSFCJSFW_CI0216 = "QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0216"; // 升压站在线状态
+	public static final String QSFCJSFW_CI0217 = "QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0217"; // 电计量在线状态
+	public static final String QSFCJSFW_CI0218 = "QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0218"; // 测风塔在线状态
+	public static final String QSFCJSFW_CI0219 = "QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0219"; // agc在线状态
+
+	public static final String SBQFCJSFW_CI0215 = "SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0215"; // 风机设备在线状态
+	public static final String SBQFCJSFW_CI0216 = "SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0216"; // 升压站在线状态
+	public static final String SBQFCJSFW_CI0217 = "SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0217"; // 电计量在线状态
+	public static final String SBQFCJSFW_CI0218 = "SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0218"; // 测风塔在线状态
+	public static final String SBQFCJSFW_CI0219 = "SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0219"; // agc在线状态
+
+	public static final String XHGDCJSFW_CI0195 = "XHGDCJSFW.NX_GD_XHG_XX_XX_XXX_XXX_CI0195"; // 风机设备在线状态
+	public static final String XHGDCJSFW_CI0196 = "XHGDCJSFW.NX_GD_XHG_XX_XX_XXX_XXX_CI0196"; // 升压站在线状态
+	public static final String XHGDCJSFW_CI0197 = "XHGDCJSFW.NX_GD_XHG_XX_XX_XXX_XXX_CI0197"; // 电计量在线状态
+	public static final String XHGDCJSFW_CI0198 = "XHGDCJSFW.NX_GD_XHG_XX_XX_XXX_XXX_CI0198"; // 测风塔在线状态
+	public static final String XHGDCJSFW_CI0199 = "XHGDCJSFW.NX_GD_XHG_XX_XX_XXX_XXX_CI0199"; // agc在线状态
+
+	public static final String XSFCJSFW_CI0215 = "XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0215"; // 风机设备在线状态
+	public static final String XSFCJSFW_CI0216 = "XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0216"; // 升压站在线状态
+	public static final String XSFCJSFW_CI0217 = "XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0217"; // 电计量在线状态
+	public static final String XSFCJSFW_CI0218 = "XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0218"; // 测风塔在线状态
+	public static final String XSFCJSFW_CI0219 = "XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0219"; // agc在线状态
+
+}

+ 377 - 0
web/health-hb/src/main/java/com/gyee/frame/common/spring/InitialRedis.java

@@ -0,0 +1,377 @@
+package com.gyee.frame.common.spring;
+
+import com.alibaba.fastjson.JSON;
+import com.gyee.frame.common.cache.IGlobalCache;
+import com.gyee.frame.model.auto.*;
+import com.gyee.frame.model.custom.PointData;
+import com.gyee.frame.service.WindPowerstationTestingPoint2Service;
+import com.gyee.frame.service.WindTurbineTestingPointAiService;
+import com.gyee.frame.service.WindturbinepowercurvefittingService;
+import com.gyee.frame.util.DateUtils;
+import com.gyee.frame.util.IRealTimeDataBaseUtil;
+import com.gyee.frame.util.RealTimeDataBaseFactory;
+
+import java.text.DecimalFormat;
+import java.util.*;
+
+
+public  class InitialRedis {
+
+    public static Map<String, Map<Double, Windturbinepowercurvefitting>> wpcmap = new HashMap<String, Map<Double, Windturbinepowercurvefitting>>();
+
+
+    IRealTimeDataBaseUtil realApiUtil = RealTimeDataBaseFactory.createRealTimeDataBase();
+
+    public  void intialWindturbinepowercurvefitting() throws Exception {
+
+
+        WindturbinepowercurvefittingService windturbinepowercurvefittingService= SpringUtils.getBean("windturbinepowercurvefittingService");
+        IGlobalCache globalCache= SpringUtils.getBean("globalCache");
+
+        WindturbinepowercurvefittingExample windturbinepowercurvefittingExample = new WindturbinepowercurvefittingExample();
+        windturbinepowercurvefittingExample.setOrderByClause("WINDTURBINEID ASC,speed ASC");
+        List<Windturbinepowercurvefitting> wpclist = windturbinepowercurvefittingService.selectByExample(windturbinepowercurvefittingExample);
+
+        if (!wpclist.isEmpty()) {
+            for (Windturbinepowercurvefitting wc : wpclist) {
+                if (wpcmap.containsKey(wc.getWindturbineid())) {
+                    Map<Double, Windturbinepowercurvefitting> map = wpcmap.get(wc.getWindturbineid());
+                    map.put(wc.getSpeed(), wc);
+                } else {
+                    Map<Double, Windturbinepowercurvefitting> map = new HashMap<Double, Windturbinepowercurvefitting>();
+                    map.put(wc.getSpeed(), wc);
+                    wpcmap.put(wc.getWindturbineid(), map);
+                }
+            }
+        }
+
+        globalCache.set("wpcmap", JSON.toJSONString(wpcmap));
+    }
+
+
+    public  void intialWpScatter() throws Exception {
+
+
+
+        WindPowerstationTestingPoint2Service windPowerstationTestingPoint2Service= SpringUtils.getBean("windPowerstationTestingPoint2Service");
+        WindTurbineTestingPointAiService windTurbineTestingPointAiService= SpringUtils.getBean("windTurbineTestingPointAiService");
+        IGlobalCache globalCache= SpringUtils.getBean("globalCache");
+
+
+        Calendar cal = Calendar.getInstance();
+        cal.set(Calendar.HOUR_OF_DAY, 0);
+        cal.set(Calendar.MINUTE, 0);
+        cal.set(Calendar.SECOND, 0);
+
+        int month=cal.get(Calendar.MONTH)+1;
+
+
+        cal.set(Calendar.MONTH, 0);
+
+        for(int j=0;j<month;j++)
+        {
+            List<List<Double>> vos = new ArrayList<List<Double>>();
+            cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
+            Date beginDate = cal.getTime();
+            Date endDate =null;
+            if(month-1==cal.get(Calendar.MONTH))
+            {
+                cal = Calendar.getInstance();
+               //cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
+                endDate = cal.getTime();
+            }else
+            {
+                cal.add(Calendar.MONTH,1);;
+                endDate = cal.getTime();
+            }
+
+
+            for(Windpowerstation wp:InitialRunner.wpls)
+            {
+                String wpId=wp.getId();
+                Windpowerstationpointnew gl = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(wpId, Constant.TPOINT_WP_SJGL);
+                Windpowerstationpointnew fs = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(wpId, Constant.TPOINT_WP_SSFS);
+
+                int daynum = DateUtils.daysDiff(beginDate, endDate);
+                long pried = 600 ;
+                long count = 6 * 24 * daynum;
+
+                DecimalFormat dcmFmt = new DecimalFormat("0.00");
+                List<PointData> gls = realApiUtil.getHistoryDatasSnap(gl, beginDate.getTime() / 1000, endDate.getTime() / 1000, count, pried);
+
+                List<PointData> fss = realApiUtil.getHistoryDatasSnap(fs, beginDate.getTime() / 1000, endDate.getTime() / 1000, count, pried);
+
+
+                if (!gls.isEmpty() && !fss.isEmpty()) {
+                    for (int i = 0; i < fss.size(); i++) {
+
+                        List<Double> ds = new ArrayList<Double>();
+
+                        double f = fss.get(i).getPointValueInDouble();
+                        ds.add(Double.valueOf(dcmFmt.format(f)));
+                        f = gls.get(i).getPointValueInDouble();
+                        ds.add(Double.valueOf(dcmFmt.format(f)));
+                        vos.add(ds);
+                    }
+                }
+
+               // cal.add(Calendar.MONTH,1);
+                StringBuilder sb=new StringBuilder();
+                sb.append("scatter_").append(wpId).append("_").append(j+1);
+                globalCache.set(String.valueOf(sb), JSON.toJSONString(vos));
+                System.out.println(String.valueOf(sb.append("完成")));
+            }
+        }
+
+
+
+    }
+
+
+
+    public  void intialPjScatter() throws Exception {
+
+
+
+        WindPowerstationTestingPoint2Service windPowerstationTestingPoint2Service= SpringUtils.getBean("windPowerstationTestingPoint2Service");
+        WindTurbineTestingPointAiService windTurbineTestingPointAiService= SpringUtils.getBean("windTurbineTestingPointAiService");
+        IGlobalCache globalCache= SpringUtils.getBean("globalCache");
+
+
+        Calendar cal = Calendar.getInstance();
+        cal.set(Calendar.HOUR_OF_DAY, 0);
+        cal.set(Calendar.MINUTE, 0);
+        cal.set(Calendar.SECOND, 0);
+
+        int month=cal.get(Calendar.MONTH)+1;
+
+
+        cal.set(Calendar.MONTH, 0);
+
+        for(int j=0;j<month;j++)
+        {
+            List<List<Double>> vos = new ArrayList<List<Double>>();
+            cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
+            Date beginDate = cal.getTime();
+            Date endDate =null;
+            if(month-1==cal.get(Calendar.MONTH))
+            {
+                cal = Calendar.getInstance();
+                //cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
+                endDate = cal.getTime();
+            }else
+            {
+                cal.add(Calendar.MONTH,1);;
+                endDate = cal.getTime();
+            }
+
+
+            for(Project pj:InitialRunner.pjls)
+            {
+                String wpId=pj.getId();
+                Windpowerstationpointnew gl = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(wpId, Constant.TPOINT_WP_SJGL);
+                Windpowerstationpointnew fs = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(wpId, Constant.TPOINT_WP_SSFS);
+
+                int daynum = DateUtils.daysDiff(beginDate, endDate);
+                long pried = 600 ;
+                long count = 6 * 24 * daynum;
+
+                DecimalFormat dcmFmt = new DecimalFormat("0.00");
+                List<PointData> gls = realApiUtil.getHistoryDatasSnap(gl, beginDate.getTime() / 1000, endDate.getTime() / 1000, count, pried);
+
+                List<PointData> fss = realApiUtil.getHistoryDatasSnap(fs, beginDate.getTime() / 1000, endDate.getTime() / 1000, count, pried);
+
+
+                if (!gls.isEmpty() && !fss.isEmpty()) {
+                    for (int i = 0; i < fss.size(); i++) {
+
+                        List<Double> ds = new ArrayList<Double>();
+
+                        double f = fss.get(i).getPointValueInDouble();
+                        ds.add(Double.valueOf(dcmFmt.format(f)));
+                        f = gls.get(i).getPointValueInDouble();
+                        ds.add(Double.valueOf(dcmFmt.format(f)));
+                        vos.add(ds);
+                    }
+                }
+
+                // cal.add(Calendar.MONTH,1);
+                StringBuilder sb=new StringBuilder();
+                sb.append("scatter_").append(wpId).append("_").append(j+1);
+                globalCache.set(String.valueOf(sb), JSON.toJSONString(vos));
+                System.out.println(String.valueOf(sb.append("完成")));
+            }
+        }
+
+
+
+    }
+
+
+
+    public  void intialLnScatter() throws Exception {
+
+
+
+        WindPowerstationTestingPoint2Service windPowerstationTestingPoint2Service= SpringUtils.getBean("windPowerstationTestingPoint2Service");
+        WindTurbineTestingPointAiService windTurbineTestingPointAiService= SpringUtils.getBean("windTurbineTestingPointAiService");
+        IGlobalCache globalCache= SpringUtils.getBean("globalCache");
+
+
+        Calendar cal = Calendar.getInstance();
+        cal.set(Calendar.HOUR_OF_DAY, 0);
+        cal.set(Calendar.MINUTE, 0);
+        cal.set(Calendar.SECOND, 0);
+
+        int month=cal.get(Calendar.MONTH)+1;
+
+
+        cal.set(Calendar.MONTH, 0);
+
+        for(int j=0;j<month;j++)
+        {
+            List<List<Double>> vos = new ArrayList<List<Double>>();
+            cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
+            Date beginDate = cal.getTime();
+            Date endDate =null;
+            if(month-1==cal.get(Calendar.MONTH))
+            {
+                cal = Calendar.getInstance();
+                //cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
+                endDate = cal.getTime();
+            }else
+            {
+                cal.add(Calendar.MONTH,1);;
+                endDate = cal.getTime();
+            }
+
+
+            for(Line wp:InitialRunner.linels)
+            {
+                String wpId=wp.getId();
+                Windpowerstationpointnew gl = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(wpId, Constant.TPOINT_WP_SJGL);
+                Windpowerstationpointnew fs = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(wpId, Constant.TPOINT_WP_SSFS);
+
+                int daynum = DateUtils.daysDiff(beginDate, endDate);
+                long pried = 600 ;
+                long count = 6 * 24 * daynum;
+
+                DecimalFormat dcmFmt = new DecimalFormat("0.00");
+                List<PointData> gls = realApiUtil.getHistoryDatasSnap(gl, beginDate.getTime() / 1000, endDate.getTime() / 1000, count, pried);
+
+                List<PointData> fss = realApiUtil.getHistoryDatasSnap(fs, beginDate.getTime() / 1000, endDate.getTime() / 1000, count, pried);
+
+
+                if (!gls.isEmpty() && !fss.isEmpty()) {
+                    for (int i = 0; i < fss.size(); i++) {
+
+                        List<Double> ds = new ArrayList<Double>();
+
+                        double f = fss.get(i).getPointValueInDouble();
+                        ds.add(Double.valueOf(dcmFmt.format(f)));
+                        f = gls.get(i).getPointValueInDouble();
+                        ds.add(Double.valueOf(dcmFmt.format(f)));
+                        vos.add(ds);
+                    }
+                }
+
+                // cal.add(Calendar.MONTH,1);
+                StringBuilder sb=new StringBuilder();
+                sb.append("scatter_").append(wpId).append("_").append(j+1);
+                globalCache.set(String.valueOf(sb), JSON.toJSONString(vos));
+                System.out.println(String.valueOf(sb.append("完成")));
+            }
+        }
+
+
+
+    }
+
+
+    public  void intialWtScatter() throws Exception {
+
+
+        WindTurbineTestingPointAiService windTurbineTestingPointAiService= SpringUtils.getBean("windTurbineTestingPointAiService");
+        IGlobalCache globalCache= SpringUtils.getBean("globalCache");
+
+
+        Calendar cal = Calendar.getInstance();
+        cal.set(Calendar.HOUR_OF_DAY, 0);
+        cal.set(Calendar.MINUTE, 0);
+        cal.set(Calendar.SECOND, 0);
+
+        int month=cal.get(Calendar.MONTH)+1;
+
+
+        cal.set(Calendar.MONTH, 0);
+
+
+            List<List<Double>> vos = new ArrayList<List<Double>>();
+            cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
+            Date beginDate = cal.getTime();
+            Date endDate =null;
+            if(month-1==cal.get(Calendar.MONTH))
+            {
+                cal = Calendar.getInstance();
+                //cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
+                endDate = cal.getTime();
+            }else
+            {
+                cal.add(Calendar.MONTH,1);;
+                endDate = cal.getTime();
+            }
+
+
+            for(Windturbine wt:InitialRunner.wtls)
+            {
+                String wpId=wt.getId();
+                Windturbinetestingpointnew gl = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wpId, Constant.TPOINT_WT_FJGL);
+                Windturbinetestingpointnew fs = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wpId, Constant.TPOINT_WT_FJSSFS);
+
+                int daynum = DateUtils.daysDiff(beginDate, endDate);
+                long pried = 600 ;
+                long count = 6 * 24 * daynum;
+
+                DecimalFormat dcmFmt = new DecimalFormat("0.00");
+                List<PointData> gls = realApiUtil.getHistoryDatasSnap(gl, beginDate.getTime() / 1000, endDate.getTime() / 1000, count, pried);
+
+                List<PointData> fss = realApiUtil.getHistoryDatasSnap(fs, beginDate.getTime() / 1000, endDate.getTime() / 1000, count, pried);
+
+
+                if (!gls.isEmpty() && !fss.isEmpty()) {
+                    for (int i = 0; i < fss.size(); i++) {
+
+                        List<Double> ds = new ArrayList<Double>();
+
+                        double f = fss.get(i).getPointValueInDouble();
+                        ds.add(Double.valueOf(dcmFmt.format(f)));
+                        f = gls.get(i).getPointValueInDouble();
+                        ds.add(Double.valueOf(dcmFmt.format(f)));
+                        vos.add(ds);
+                    }
+                }
+
+                // cal.add(Calendar.MONTH,1);
+                StringBuilder sb=new StringBuilder();
+                sb.append("scatter_").append(wpId).append("_").append(month);
+                globalCache.set(String.valueOf(sb), JSON.toJSONString(vos));
+                System.out.println(String.valueOf(sb.append("完成")));
+            }
+
+
+
+
+    }
+
+    public static void main(String[]args) throws Exception {
+
+//        SpringApplication.run(SpringbootStart.class, args);
+//
+//        InitialRedis initialRedis=new InitialRedis();
+//        //初始化风机拟合功率
+//      // initialRedis.intialWindturbinepowercurvefitting();
+//
+//        //初始化场站没有散点图
+//        initialRedis.intialWpScatter();
+    }
+}

+ 497 - 0
web/health-hb/src/main/java/com/gyee/frame/common/spring/InitialRunner.java

@@ -0,0 +1,497 @@
+package com.gyee.frame.common.spring;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.TypeReference;
+import com.gyee.frame.common.cache.IGlobalCache;
+import com.gyee.frame.model.auto.*;
+import com.gyee.frame.service.*;
+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;
+
+/**
+ * 服务启动前执行,进行全局变量初始化
+ */
+@Component
+public class InitialRunner implements CommandLineRunner {
+
+
+    @Resource
+    private SysQuartzJobService sysQuartzJobService;
+    @Resource
+    private WindpowerstationService windpowerstationService;
+    @Resource
+    private ProjectService projectService;
+    @Resource
+    private LineService lineService;
+    @Resource
+    private WindturbineService windturbineService;
+    @Resource
+    private WindPowerstationTestingPoint2Service windPowerstationTestingPoint2Service;
+    @Resource
+    private WindTurbineTestingPointAiService windTurbineTestingPointAiService;
+    @Resource
+    private WindturbinepowercurvefittingService windturbinepowercurvefittingService;
+    @Resource
+    private WarningService warningService;
+    @Resource
+    private ModelpowerRdService modelpowerRdService;
+    @Resource
+    private EquipmentmodelService equipmentmodelService;
+    @Resource
+    private WarningClassifyService warningClassifyService;
+    @Resource
+    private ManufacturerService manufacturerService;
+    @Resource
+    private ModelPowerService modelPowerService;
+    @Resource
+    private IGlobalCache globalCache;
+    @Resource
+    private StoptypeService stoptypeService;
+//    @Resource
+//    private TaosMapService taosMapService;
+    @Resource
+    private WindTurbineTestingPointaiyjService windTurbineTestingPointaiyjService;
+    @Resource
+    private Alertrule2ervice alertrule2ervice;
+    @Resource
+    private WindturbinepartsService windturbinepartsService;
+
+    public static List<Windpowerstation> wpallls = new ArrayList<Windpowerstation>(); // 风电场LIST集合(包含光电电)
+    public static List<Project> pjallls = new ArrayList<Project>(); //项目LIST集合(包含光电电)
+    public static List<Line> lineallls = new ArrayList<Line>(); // 线路LIST集合(包含光电电)
+    public static List<Windturbine> wtallls = new ArrayList<Windturbine>(); // 风电机LIST集合(包含光电电)
+
+    public static List<Windpowerstation> wpls = new ArrayList<Windpowerstation>(); // 风电场LIST集合
+    public static List<Windpowerstation> spls = new ArrayList<Windpowerstation>(); // 光伏场LIST集合
+    
+    public static List<Project> pjls = new ArrayList<Project>(); // 项目LIST集合
+    public static List<Line> linels = new ArrayList<Line>(); // 线路LIST集合
+    public static List<Windturbine> wtls = new ArrayList<Windturbine>(); // 风电机LIST集合
+
+    public static List< Alertrule2> alertrulels = new ArrayList< Alertrule2>(); // 自定义报警规则LIST集合
+
+
+    public static Map<String,  Alertrule2> alertrulemap = new HashMap<String,  Alertrule2>();//自定义报警规则MAP
+
+    public static Map<String, Windpowerstation> wpmap = new HashMap<String, Windpowerstation>();//风场(包含光电电)
+    public static Map<String, Project> pjmap = new HashMap<String, Project>(); // 项目MAP(包含光电电)
+    public static Map<String, Line> lnmap = new HashMap<String, Line>(); // 线路(包含光电电)
+    public static Map<String, Windturbine> wtmap = new HashMap<String, Windturbine>();//风机(包含光电电)
+
+    public static Map<String, Stoptype> stoptypemap = new HashMap<String, Stoptype>();//停机类型
+    public static List<Warning2> warnls = new ArrayList<Warning2>(); // 报警LIST集合
+    public static Map<String, Warning2> warningmap = new HashMap<String, Warning2>();// 报警MAP集合
+    public static List<Windturbineparts> windturbinepartsls = new ArrayList<Windturbineparts>();
+    public static Map<String, Windturbineparts> windturbinepartsmap = new HashMap<String, Windturbineparts>();
+    public static Map<String, Map<String, List<Warning2>>> warnmodelmap = new HashMap<>();
+    public static Map<String, List<Warning2>> warnmap = new HashMap<>();// 按照型号划分报警MAP集合 <型号,报警集合>
+    public static List<WarningClassify> warningClassls = new ArrayList<WarningClassify>(); //报警类型列表
+    public static Map<String, WarningClassify> warningClassifymap = new HashMap<String, WarningClassify>();
+    public static Map<String, Manufacturer> manufacturermap = new HashMap<String, Manufacturer>();
+
+    public static Map<String, List<Windturbine>> wp_wtmap = new HashMap<String, List<Windturbine>>();
+    public static Map<String, List<Windturbine>> pj_wtmap = new HashMap<String, List<Windturbine>>();
+    public static Map<String, List<Windturbine>> ln_wtmap = new HashMap<String, List<Windturbine>>();
+    public static Map<String, List<Project>> pjsmap = new HashMap<String, List<Project>>(); // 通过风场编号获得所属项目
+    public static Map<String, List<Line>> lnsmap = new HashMap<String, List<Line>>(); // 通过项目编号获得所属线路
+    public static Map<String, Map<Double, ModelpowerRd>> mprdMap = new HashMap<String, Map<Double, ModelpowerRd>>();
+    public static Map<String, Map<String, Windturbinetestingpointnew>> wtPointmap = new HashMap<String, Map<String, Windturbinetestingpointnew>>();// 风电机测点AI表
+   // public static Map<String, Map<String, Windturbinetestingpointnew>> wtPointmap = new HashMap<String, Map<String, Windturbinetestingpointnew>>();// 风电机测点AI表
+    public static Map<String, Map<String, Windpowerstationpointnew>> wpPointmap = new HashMap<String, Map<String, Windpowerstationpointnew>>();//场站测点
+    public static Map<String, Map<String, Windpowerstationpointnew>> pjPointmap = new HashMap<String, Map<String, Windpowerstationpointnew>>();//项目测点
+    public static Map<String, Map<String, Windpowerstationpointnew>> lnPointmap = new HashMap<String, Map<String, Windpowerstationpointnew>>();//线路测点
+    public static Map<String, SysQuartzJob> jobsmap = new HashMap<String, SysQuartzJob>();
+    public static Map<String, Map<Double, Windturbinepowercurvefitting>> wpcmap = new HashMap<String, Map<Double, Windturbinepowercurvefitting>>();
+    public static Map<String, Equipmentmodel> mlmap = new HashMap<String, Equipmentmodel>();// 风电机模型
+    public static Map<String, Map<String, ModelPower>> modelPowermap = new HashMap<String, Map<String, ModelPower>>();// 风电机类型对应功率表
+    public static Map<String, String> taosmap = new HashMap<String, String>(); // Taos映射
+    public static Map<String, Map<String, WindTurbineTestingPointaiyj>> wtpAiyjmap = new HashMap<String, Map<String, WindTurbineTestingPointaiyj>>();// 风电机测点AI表--针对风机预警
+    public static Map<String, Map<String, Object>> appendYcglMap = new HashMap<String, Map<String, Object>>();// 预测功率追加
+
+
+    public static Map<String,Integer> wppointnummap=new HashMap<>();
+    Map<String, Object> ycmap = new HashMap<>();
+
+
+
+    @Override
+    public void run(String... args) throws Exception {
+        System.out.println(">>>>>>>>>>>>>>>服务启动执行,换成测点关联数据 <<<<<<<<<<<<<");
+
+        //配置追加功率曲线测点
+        Map<String, Object> ycmap = new HashMap<>();
+
+        String[] ycPoints4 = Constant.TPOINT_QS3_YGCL4.split(",");
+        String[] ycPoints24 = Constant.TPOINT_QS3_YGCL24.split(",");
+        //添加预测风速第一个点,存储到当前的历史值
+        ycmap.put("cdq1", "SLFGL.NX_GD_QSF_YC_P1_L1_001_CDQ001");
+        ycmap.put("dq1","SLFGL.NX_GD_QSF_YC_P1_L1_001_DQ0001");
+        //添加预测功率后续预测点字符串数组,实时数据
+        ycmap.put("cdq2", ycPoints4);
+        ycmap.put("dq2", ycPoints24);
+
+        appendYcglMap.put("QS_FDC", ycmap);
+
+        List< Alertrule2> alertrulels =alertrule2ervice.getAlertruleAllList();
+        if(!alertrulels.isEmpty())
+        {
+            for(Alertrule2 ar:alertrulels)
+            {
+                alertrulemap.put(ar.getName(),ar);
+            }
+        }
+
+        windturbinepartsls=windturbinepartsService.findAll();
+        if(!windturbinepartsls.isEmpty())
+        {
+            for(Windturbineparts wp:windturbinepartsls)
+            {
+                windturbinepartsmap.put(wp.getId(),wp);
+            }
+
+        }
+
+
+
+
+        List<SysQuartzJob> quartzJobs=sysQuartzJobService.selectByExample(new SysQuartzJobExample());
+
+        if(!quartzJobs.isEmpty())
+        {
+            for(SysQuartzJob sysQuartzJob:quartzJobs){
+
+                jobsmap.put(sysQuartzJob.getId(),sysQuartzJob);
+            }
+
+        }
+
+
+        List<WindTurbineTestingPointaiyj> list = windTurbineTestingPointaiyjService.findAll();
+
+        Map<String, WindTurbineTestingPointaiyj> yjmap = null;
+
+        if (list != null && !list.isEmpty()) {
+            for (WindTurbineTestingPointaiyj mp : list) {
+                if (wtpAiyjmap.containsKey(mp.getWindturbineid())) {
+                    yjmap = wtpAiyjmap.get(mp.getWindturbineid());
+                    yjmap.put(mp.getUniformcode(), mp);
+                } else {
+                    yjmap = new HashMap<String, WindTurbineTestingPointaiyj>();
+                    yjmap.put(mp.getUniformcode(), mp);
+                    wtpAiyjmap.put(mp.getWindturbineid(), yjmap);
+                }
+            }
+        }
+
+        String wpString = JSON.toJSONString(globalCache.get("PRODUCT-WP"));
+        wpPointmap = JSONObject.parseObject(wpString, new TypeReference<Map<String, Map<String, Windpowerstationpointnew>>>() {
+        });
+        String pjString = JSON.toJSONString(globalCache.get("PRODUCT-PJ"));
+        pjPointmap = JSONObject.parseObject(pjString, new TypeReference<Map<String, Map<String, Windpowerstationpointnew>>>() {
+        });
+        String lnString = JSON.toJSONString(globalCache.get("PRODUCT-LN"));
+        lnPointmap = JSONObject.parseObject(lnString, new TypeReference<Map<String, Map<String, Windpowerstationpointnew>>>() {
+        });
+
+        String wtString = JSON.toJSONString(globalCache.get("PRODUCT-WT"));
+        wtPointmap = JSONObject.parseObject(wtString, new TypeReference<Map<String, Map<String, Windturbinetestingpointnew>>>() {
+        });
+        String wpcmapString = (String)(globalCache.get("wpcmap"));
+        wpcmap = JSONObject.parseObject(wpcmapString, new TypeReference<Map<String, Map<Double, Windturbinepowercurvefitting>>>() {
+        });
+
+        WindpowerstationExample windpowerstationExample = new WindpowerstationExample();
+        windpowerstationExample.setOrderByClause("ordernum ASC");
+//        windpowerstationExample.createCriteria().andIdNotLike("%SY_FDC%");
+        wpallls = windpowerstationService.selectByExample(windpowerstationExample);
+        if (!wpallls.isEmpty()) {
+            for (Windpowerstation wp : wpallls) {
+                if (wp.getId().endsWith("FDC")) {
+                    wpls.add(wp);
+                }
+                if (wp.getId().endsWith("GDC")) {
+                	spls.add(wp);
+                }
+                wpmap.put(wp.getId(), wp);
+            }
+        }
+
+
+        ProjectExample projectExample = new ProjectExample();
+        projectExample.setOrderByClause("ordernum ASC");
+//        projectExample.createCriteria().andWindpowerstationidNotLike("%SY_FDC%");
+        pjallls = projectService.selectByExample(projectExample);
+
+        if (!pjallls.isEmpty()) {
+            for (Project pj : pjallls) {
+                pjmap.put(pj.getId(), pj);
+                if (pj.getWindpowerstationid().endsWith("FDC")) {
+                    pjls.add(pj);
+                }
+                if (pjsmap.containsKey(pj.getWindpowerstationid())) {
+                    List<Project> pjls = pjsmap.get(pj.getWindpowerstationid());
+                    pjls.add(pj);
+                    pjsmap.put(pj.getWindpowerstationid(), pjls);
+                } else {
+                    List<Project> pjls = new ArrayList<Project>();
+                    pjls.add(pj);
+                    pjsmap.put(pj.getWindpowerstationid(), pjls);
+                }
+            }
+        }
+
+        LineExample lineExample = new LineExample();
+        lineExample.setOrderByClause("ordernum ASC");
+        lineExample.createCriteria().getAllCriteria();
+        lineallls = lineService.selectByExample(lineExample);
+
+        if (!lineallls.isEmpty()) {
+            for (Line ln : lineallls) {
+                lnmap.put(ln.getId(), ln);
+                if (pjmap.containsKey(ln.getProjectid())) {
+                    Project pj = pjmap.get(ln.getProjectid());
+                    if (pj.getWindpowerstationid().endsWith("FDC")) {
+                        linels.add(ln);
+                    }
+                }
+                if (lnsmap.containsKey(ln.getProjectid())) {
+                    List<Line> lnls = lnsmap.get(ln.getProjectid());
+                    lnls.add(ln);
+                    lnsmap.put(ln.getProjectid(), lnls);
+                } else {
+                    List<Line> lnls = new ArrayList<Line>();
+                    lnls.add(ln);
+                    lnsmap.put(ln.getProjectid(), lnls);
+                }
+            }
+        }
+
+        WindturbineExample windturbineExample = new WindturbineExample();
+        windturbineExample.setOrderByClause("ID ASC");
+
+        wtallls = windturbineService.selectByExample(windturbineExample);
+
+        if (!wtallls.isEmpty()) {
+            for (Windturbine wt : wtallls) {
+                if (wpmap.containsKey(wt.getWindpowerstationid())) {
+                    if (wt.getWindpowerstationid().endsWith("FDC")) {
+                        wtls.add(wt);
+                    }
+                }
+
+                wtmap.put(wt.getId(), wt);
+            }
+        }
+
+        mprdMap = modelpowerRdService.getModelpowerRdAllMap();
+
+        StoptypeExample stoptypeExample = new StoptypeExample();
+        stoptypeExample.setOrderByClause("name ASC");
+
+        List<Stoptype> stoptypels = stoptypeService.selectByExample(stoptypeExample);
+        if (stoptypels != null && !stoptypels.isEmpty()) {
+            for (int i = 0; i < stoptypels.size(); i++) {
+                stoptypemap.put(stoptypels.get(i).getId(),stoptypels.get(i));
+            }
+        }
+
+//        WindturbinepowercurvefittingExample windturbinepowercurvefittingExample=new WindturbinepowercurvefittingExample();
+//        windturbinepowercurvefittingExample.setOrderByClause("WINDTURBINEID ASC,speed ASC");
+//        List<Windturbinepowercurvefitting> wpclist= windturbinepowercurvefittingService.selectByExample(windturbinepowercurvefittingExample);
+//
+//        if (!wpclist.isEmpty()) {
+//            for (Windturbinepowercurvefitting wc : wpclist) {
+//                if (wpcmap.containsKey(wc.getWindturbineid())) {
+//                    Map<Double, Windturbinepowercurvefitting> map = wpcmap.get(wc.getWindturbineid());
+//                    map.put(wc.getSpeed(), wc);
+//                } else {
+//                    Map<Double, Windturbinepowercurvefitting> map = new HashMap<Double, Windturbinepowercurvefitting>();
+//                    map.put(wc.getSpeed(), wc);
+//                    wpcmap.put(wc.getWindturbineid(), map);
+//                }
+//            }
+//        }
+
+        Warning2Example warningExample = new Warning2Example();
+        warningExample.setOrderByClause("id ASC");
+
+        Warning2Example.Criteria criteria = warningExample.createCriteria();
+        criteria.andEdnavalueNotEqualTo(0);
+        criteria.andWarningclassifyidIsNotNull();
+        warnls = warningService.selectByExample(warningExample);
+
+        if (warnls != null && !warnls.isEmpty()) {
+            for (int i = 0; i < warnls.size(); i++) {
+                Warning2 warning = warnls.get(i);
+
+                if (warnmodelmap.containsKey(warning.getModelid())) {
+                    Map<String, List<Warning2>> map = warnmodelmap.get(warning.getModelid());
+                    if(map.containsKey(warning.getWarningclassifyid()))
+                    {
+                        List<Warning2> ls =map.get(warning.getWarningclassifyid());
+                        ls.add(warning);
+                        map.put(warning.getWarningclassifyid(), ls);
+                    }else
+                    {
+                        List<Warning2> ls = new ArrayList<>();
+                        ls.add(warning);
+                        map.put(warning.getWarningclassifyid(), ls);
+                    }
+                    warnmodelmap.put(warning.getModelid(),map);
+                } else {
+                    Map<String, List<Warning2>> map = new HashMap<>();
+                    List<Warning2> ls = new ArrayList<>();
+                    ls.add(warning);
+                    map.put(warning.getWarningclassifyid(), ls);
+                    warnmodelmap.put(warning.getModelid(),map);
+                }
+
+                if (warnmap.containsKey(warning.getModelid())) {
+                    List<Warning2> ls =warnmap.get(warning.getModelid());
+                    ls.add(warning);
+                    warnmap.put(warning.getModelid(),ls);
+                } else {
+                    List<Warning2> ls =new ArrayList<>();
+                    ls.add(warning);
+                    warnmap.put(warning.getModelid(),ls);
+                }
+
+                warningmap.put(warning.getId(), warning);
+            }
+        }
+        if (wtallls != null && !wtallls.isEmpty()) {
+
+            for (int i = 0; i < wtallls.size(); i++) {
+
+                Windturbine point = wtallls.get(i);
+                if (wp_wtmap.containsKey(point.getWindpowerstationid())) {
+                    List<Windturbine> ls = wp_wtmap.get(point.getWindpowerstationid());
+                    ls.add(point);
+                    wp_wtmap.put(point.getWindpowerstationid(), ls);
+                } else {
+                    List<Windturbine> ls = new ArrayList();
+                    ls.add(point);
+                    wp_wtmap.put(point.getWindpowerstationid(), ls);
+                }
+
+                if (pj_wtmap.containsKey(point.getProjectid())) {
+                    List<Windturbine> ls = pj_wtmap.get(point.getProjectid());
+                    ls.add(point);
+                    pj_wtmap.put(point.getProjectid(), ls);
+                } else {
+                    List<Windturbine> ls = new ArrayList();
+                    ls.add(point);
+                    pj_wtmap.put(point.getProjectid(), ls);
+                }
+
+
+                if (ln_wtmap.containsKey(point.getLineid())) {
+                    List<Windturbine> ls = ln_wtmap.get(point.getLineid());
+                    ls.add(point);
+                    ln_wtmap.put(point.getLineid(), ls);
+                } else {
+                    List<Windturbine> ls = new ArrayList();
+                    ls.add(point);
+                    ln_wtmap.put(point.getLineid(), ls);
+                }
+
+            }
+
+
+        }
+//
+
+//        WindPowerStationTestingPoint2Example windPowerstationTestingPointExample=new WindPowerStationTestingPoint2Example();
+//        windPowerstationTestingPointExample.createCriteria().getAllCriteria();
+//        List<WindPowerStationTestingPoint2> wpPointlist= windPowerstationTestingPoint2Service.selectByExample(windPowerstationTestingPointExample);
+//
+//        Map<String,WindPowerStationTestingPoint2> items=null;
+//        if(wpPointlist!=null && !wpPointlist.isEmpty()){
+//            for(int i=0;i<wpPointlist.size();i++){
+//                WindPowerStationTestingPoint2 point=wpPointlist.get(i);
+//                if(stationPointmap.containsKey(point.getWindpowerstationid())){
+//                    items=stationPointmap.get(point.getWindpowerstationid());
+//                    items.put(point.getUniformcode(), point);
+//                }
+//                else{
+//                    items=new HashMap<String,WindPowerStationTestingPoint2>();
+//                    stationPointmap.put(point.getWindpowerstationid(), items);
+//                    items.put(point.getUniformcode(), point);
+//                }
+//
+//            }
+//        }
+//
+//        WindTurbineTestingPointAi2Example windTurbineTestingPointAiExample=new WindTurbineTestingPointAi2Example();
+//        windTurbineTestingPointAiExample.createCriteria().getAllCriteria();
+//        List<WindTurbineTestingPointAi2> wtAilist= windTurbineTestingPointAiService.selectByExample(windTurbineTestingPointAiExample);
+//
+//        Map<String, WindTurbineTestingPointAi2> map = null;
+//
+//        if(wtAilist != null && !wtAilist.isEmpty()){
+//            for(WindTurbineTestingPointAi2 mp : wtAilist){
+//                if(wtpAimap.containsKey(mp.getWindturbineid())){
+//                    map = wtpAimap.get(mp.getWindturbineid());
+//                    map.put(mp.getUniformcode(), mp);
+//                }else{
+//                    map = new HashMap<String, WindTurbineTestingPointAi2>();
+//                    map.put(mp.getUniformcode(), mp);
+//                    wtpAimap.put(mp.getWindturbineid(), map);
+//                }
+//            }
+//        }
+
+        EquipmentmodelExample example = new EquipmentmodelExample();
+        List<Equipmentmodel> mlls = equipmentmodelService.selectByExample(example);
+        if (!mlls.isEmpty()) {
+            for (Equipmentmodel model : mlls) {
+                mlmap.put(model.getId(), model);
+            }
+        }
+
+        WarningClassifyExample wcexample = new WarningClassifyExample();
+        warningClassls = warningClassifyService.selectByExample(wcexample);
+        if (!warningClassls.isEmpty()) {
+            for (WarningClassify model : warningClassls) {
+                warningClassifymap.put(model.getId(), model);
+            }
+        }
+
+        ManufacturerExample mfexample = new ManufacturerExample();
+        List<Manufacturer> mfls = manufacturerService.selectByExample(mfexample);
+        if (!mfls.isEmpty()) {
+            for (Manufacturer model : mfls) {
+                manufacturermap.put(model.getId(), model);
+            }
+        }
+
+        ModelPowerExample mpexample = new ModelPowerExample();
+        List<ModelPower> mpls = modelPowerService.selectByExample(mpexample);
+        if (!mpls.isEmpty()) {
+
+            Map<String, ModelPower> mpmap = null;
+
+            if (mpls != null && !mpls.isEmpty()) {
+                for (ModelPower mp : mpls) {
+                    if (modelPowermap.containsKey(mp.getModelid())) {
+                        mpmap = modelPowermap.get(mp.getModelid());
+                        mpmap.put(String.valueOf(mp.getSpeed().doubleValue()), mp);
+                    } else {
+                        mpmap = new HashMap<String, ModelPower>();
+                        mpmap.put(String.valueOf(mp.getSpeed().doubleValue()), mp);
+                        modelPowermap.put(mp.getModelid(), mpmap);
+                    }
+                }
+            }
+        }
+        wppointnummap= windPowerstationTestingPoint2Service.getWpPointTotal();
+    }
+
+}

+ 116 - 0
web/health-hb/src/main/java/com/gyee/frame/common/spring/SpringUtils.java

@@ -0,0 +1,116 @@
+package com.gyee.frame.common.spring;
+
+import org.springframework.aop.framework.AopContext;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.NoSuchBeanDefinitionException;
+import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.stereotype.Component;
+
+/**
+* spring工具类 方便在非spring管理环境中获取bean
+* @ClassName: SpringUtils
+* @author gyee
+* @date 2019-09-11 11:28
+*
+ */
+@Component
+public final class SpringUtils implements BeanFactoryPostProcessor
+{
+    /** Spring应用上下文环境 */
+    private static ConfigurableListableBeanFactory beanFactory;
+
+    @Override
+    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException
+    {
+        SpringUtils.beanFactory = beanFactory;
+    }
+
+    /**
+     * 获取对象
+     *
+     * @param name
+     * @return Object 一个以所给名字注册的bean的实例
+     * @throws org.springframework.beans.BeansException
+     *
+     */
+    @SuppressWarnings("unchecked")
+    public static <T> T getBean(String name) throws BeansException
+    {
+        return (T) beanFactory.getBean(name);
+    }
+
+    /**
+     * 获取类型为requiredType的对象
+     *
+     * @param clz
+     * @return
+     * @throws org.springframework.beans.BeansException
+     *
+     */
+    public static <T> T getBean(Class<T> clz) throws BeansException
+    {
+        T result = (T) beanFactory.getBean(clz);
+        return result;
+    }
+
+    /**
+     * 如果BeanFactory包含一个与所给名称匹配的bean定义,则返回true
+     *
+     * @param name
+     * @return boolean
+     */
+    public static boolean containsBean(String name)
+    {
+        return beanFactory.containsBean(name);
+    }
+
+    /**
+     * 判断以给定名字注册的bean定义是一个singleton还是一个prototype。 如果与给定名字相应的bean定义没有被找到,将会抛出一个异常(NoSuchBeanDefinitionException)
+     *
+     * @param name
+     * @return boolean
+     * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
+     *
+     */
+    public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException
+    {
+        return beanFactory.isSingleton(name);
+    }
+
+    /**
+     * @param name
+     * @return Class 注册对象的类型
+     * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
+     *
+     */
+    public static Class<?> getType(String name) throws NoSuchBeanDefinitionException
+    {
+        return beanFactory.getType(name);
+    }
+
+    /**
+     * 如果给定的bean名字在bean定义中有别名,则返回这些别名
+     *
+     * @param name
+     * @return
+     * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
+     *
+     */
+    public static String[] getAliases(String name) throws NoSuchBeanDefinitionException
+    {
+        return beanFactory.getAliases(name);
+    }
+
+    /**
+     * 获取aop代理对象
+     * 
+     * @param invoker
+     * @return
+     */
+    @SuppressWarnings("unchecked")
+    public static <T> T getAopProxy(T invoker)
+    {
+        return (T) AopContext.currentProxy();
+    }
+}

+ 20 - 0
web/health-hb/src/main/java/com/gyee/frame/common/spring/WpEnum.java

@@ -0,0 +1,20 @@
+package com.gyee.frame.common.spring;
+
+public  enum  WpEnum {
+
+    MHS_FDC("MHS_FDC"),
+    NSS_FDC("NSS_FDC"),
+    QS_FDC("QS_FDC"),
+    SBQ_FDC("SBQ_FDC"),
+    XS_FDC("XS_FDC"),
+    DWK_GDC("DWK_GDC"),
+    PL_GDC("PL_GDC"),
+    XH_GDC("XH_GDC"),
+    MCH_GDC("MCH_GDC"),
+    HZJ_GDC("HZJ_GDC");
+
+    public String id;
+    WpEnum(final  String c) {
+        id = c;
+    }
+}

+ 89 - 0
web/health-hb/src/main/java/com/gyee/frame/common/support/CharsetKit.java

@@ -0,0 +1,89 @@
+package com.gyee.frame.common.support;
+
+import com.gyee.frame.util.StringUtils;
+
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+
+/**
+ * 字符集工具类
+ * 
+ * @author fc
+ *
+ */
+public class CharsetKit
+{
+    /** ISO-8859-1 */
+    public static final String ISO_8859_1 = "ISO-8859-1";
+    /** UTF-8 */
+    public static final String UTF_8 = "UTF-8";
+    /** GBK */
+    public static final String GBK = "GBK";
+
+    /** ISO-8859-1 */
+    public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1);
+    /** UTF-8 */
+    public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8);
+    /** GBK */
+    public static final Charset CHARSET_GBK = Charset.forName(GBK);
+
+    /**
+     * 转换为Charset对象
+     * 
+     * @param charset 字符集,为空则返回默认字符集
+     * @return Charset
+     */
+    public static Charset charset(String charset)
+    {
+        return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset);
+    }
+
+    /**
+     * 转换字符串的字符集编码
+     * 
+     * @param source 字符串
+     * @param srcCharset 源字符集,默认ISO-8859-1
+     * @param destCharset 目标字符集,默认UTF-8
+     * @return 转换后的字符集
+     */
+    public static String convert(String source, String srcCharset, String destCharset)
+    {
+        return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset));
+    }
+
+    /**
+     * 转换字符串的字符集编码
+     * 
+     * @param source 字符串
+     * @param srcCharset 源字符集,默认ISO-8859-1
+     * @param destCharset 目标字符集,默认UTF-8
+     * @return 转换后的字符集
+     */
+    public static String convert(String source, Charset srcCharset, Charset destCharset)
+    {
+        if (null == srcCharset)
+        {
+            srcCharset = StandardCharsets.ISO_8859_1;
+        }
+
+        if (null == destCharset)
+        {
+            srcCharset = StandardCharsets.UTF_8;
+        }
+
+        if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset))
+        {
+            return source;
+        }
+        return new String(source.getBytes(srcCharset), destCharset);
+    }
+
+    /**
+     * @return 系统字符集编码
+     */
+    public static String systemCharset()
+    {
+        return Charset.defaultCharset().name();
+    }
+
+}

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1057 - 0
web/health-hb/src/main/java/com/gyee/frame/common/support/Convert.java


+ 240 - 0
web/health-hb/src/main/java/com/gyee/frame/common/support/ConvertUtil.java

@@ -0,0 +1,240 @@
+package com.gyee.frame.common.support;
+
+import java.math.BigDecimal;
+import java.util.Arrays;
+import java.util.List;
+import com.gyee.frame.util.StringUtils;
+
+import cn.hutool.core.util.StrUtil;
+
+/**
+ * 类型转换器
+ * 
+ * @author fc
+ * 
+ */
+public class ConvertUtil {
+
+	/**
+	 * 转换为字符串<br>
+	 * 如果给定的值为null,或者转换失败,返回默认值<br>
+	 * 转换失败不会报错
+	 * 
+	 * @param value 被转换的值
+	 * @param defaultValue 转换错误时的默认值
+	 * @return 结果
+	 */
+	public static String toStr(Object value, String defaultValue) {
+		if (null == value) {
+			return defaultValue;
+		}
+		if (value instanceof String) {
+			return (String) value;
+		}
+		return value.toString();
+	}
+
+	/**
+	 * 转换为Integer数组<br>
+	 * @param split 被转换的值
+	 * @return 结果
+	 */
+	public static Integer[] toIntArray(String str) {
+		return toIntArray(",", str);
+	}
+
+	/**
+	 * 转换为Integer数组<br>
+	 * @param split 分隔符
+	 * @param split 被转换的值
+	 * @return 结果
+	 */
+	public static Integer[] toIntArray(String split, String str) {
+		if (StrUtil.isEmpty(str)) {
+			return new Integer[] {};
+		}
+		String[] strings = str.split(split);
+		final Integer[] ints = new Integer[strings.length];
+		for (int i = 0; i < strings.length; i++) {
+			final Integer v = toInt(strings[i], 0);
+			ints[i] = v;
+		}
+		return ints;
+	}
+
+	/**
+	 * 转换为int<br>
+	 * 如果给定的值为空,或者转换失败,返回默认值<br>
+	 * 转换失败不会报错
+	 * @param value 被转换的值
+	 * @param defaultValue 转换错误时的默认值
+	 * @return 结果
+	 */
+	public static Integer toInt(Object value, Integer defaultValue) {
+		if (value == null) {
+			return defaultValue;
+		}
+		if (value instanceof Integer) {
+			return (Integer) value;
+		}
+		if (value instanceof Number) {
+			return ((Number) value).intValue();
+		}
+		final String valueStr = toStr(value, null);
+		if (StringUtils.isEmpty(valueStr)) {
+			return defaultValue;
+		}
+		try {
+			return Integer.parseInt(valueStr.trim());
+		} catch (Exception e) {
+			return defaultValue;
+		}
+	}
+
+	/**
+	 * 转换为List<String>数组<br>
+	 * @param split 被转换的值
+	 * @return 结果
+	 */
+	public static List<String> toListStrArray(String str) {
+		String[] stringArray = toStrArray(str);
+		List<String> stringB = Arrays.asList(stringArray);
+		return stringB;
+	}
+
+	/**
+	 * 转换为String数组<br> 
+	 * @param split 被转换的值
+	 * @return 结果
+	 */
+	public static String[] toStrArray(String str) {
+		return toStrArray(",", str);
+	}
+
+	/**
+	 * 转换为String数组<br>
+	 * 
+	 * @param split 分隔符
+	 * @param split 被转换的值
+	 * @return 结果
+	 */
+	public static String[] toStrArray(String split, String str) {
+		return str.split(split);
+	}
+	/**
+     * 转换为Long数组<br>
+     * 
+     * @param split 被转换的值
+     * @return 结果
+     */
+    public static Long[] toLongArray(String str)
+    {
+        return toLongArray(",", str);
+    }
+    /**
+     * 转换为Long数组<br>
+     * 
+     * @param isIgnoreConvertError 是否忽略转换错误,忽略则给值null
+     * @param values 被转换的值
+     * @return 结果
+     */
+    public static Long[] toLongArray(String split, String str)
+    {
+        if (StringUtils.isEmpty(str))
+        {
+            return new Long[] {};
+        }
+        String[] arr = str.split(split);
+        final Long[] longs = new Long[arr.length];
+        for (int i = 0; i < arr.length; i++)
+        {
+            final Long v = toLong(arr[i], null);
+            longs[i] = v;
+        }
+        return longs;
+    }
+    /**
+     * 转换为long<br>
+     * 如果给定的值为空,或者转换失败,返回默认值<br>
+     * 转换失败不会报错
+     * 
+     * @param value 被转换的值
+     * @param defaultValue 转换错误时的默认值
+     * @return 结果
+     */
+    public static Long toLong(Object value, Long defaultValue)
+    {
+        if (value == null)
+        {
+            return defaultValue;
+        }
+        if (value instanceof Long)
+        {
+            return (Long) value;
+        }
+        if (value instanceof Number)
+        {
+            return ((Number) value).longValue();
+        }
+        final String valueStr = toStr(value, null);
+        if (StringUtils.isEmpty(valueStr))
+        {
+            return defaultValue;
+        }
+        try
+        {
+            // 支持科学计数法
+            return new BigDecimal(valueStr.trim()).longValue();
+        }
+        catch (Exception e)
+        {
+            return defaultValue;
+        }
+    }
+    
+    /**
+     * 转换为BigDecimal<br>
+     * 如果给定的值为空,或者转换失败,返回默认值<br>
+     * 转换失败不会报错
+     * 
+     * @param value 被转换的值
+     * @param defaultValue 转换错误时的默认值
+     * @return 结果
+     */
+    public static BigDecimal toBigDecimal(Object value, BigDecimal defaultValue)
+    {
+        if (value == null)
+        {
+            return defaultValue;
+        }
+        if (value instanceof BigDecimal)
+        {
+            return (BigDecimal) value;
+        }
+        if (value instanceof Long)
+        {
+            return new BigDecimal((Long) value);
+        }
+        if (value instanceof Double)
+        {
+            return new BigDecimal((Double) value);
+        }
+        if (value instanceof Integer)
+        {
+            return new BigDecimal((Integer) value);
+        }
+        final String valueStr = toStr(value, null);
+        if (StringUtils.isEmpty(valueStr))
+        {
+            return defaultValue;
+        }
+        try
+        {
+            return new BigDecimal(valueStr);
+        }
+        catch (Exception e)
+        {
+            return defaultValue;
+        }
+    }
+}

+ 77 - 0
web/health-hb/src/main/java/com/gyee/frame/common/support/KaptchaTextCreator.java

@@ -0,0 +1,77 @@
+package com.gyee.frame.common.support;
+
+import java.security.SecureRandom;
+import java.util.Random;
+import com.google.code.kaptcha.text.impl.DefaultTextCreator;
+
+/**
+ * 验证码实现类
+ * @author cs
+ */
+public class KaptchaTextCreator extends DefaultTextCreator
+{
+
+    private static final String[] CNUMBERS = {"0","1","2","3","4","5","6","7","8","9","10"};
+
+    @Override
+    public String getText()
+    {
+        Integer result = 0;
+        Random random = new SecureRandom();
+        int x = random.nextInt(10);
+        int y = random.nextInt(10);
+        StringBuilder suChinese = new StringBuilder();
+        int randomoperands = (int) Math.round(Math.random() * 2);
+        if (randomoperands == 0)
+        {
+            result = x * y;
+            suChinese.append(CNUMBERS[x]);
+            suChinese.append("*");
+            suChinese.append(CNUMBERS[y]);
+        }
+        else if (randomoperands == 1)
+        {
+            if (!(x == 0) && y % x == 0)
+            {
+                result = y / x;
+                suChinese.append(CNUMBERS[y]);
+                suChinese.append("/");
+                suChinese.append(CNUMBERS[x]);
+            }
+            else
+            {
+                result = x + y;
+                suChinese.append(CNUMBERS[x]);
+                suChinese.append("+");
+                suChinese.append(CNUMBERS[y]);
+            }
+        }
+        else if (randomoperands == 2)
+        {
+            if (x >= y)
+            {
+                result = x - y;
+                suChinese.append(CNUMBERS[x]);
+                suChinese.append("-");
+                suChinese.append(CNUMBERS[y]);
+            }
+            else
+            {
+                result = y - x;
+                suChinese.append(CNUMBERS[y]);
+                suChinese.append("-");
+                suChinese.append(CNUMBERS[x]);
+            }
+        }
+        else
+        {
+            result = x + y;
+            suChinese.append(CNUMBERS[x]);
+            suChinese.append("+");
+            suChinese.append(CNUMBERS[y]);
+        }
+        suChinese.append("=?@" + result);
+        return suChinese.toString();
+    }
+
+}

+ 148 - 0
web/health-hb/src/main/java/com/gyee/frame/common/websocket/ClientInboundChannelInterceptor.java

@@ -0,0 +1,148 @@
+package com.gyee.frame.common.websocket;
+
+import com.gyee.frame.common.quartz.QuartzSchedulerUtil;
+import com.gyee.frame.util.StringUtils;
+import org.springframework.messaging.Message;
+import org.springframework.messaging.MessageChannel;
+import org.springframework.messaging.simp.SimpMessageHeaderAccessor;
+import org.springframework.messaging.simp.stomp.StompCommand;
+import org.springframework.messaging.simp.stomp.StompHeaderAccessor;
+import org.springframework.messaging.support.ChannelInterceptor;
+import org.springframework.messaging.support.MessageHeaderAccessor;
+import org.springframework.stereotype.Component;
+
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.concurrent.CopyOnWriteArraySet;
+
+/**
+ * websocket建立链接的时候获取headeri里认证的参数拦截器。
+ */
+@Component
+public class ClientInboundChannelInterceptor extends QuartzSchedulerUtil.SocketTaskUtil implements ChannelInterceptor {
+
+
+    private String AUTHTOKEN="authToken";
+    @Override
+    public Message<?> preSend(Message<?> message, MessageChannel channel) {
+        StompHeaderAccessor accessor = MessageHeaderAccessor.getAccessor(message, StompHeaderAccessor.class);
+        if (StompCommand.CONNECT.equals(accessor.getCommand())) {
+            Object raw = message.getHeaders().get(SimpMessageHeaderAccessor.NATIVE_HEADERS);
+
+            String topic=null;
+            String authToken=null;
+            if (raw instanceof Map) {
+                Object name = ((Map) raw).get("topic");
+                LinkedList<String> temp=(LinkedList<String>) name;
+                topic=temp.get(0);
+                Object authTokenobj = ((Map) raw).get("authToken");
+                 temp=(LinkedList<String>) authTokenobj;
+                authToken=temp.get(0);
+            }
+            //String authToken =String.valueOf(message.getHeaders().get(SimpMessageHeaderAccessor.SESSION_ID_HEADER));
+
+           // String authToken =String.valueOf(message.getHeaders().get(AUTHTOKEN));
+            if(StringUtils.notEmp(topic) && !topic.equals("undefined") && StringUtils.notEmp(authToken) && !authToken.equals("undefined")) {
+
+
+                //判断是否为带参操作
+                if(topic.indexOf(WebSocketConfig.PARAM)!=-1)
+                {
+                    if (StringUtils.notEmp(authToken)) {
+                        //判断带参sessionMAP中是否包含authToken
+                        if (WebSocketConfig.sessionparamcacheMap.containsKey(authToken)) {
+                            //通过sessionId获得topicSET集合
+                            CopyOnWriteArraySet<String> set = WebSocketConfig.sessionparamcacheMap.get(authToken);
+                            //截取topic/****/中的功能描述
+                            String temptoptic=topic.substring(topic.indexOf("/")+1);
+                            temptoptic=temptoptic.substring(0,temptoptic.indexOf("/"));
+                            //遍历SET中的主体
+                            for(String str:set)
+                            {
+                                //截取str/****/中的功能描述
+                                String tempstr=str.substring(str.indexOf("/")+1);
+                                tempstr=tempstr.substring(0,tempstr.indexOf("/"));
+                                //判断str的功能描述和topic的功能描述是否一致
+                                if(temptoptic.equals(tempstr))
+                                {
+                                    //功能描述一致,移除相同功能的主题,保证每个sessionid相同功能只能通过传参订阅一个主题
+                                    set.remove(str);
+                                    //提供过str主题获得sessionidSET集合
+                                    CopyOnWriteArraySet<String> sessionIdset = WebSocketConfig.websocketparamcacheMap.get(str);
+                                    //移除主题中的sessionId
+                                    sessionIdset.remove(authToken);
+                                    //如果sessionIdset记录为空,移除websocketparamcacheMap的主题
+                                    if(sessionIdset.size()==0)
+                                    {
+                                        WebSocketConfig.websocketparamcacheMap.remove(str);
+                                    }
+
+                                }
+                            }
+                            //添加新的主题
+                            set.add(topic);
+                            WebSocketConfig.sessionparamcacheMap.put(authToken, set);
+                        } else {
+                            CopyOnWriteArraySet<String> set = new CopyOnWriteArraySet<String>();
+                            set.add(topic);
+                            WebSocketConfig.sessionparamcacheMap.put(authToken, set);
+                        }
+
+
+                    }
+
+                    if (WebSocketConfig.websocketparamcacheMap.containsKey(topic)) {
+                        CopyOnWriteArraySet<String> set = WebSocketConfig.websocketparamcacheMap.get(topic);
+                        set.add(authToken);
+                        WebSocketConfig.websocketparamcacheMap.put(topic, set);
+                    } else {
+                        CopyOnWriteArraySet<String> set = new CopyOnWriteArraySet<String>();
+                        set.add(authToken);
+                        WebSocketConfig.websocketparamcacheMap.put(topic, set);
+                    }
+                }else
+                {
+                    if (WebSocketConfig.websocketcacheMap.containsKey(topic)) {
+                        CopyOnWriteArraySet<String> set = WebSocketConfig.websocketcacheMap.get(topic);
+                        set.add(authToken);
+                        WebSocketConfig.websocketcacheMap.put(topic, set);
+                    } else {
+                        CopyOnWriteArraySet<String> set = new CopyOnWriteArraySet<String>();
+                        set.add(authToken);
+                        WebSocketConfig.websocketcacheMap.put(topic, set);
+                    }
+
+
+                    if (StringUtils.notEmp(authToken)) {
+                        if (WebSocketConfig.sessioncacheMap.containsKey(authToken)) {
+                            CopyOnWriteArraySet<String> set = WebSocketConfig.sessioncacheMap.get(authToken);
+                            set.add(topic);
+                            WebSocketConfig.sessioncacheMap.put(authToken, set);
+                        } else {
+                            CopyOnWriteArraySet<String> set = new CopyOnWriteArraySet<String>();
+                            set.add(topic);
+                            WebSocketConfig.sessioncacheMap.put(authToken, set);
+                        }
+
+
+                    }
+                }
+
+
+                if(topic.indexOf(WebSocketConfig.PARAM)!=-1)
+                {
+
+//                    String wtid=topic.substring(topic.indexOf(PARAM)+6);
+                    topic=topic.substring(0,topic.indexOf("_"));
+                    this.restartJob(topic);
+                }else
+                {
+                    this.restartJob(topic);
+                }
+
+            }
+
+        }
+        return message;
+    }
+}

+ 65 - 0
web/health-hb/src/main/java/com/gyee/frame/common/websocket/WebSocketCache.java

@@ -0,0 +1,65 @@
+package com.gyee.frame.common.websocket;
+
+import com.gyee.frame.common.quartz.QuartzSchedulerUtil;
+import org.springframework.context.event.EventListener;
+import org.springframework.stereotype.Component;
+import org.springframework.web.socket.messaging.SessionDisconnectEvent;
+
+import javax.annotation.Resource;
+
+@Component
+public class WebSocketCache  extends QuartzSchedulerUtil.SocketTaskUtil {
+
+    @Resource
+    private WebSocketLoginOutEvent webSocketLoginOutEvent;
+//    public static ConcurrentHashMap<String, CopyOnWriteArraySet<String>> websocketcacheMap = new ConcurrentHashMap();
+//
+//    @EventListener(SessionConnectEvent.class)
+//    public void onSessionConnectEvent(SessionConnectEvent event) {
+//
+//        //获取Session连接信息
+//        StompHeaderAccessor sha = StompHeaderAccessor.wrap(event.getMessage());
+//
+//        sha
+//        List<String> topics=sha.getNativeHeader("topic");
+//        //获取SessionId
+//        String authToken = sha.getSessionId();
+//
+//       if(StringUtils.isNotEmpty(topics))
+//       {
+//
+//           String topic=topics.get(0);
+//
+//           if(websocketcacheMap.containsKey(topic))
+//           {
+//               CopyOnWriteArraySet<String> set=websocketcacheMap.get(topic);
+//               set.add(authToken);
+//               websocketcacheMap.put(topic,set);
+//           }else
+//           {
+//               CopyOnWriteArraySet<String> set= new CopyOnWriteArraySet<String>();
+//               set.add(authToken);
+//               websocketcacheMap.put(topic,set);
+//           }
+//           if(InitialRunner.jobsmap.containsKey(topic))
+//           {
+//               this.restartJob(topic);
+//           }
+//       }
+//
+//
+//    }
+//
+//
+    @EventListener(SessionDisconnectEvent.class)
+    public void onDisconnectEvent(SessionDisconnectEvent event) {
+//        //获取Session连接信息
+//        StompHeaderAccessor sha = StompHeaderAccessor.wrap(event.getMessage());
+//        String authToken=String.valueOf(sha.getHeader("authToken"));
+//
+//        webSocketLoginOutEvent.loginOut(authToken);
+
+
+    }
+
+}

+ 241 - 0
web/health-hb/src/main/java/com/gyee/frame/common/websocket/WebSocketConfig.java

@@ -0,0 +1,241 @@
+package com.gyee.frame.common.websocket;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.messaging.converter.MessageConverter;
+import org.springframework.messaging.simp.config.ChannelRegistration;
+import org.springframework.messaging.simp.config.MessageBrokerRegistry;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
+import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
+import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
+import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;
+import org.springframework.web.socket.config.annotation.WebSocketTransportRegistration;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArraySet;
+
+/**
+ * @descrition: 前台测试代码在 test/resources/websockettest.html
+ */
+
+@Configuration
+@EnableWebSocketMessageBroker
+public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
+
+    public static final String PARAM="param_";
+    public static ConcurrentHashMap<String, CopyOnWriteArraySet<String>> websocketcacheMap = new ConcurrentHashMap();
+    public static ConcurrentHashMap<String, CopyOnWriteArraySet<String>> sessioncacheMap = new ConcurrentHashMap();
+
+    public static ConcurrentHashMap<String, CopyOnWriteArraySet<String>> websocketparamcacheMap = new ConcurrentHashMap();
+    public static ConcurrentHashMap<String, CopyOnWriteArraySet<String>> sessionparamcacheMap = new ConcurrentHashMap();
+    //
+    @Resource
+    private ClientInboundChannelInterceptor clientInboundChannelInterceptor;
+
+    /**
+     * 注册stomp端点,主要是起到连接作用
+     *
+     * @param stompEndpointRegistry
+     */
+    @Override
+    public void registerStompEndpoints(StompEndpointRegistry stompEndpointRegistry) {
+        stompEndpointRegistry
+                .addEndpoint("/gyee-websocket")  //端点名称
+                //.setHandshakeHandler() 握手处理,主要是连接的时候认证获取其他数据验证等
+                //.addInterceptors() 拦截处理,和http拦截类似
+                .setAllowedOrigins("*");//跨域
+     //  .withSockJS(); //使用sockJS1启用该行代码,使用VUE注释该行代码
+
+    }
+//    /**
+//     * 采用自定义拦截器,获取connect时候传递的参数
+//     *
+//     * @param registration
+//     */
+//    @Override
+//    public void configureClientInboundChannel(ChannelRegistration registration) {
+//        registration.interceptors(clientInboundChannelInterceptor);
+//    }
+
+
+//    /**
+//     * 注册相关服务
+//     *
+//     * @param registry
+//     */
+//    @Override
+//    public void configureMessageBroker(MessageBrokerRegistry registry) {
+//
+//        registry.enableSimpleBroker("/topic", "/queue");
+//        //客户端名称前缀
+//        registry.setApplicationDestinationPrefixes("/app");
+//        //用户名称前
+//        registry.setUserDestinationPrefix("/userDataSet");
+//    }
+
+    /**
+     * 配置消息代理
+     * @param registry
+     */
+    @Override
+    public void configureMessageBroker(MessageBrokerRegistry registry)
+    {
+        /*
+         *  enableStompBrokerRelay 配置外部的STOMP服务,需要安装额外的支持 比如rabbitmq或activemq
+         * 1. 配置代理域,可以配置多个,此段代码配置代理目的地的前缀为 /topicTest 或者 /userTest
+         *    我们就可以在配置的域上向客户端推送消息
+         * 3. 可以通过 setRelayHost 配置代理监听的host,默认为localhost
+         * 4. 可以通过 setRelayPort 配置代理监听的端口,默认为61613
+         * 5. 可以通过 setClientLogin 和 setClientPasscode 配置账号和密码
+         * 6. setxxx这种设置方法是可选的,根据业务需要自行配置,也可以使用默认配置
+         */
+        //registry.enableStompBrokerRelay("/topicTest","/userTest")
+        //.setRelayHost("rabbit.someotherserver")
+        //.setRelayPort(62623);
+        //.setClientLogin("userName")
+        //.setClientPasscode("password")
+        //;
+
+        // 自定义调度器,用于控制心跳线程
+        ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
+        // 线程池线程数,心跳连接开线程
+        taskScheduler.setPoolSize(1);
+        // 线程名前缀
+        taskScheduler.setThreadNamePrefix("websocket-heartbeat-thread-");
+        // 初始化
+        taskScheduler.initialize();
+
+        /*
+         * spring 内置broker对象
+         * 1. 配置代理域,可以配置多个,此段代码配置代理目的地的前缀为 /topicTest 或者 /userTest
+         *    我们就可以在配置的域上向客户端推送消息
+         * 2,进行心跳设置,第一值表示server最小能保证发的心跳间隔毫秒数, 第二个值代码server希望client发的心跳间隔毫秒数
+         * 3. 可以配置心跳线程调度器 setHeartbeatValue这个不能单独设置,不然不起作用,要配合setTaskScheduler才可以生效
+         *    调度器我们可以自己写一个,也可以自己使用默认的调度器 new DefaultManagedTaskScheduler()
+         */
+        registry.enableSimpleBroker("/topic","/queue")
+                .setHeartbeatValue(new long[]{10000,10000})
+                .setTaskScheduler(taskScheduler);
+        /*
+         *  "/app" 为配置应用服务器的地址前缀,表示所有以/app 开头的客户端消息或请求
+         *  都会路由到带有@MessageMapping 注解的方法中
+         */
+        registry.setApplicationDestinationPrefixes("/app");
+
+        /*
+         *  1. 配置一对一消息前缀, 客户端接收一对一消息需要配置的前缀 如“'/user/'+userid + '/message'”,
+         *     是客户端订阅一对一消息的地址 stompClient.subscribe js方法调用的地址
+         *  2. 使用@SendToUser发送私信的规则不是这个参数设定,在框架内部是用UserDestinationMessageHandler处理,
+         *     而不是而不是 AnnotationMethodMessageHandler 或  SimpleBrokerMessageHandler
+         *     or StompBrokerRelayMessageHandler,是在@SendToUser的URL前加“user+sessionId"组成
+         */
+        registry.setUserDestinationPrefix("/user");
+
+        /*
+         * 自定义路径分割符
+         * 注释掉的这段代码添加的分割符为. 分割是类级别的@messageMapping和方法级别的@messageMapping的路径
+         * 例如类注解路径为 “topic”,方法注解路径为“hello”,那么客户端JS stompClient.send 方法调用的路径为“/app/topic.hello”
+         * 注释掉此段代码后,类注解路径“/topic”,方法注解路径“/hello”,JS调用的路径为“/app/topic/hello”
+         */
+        //registry.setPathMatcher(new AntPathMatcher("."));
+
+    }
+
+
+    /**
+     * 配置发送与接收的消息参数,可以指定消息字节大小,缓存大小,发送超时时间
+     * @param registration
+     */
+    @Override
+    public void configureWebSocketTransport(WebSocketTransportRegistration registration) {
+        /*
+         * 1. setMessageSizeLimit 设置消息缓存的字节数大小 字节
+         * 2. setSendBufferSizeLimit 设置websocket会话时,缓存的大小 字节
+         * 3. setSendTimeLimit 设置消息发送会话超时时间,毫秒
+         */
+        registration.setMessageSizeLimit(1024*10)
+                .setSendBufferSizeLimit(1024*10)
+                .setSendTimeLimit(10000);
+    }
+
+    /**
+     * 设置输入消息通道的线程数,默认线程为1,可以自己自定义线程数,最大线程数,线程存活时间
+     * @param registration
+     */
+    @Override
+    public void configureClientInboundChannel(ChannelRegistration registration) {
+
+        /*
+         * 配置消息线程池
+         * 1. corePoolSize 配置核心线程池,当线程数小于此配置时,不管线程中有无空闲的线程,都会产生新线程处理任务
+         * 2. maxPoolSize 配置线程池最大数,当线程池数等于此配置时,不会产生新线程
+         * 3. keepAliveSeconds 线程池维护线程所允许的空闲时间,单位秒
+         */
+        registration.taskExecutor().corePoolSize(10)
+                .maxPoolSize(20)
+                .keepAliveSeconds(60);
+        /*
+         * 添加stomp自定义拦截器,可以根据业务做一些处理
+         * springframework 4.3.12 之后版本此方法废弃,代替方法 interceptors(ChannelInterceptor... interceptors)
+         * 消息拦截器,实现ChannelInterceptor接口
+         */
+        registration.interceptors(clientInboundChannelInterceptor);
+    }
+
+    /**
+     *设置输出消息通道的线程数,默认线程为1,可以自己自定义线程数,最大线程数,线程存活时间
+     * @param registration
+     */
+    @Override
+    public void configureClientOutboundChannel(ChannelRegistration registration) {
+        registration.taskExecutor().corePoolSize(100)
+                .maxPoolSize(1000)
+                .keepAliveSeconds(60);
+        //registration.setInterceptors(new WebSocketChannelInterceptor());
+    }
+
+    /**
+     * 添加自定义的消息转换器,spring 提供多种默认的消息转换器,
+     * 返回false,不会添加消息转换器,返回true,会添加默认的消息转换器,当然也可以把自己写的消息转换器添加到转换链中
+     * @param list
+     * @return
+     */
+    @Override
+    public boolean configureMessageConverters(List<MessageConverter> list) {
+        return true;
+    }
+
+//    /**
+//     * 自定义控制器方法的参数类型,有兴趣可以百度google HandlerMethodArgumentResolver这个的用法
+//     * @param list
+//     */
+//    @Override
+//    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> list) {
+//
+//    }
+//
+//    /**
+//     * 自定义控制器方法返回值类型,有兴趣可以百度google HandlerMethodReturnValueHandler这个的用法
+//     * @param list
+//     */
+//    @Override
+//    public void addReturnValueHandlers(List<HandlerMethodReturnValueHandler> list) {
+//
+//    }
+//
+//    /**
+//     * 拦截器加入 spring ioc容器
+//     * @return
+//     */
+//    @Bean
+//    public WebSocketChannelInterceptor webSocketChannelInterceptor()
+//    {
+//        return new WebSocketChannelInterceptor();
+//    }
+
+
+
+}
+
+

+ 68 - 0
web/health-hb/src/main/java/com/gyee/frame/common/websocket/WebSocketLoginOutEvent.java

@@ -0,0 +1,68 @@
+package com.gyee.frame.common.websocket;
+
+import com.gyee.frame.common.quartz.QuartzSchedulerUtil;
+import com.gyee.frame.util.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.concurrent.CopyOnWriteArraySet;
+
+@Component
+public class WebSocketLoginOutEvent extends QuartzSchedulerUtil.SocketTaskUtil {
+
+    public void loginOut(String authToken) {
+
+        if(StringUtils.notEmp(authToken) && !authToken.equals("null"))
+        {
+            if(WebSocketConfig.sessioncacheMap.containsKey(authToken))
+            {
+                CopyOnWriteArraySet<String> sessionIdset=WebSocketConfig.sessioncacheMap.get(authToken);
+
+                for(String topic:sessionIdset)
+                {
+                    if(WebSocketConfig.websocketcacheMap.containsKey(topic))
+                    {
+                        CopyOnWriteArraySet<String> set=WebSocketConfig.websocketcacheMap.get(topic);
+                        set.remove(authToken);
+                        WebSocketConfig.websocketcacheMap.put(topic,set);
+
+                        if(set.size()==0)
+                        {
+                            WebSocketConfig.websocketcacheMap.remove(topic);
+                            this.deleteJob(topic);
+                        }
+                    }
+
+                    sessionIdset.remove(topic);
+                }
+                WebSocketConfig.sessioncacheMap.remove(authToken);
+            }
+
+
+            if(WebSocketConfig.sessionparamcacheMap.containsKey(authToken))
+            {
+                CopyOnWriteArraySet<String> sessionIdset=WebSocketConfig.sessionparamcacheMap.get(authToken);
+
+                for(String topic:sessionIdset)
+                {
+                    if(WebSocketConfig.websocketparamcacheMap.containsKey(topic))
+                    {
+                        CopyOnWriteArraySet<String> set=WebSocketConfig.websocketparamcacheMap.get(topic);
+                        set.remove(authToken);
+                        WebSocketConfig.websocketparamcacheMap.put(topic,set);
+
+                        if(set.size()==0)
+                        {
+                            WebSocketConfig.websocketparamcacheMap.remove(topic);
+                            this.deleteJob(topic);
+                        }
+                    }
+
+                    sessionIdset.remove(topic);
+                }
+                WebSocketConfig.sessionparamcacheMap.remove(authToken);
+            }
+        }
+
+    }
+
+}

+ 30 - 0
web/health-hb/src/main/java/com/gyee/frame/common/websocket/WebsocketMessageService.java

@@ -0,0 +1,30 @@
+package com.gyee.frame.common.websocket;
+
+import com.alibaba.fastjson.JSON;
+import com.gyee.frame.common.conf.AjaxStatus;
+import com.gyee.frame.common.domain.AjaxResult;
+import com.gyee.frame.util.StringUtils;
+import org.springframework.messaging.simp.SimpMessagingTemplate;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+
+
+@Component
+public class WebsocketMessageService
+{
+
+    @Resource
+    private SimpMessagingTemplate simpMessagingTemplate;
+
+
+    public void SendAlertToAll(String destination, Object sendData)
+    {
+        if (StringUtils.notEmp(sendData)) {
+            simpMessagingTemplate.convertAndSend(destination, AjaxResult.successData(AjaxStatus.success.code, JSON.toJSONString(sendData)));
+        } else {
+            simpMessagingTemplate.convertAndSend(destination, AjaxResult.successData(AjaxStatus.error.code, "数据传输错误"));
+        }
+
+    }
+}

+ 130 - 0
web/health-hb/src/main/java/com/gyee/frame/controller/health/EarlyWarnKnowledgeController.java

@@ -0,0 +1,130 @@
+package com.gyee.frame.controller.health;
+
+import com.github.pagehelper.PageInfo;
+import com.gyee.frame.common.conf.AjaxStatus;
+import com.gyee.frame.common.domain.AjaxResult;
+import com.gyee.frame.model.auto.Alertrule2;
+import com.gyee.frame.model.custom.Tablepar;
+import com.gyee.frame.service.Alertrule2ervice;
+import com.gyee.frame.util.StringUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+@Controller
+@RequestMapping("/earlyWarnKnowledge")
+@Api(value = "预警知识" ,tags =  "预警知识")
+public class EarlyWarnKnowledgeController {
+
+    @Resource
+    private Alertrule2ervice alertrule2ervice;
+
+
+    @PostMapping("/earlyWarnKnowledgeList")
+    @ResponseBody
+    @ApiOperation(value = "预警知识列表", notes = "预警知识列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "tablepar", value = "分页排序对象", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "name", value = "预警名称", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "category", value = "预警类型", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "rank", value = "预警级别", required = true, dataType = "string", paramType = "query")})
+    public AjaxResult earlyWarnKnowledgeList(@RequestBody Tablepar tablepar, String name, String category, String rank) {
+
+
+        PageInfo<Alertrule2> pageInfo = new PageInfo<>();
+
+
+        pageInfo = alertrule2ervice.getAlertruleList(tablepar, name, category, rank);
+
+        if (null!=pageInfo) {
+            return AjaxResult.successData(AjaxStatus.success.code, pageInfo);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, pageInfo);
+        }
+
+    }
+
+    @GetMapping("/findFaultknowledge")
+    @ResponseBody
+    @ApiOperation(value = "通过主键查询预警知识", notes = "通过主键查询预警知识")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "编号", required = true, dataType = "string", paramType = "query")})
+    public AjaxResult findFaultknowledge(String id) {
+
+
+        Alertrule2  po = new Alertrule2();
+
+        po = alertrule2ervice.findAlertrule2ById(id);
+
+        if (null!=po) {
+            return AjaxResult.successData(AjaxStatus.success.code, po);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, po);
+        }
+
+    }
+    @GetMapping("/updateFaultknowledge")
+    @ResponseBody
+    @ApiOperation(value = "修改预警知识", notes = "修改预警知识")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "po", value = "预警知识对象", required = true, dataType = "string", paramType = "query")})
+    public AjaxResult updateFaultknowledge(Alertrule2 po) {
+
+        int result =-1;
+        if(StringUtils.notEmp(po) && StringUtils.notEmp(po.getId()))
+        {
+            result =alertrule2ervice.updateAlertrule2(po);
+        }
+        if (result!=-1) {
+            return AjaxResult.successData(AjaxStatus.success.code, result);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, result);
+        }
+    }
+    @GetMapping("/insertFaultknowledge")
+    @ResponseBody
+    @ApiOperation(value = "新增预警知识", notes = "新增预警知识")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "po", value = "预警知识对象", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult insertFaultknowledge(Alertrule2 po) {
+
+        int result =-1;
+        if(StringUtils.notEmp(po) )
+        {
+            result = alertrule2ervice.insertAlertrule2(po);
+        }
+        if (result!=-1) {
+            return AjaxResult.successData(AjaxStatus.success.code, result);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, result);
+        }
+
+    }
+    @GetMapping("/deleteFaultknowledge")
+    @ResponseBody
+    @ApiOperation(value = "删除预警知识", notes = "删除预警知识")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "预警知识编号", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult deleteFaultknowledge(String id) {
+
+        int result =-1;
+        if(StringUtils.notEmp(id))
+        {
+            result =alertrule2ervice.deleteAlertrule2(id);
+        }
+        if (result!=-1) {
+            return AjaxResult.successData(AjaxStatus.success.code, result);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, result);
+        }
+    }
+
+
+}

+ 131 - 0
web/health-hb/src/main/java/com/gyee/frame/controller/health/FaultKnowledgeController.java

@@ -0,0 +1,131 @@
+package com.gyee.frame.controller.health;
+
+import com.github.pagehelper.PageInfo;
+import com.gyee.frame.common.conf.AjaxStatus;
+import com.gyee.frame.common.domain.AjaxResult;
+import com.gyee.frame.model.auto.P3DeviceFault;
+import com.gyee.frame.model.custom.Tablepar;
+import com.gyee.frame.service.health.FaultKnowledgeService;
+import com.gyee.frame.util.StringUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+@Controller
+@RequestMapping("/faultknowledge")
+@Api(value = "故障知识" ,tags =  "故障知识")
+public class FaultKnowledgeController {
+
+    @Resource
+    private FaultKnowledgeService faultKnowledgeService;
+
+
+
+    @PostMapping("/faultknowledgeList")
+    @ResponseBody
+    @ApiOperation(value = "故障知识列表", notes = "故障知识列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "tablepar", value = "分页排序对象", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "name", value = "故障名称", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "halttype", value = "停机类型", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "faultlevel", value = "故障级别", required = true, dataType = "string", paramType = "query")})
+    public AjaxResult faultknowledgeList(@RequestBody Tablepar tablepar, String name, String halttype, String faultlevel) {
+
+
+        PageInfo<P3DeviceFault> pageInfo = new PageInfo<>();
+
+
+        pageInfo = faultKnowledgeService.findP3DeviceFaultList(tablepar, name, halttype, faultlevel);
+
+        if (null!=pageInfo) {
+            return AjaxResult.successData(AjaxStatus.success.code, pageInfo);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, pageInfo);
+        }
+
+    }
+
+    @GetMapping("/findFaultknowledge")
+    @ResponseBody
+    @ApiOperation(value = "通过主键查询故障知识", notes = "通过主键查询故障知识")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "编号", required = true, dataType = "string", paramType = "query")})
+    public AjaxResult findFaultknowledge(String id) {
+
+
+        P3DeviceFault  po = new P3DeviceFault();
+
+        po = faultKnowledgeService.findP3DeviceFaultById(id);
+
+        if (null!=po) {
+            return AjaxResult.successData(AjaxStatus.success.code, po);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, po);
+        }
+
+    }
+    @GetMapping("/updateFaultknowledge")
+    @ResponseBody
+    @ApiOperation(value = "修改故障知识", notes = "修改故障知识")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "po", value = "故障知识对象", required = true, dataType = "string", paramType = "query")})
+    public AjaxResult updateFaultknowledge(P3DeviceFault po) {
+
+        int result =-1;
+        if(StringUtils.notEmp(po) && StringUtils.notEmp(po.getId()))
+        {
+            result =faultKnowledgeService.updateP3DeviceFault(po);
+        }
+        if (result!=-1) {
+            return AjaxResult.successData(AjaxStatus.success.code, result);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, result);
+        }
+    }
+    @GetMapping("/insertFaultknowledge")
+    @ResponseBody
+    @ApiOperation(value = "新增故障知识", notes = "新增故障知识")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "po", value = "故障知识对象", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult insertFaultknowledge(P3DeviceFault po) {
+
+        int result =-1;
+        if(StringUtils.notEmp(po) )
+        {
+            result = faultKnowledgeService.insertP3DeviceFault(po);
+        }
+        if (result!=-1) {
+            return AjaxResult.successData(AjaxStatus.success.code, result);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, result);
+        }
+
+    }
+    @GetMapping("/deleteFaultknowledge")
+    @ResponseBody
+    @ApiOperation(value = "删除故障知识", notes = "删除故障知识")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "故障知识编号", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult deleteFaultknowledge(String id) {
+
+        int result =-1;
+        if(StringUtils.notEmp(id))
+        {
+            result =faultKnowledgeService.deleteP3DeviceFault(id);
+        }
+        if (result!=-1) {
+            return AjaxResult.successData(AjaxStatus.success.code, result);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, result);
+        }
+    }
+
+
+}

+ 122 - 0
web/health-hb/src/main/java/com/gyee/frame/controller/health/HealthMainController.java

@@ -0,0 +1,122 @@
+package com.gyee.frame.controller.health;
+
+import com.gyee.frame.common.conf.AjaxStatus;
+import com.gyee.frame.common.domain.AjaxResult;
+import com.gyee.frame.service.health.HealthMainService;
+import com.gyee.frame.util.StringUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.annotation.Resource;
+import java.util.HashMap;
+import java.util.Map;
+
+@Controller
+@RequestMapping("/healthmain")
+@Api(value = "健康管理主页面" ,tags =  "健康管理主页面")
+public class HealthMainController {
+
+    @Resource
+    private HealthMainService healthMainService;
+
+
+    @GetMapping("/findAllChart")
+    @ResponseBody
+    @ApiOperation(value = "获得健康状态情况图表", notes = "获得健康状态情况图表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "num", value = "结果数量", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "type", value = "类型", required = true, dataType = "string", paramType = "query")})
+    public AjaxResult findAllChart(String wpId, String num, String type) throws Exception {
+
+
+        Map<String, Object[]>  map = new HashMap<>();
+
+        if(StringUtils.notEmp(wpId) && StringUtils.notEmp(num) && StringUtils.notEmp(type))
+        {
+            map = healthMainService.findAllChart(wpId,Integer.valueOf(num), Integer.valueOf(type));
+        }
+
+        if (null!=map) {
+            return AjaxResult.successData(AjaxStatus.success.code, map);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, map);
+        }
+
+    }
+
+    @GetMapping("/findAllMap")
+    @ResponseBody
+    @ApiOperation(value = "获得全省健康状态基础数据", notes = "获得全省健康状态基础数据")
+    @ApiImplicitParams({
+           })
+    public AjaxResult findAllMap() throws Exception {
+
+
+        Map<String, Object>  map = new HashMap<>();
+
+        map = healthMainService.findAllMap();
+
+        if (null!=map && !map.isEmpty()) {
+            return AjaxResult.successData(AjaxStatus.success.code, map);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, map);
+        }
+
+    }
+
+    @GetMapping("/findWpMap")
+    @ResponseBody
+    @ApiOperation(value = "获得场站健康状态基础数据", notes = "获得场站健康状态基础数据")
+    @ApiImplicitParams({
+    })
+    public AjaxResult findWpMap(String wpId) throws Exception {
+
+
+        Map<String, Object>  map = new HashMap<>();
+
+
+        if(StringUtils.notEmp(wpId))
+        {
+            map = healthMainService.findWpMap(wpId);
+        }
+
+
+        if (null!=map && !map.isEmpty()) {
+            return AjaxResult.successData(AjaxStatus.success.code, map);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, map);
+        }
+
+    }
+
+
+    @GetMapping("/findHealthMatrixMap")
+    @ResponseBody
+    @ApiOperation(value = "获得健康矩阵", notes = "获得健康矩阵")
+    @ApiImplicitParams({
+    })
+    public AjaxResult findHealthMatrixMap() throws Exception {
+
+
+        Map<String, Object>  map = new HashMap<>();
+
+
+        map = healthMainService.findHealthMatrixMap();
+
+
+        if (null!=map && !map.isEmpty()) {
+            return AjaxResult.successData(AjaxStatus.success.code, map);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, map);
+        }
+
+    }
+}

+ 144 - 0
web/health-hb/src/main/java/com/gyee/frame/controller/health/HealthOperationController.java

@@ -0,0 +1,144 @@
+package com.gyee.frame.controller.health;
+
+import com.gyee.frame.common.conf.AjaxStatus;
+import com.gyee.frame.common.domain.AjaxResult;
+import com.gyee.frame.model.custom.SimpleVo;
+import com.gyee.frame.service.ShutdowneventService;
+import com.gyee.frame.service.WarningRecordsService;
+import com.gyee.frame.service.health.HealthOperationService;
+import com.gyee.frame.util.StringUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Controller
+@RequestMapping("/healthoperation")
+@Api(value = "健康管理主页面" ,tags =  "健康管理主页面")
+public class HealthOperationController {
+
+    @Resource
+    private HealthOperationService healthOperationService;
+    @Resource
+    private ShutdowneventService shutdowneventService;
+    @Resource
+    private WarningRecordsService warningRecordsService;
+
+
+    @GetMapping("/countWpwarn")
+    @ResponseBody
+    @ApiOperation(value = "近7天报警事件统计 type 1风场2项目", notes = "近7天报警事件统计 ype 1风场2项目")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "type", value = "类型", required = true, dataType = "string", paramType = "query")})
+    public AjaxResult countWpwarn(String type) throws Exception {
+
+
+        List<SimpleVo> vos = new ArrayList<>();
+
+        if(StringUtils.notEmp(type))
+        {
+            if(type.equals("1"))
+            {
+                vos = warningRecordsService.countWpwarnByWp();
+            }else  if(type.equals("2"))
+            {
+                vos = warningRecordsService.countWpwarnByPj();
+            }
+
+        }
+
+        if (null!=vos) {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, vos);
+        }
+
+    }
+
+    @GetMapping("/countStop")
+    @ResponseBody
+    @ApiOperation(value = "近7天停机事件统计 type 1风场2项目", notes = "近7天停机事件统计 ype 1风场2项目")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "type", value = "类型", required = true, dataType = "string", paramType = "query")})
+    public AjaxResult countStop(String type) throws Exception {
+
+
+        List<SimpleVo> vos = new ArrayList<>();
+
+        if(StringUtils.notEmp(type))
+        {
+            if(type.equals("1"))
+            {
+                vos = shutdowneventService.countStopByWp();
+            }else  if(type.equals("2"))
+            {
+                vos = shutdowneventService.countStopByPj();
+            }
+
+        }
+
+        if (null!=vos) {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, vos);
+        }
+
+    }
+    @GetMapping("/countWpOrProStatus")
+    @ResponseBody
+    @ApiOperation(value = "健康状态占比图表 type 1风场2项目", notes = "健康状态占比图表 type 1风场2项目")
+    @ApiImplicitParams({
+                @ApiImplicitParam(name = "type", value = "类型", required = true, dataType = "string", paramType = "query")})
+    public AjaxResult countWpOrProStatus(String type) throws Exception {
+
+
+        Map<String, Object>  map = new HashMap<>();
+
+        if(StringUtils.notEmp(type))
+        {
+            map = healthOperationService.countWpOrProStatus(type);
+        }
+
+        if (null!=map) {
+            return AjaxResult.successData(AjaxStatus.success.code, map);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, map);
+        }
+
+    }
+
+    @GetMapping("/findWpOrProStatusForHistory")
+    @ResponseBody
+    @ApiOperation(value = "健康状态曲线图表 type 1风场2项目 status 1良好2注意", notes = "健康状态曲线图表 type 1风场2项目 status 1良好2注意")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "type", value = "类型", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "status", value = "状态", required = true, dataType = "string", paramType = "query")})
+    public AjaxResult findWpOrProStatusForHistory(String type, String status) throws Exception {
+
+
+        Map<String, Object>  map = new HashMap<>();
+
+        if(StringUtils.notEmp(type) && StringUtils.notEmp(status))
+        {
+            map = healthOperationService.findWpOrProStatusForHistory(type,status);
+        }
+
+        if (null!=map) {
+            return AjaxResult.successData(AjaxStatus.success.code, map);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, map);
+        }
+
+    }
+}

+ 495 - 0
web/health-hb/src/main/java/com/gyee/frame/controller/health/HealthSubController.java

@@ -0,0 +1,495 @@
+package com.gyee.frame.controller.health;
+
+import com.gyee.frame.common.conf.AjaxStatus;
+import com.gyee.frame.common.domain.AjaxResult;
+import com.gyee.frame.model.custom.*;
+import com.gyee.frame.service.health.HealthSubService;
+import com.gyee.frame.service.weather.WeatherDay5Service;
+import com.gyee.frame.util.DateUtils;
+import com.gyee.frame.util.StringUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.annotation.Resource;
+import java.util.*;
+
+@Controller
+@RequestMapping("/healthsub")
+@Api(value = "健康管理风机页面" ,tags =  "健康管理风机页面")
+public class HealthSubController {
+
+    @Resource
+    private HealthSubService healthSubService;
+
+    @Resource
+    private WeatherDay5Service weatherDay5Service;
+
+
+    @GetMapping("/findWtHealthInfo")
+    @ResponseBody
+    @ApiOperation(value = "获取健康管理风机信息", notes = "获取健康管理风机信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
+    })
+    public AjaxResult findWtHealthInfo(String wtId) throws Exception {
+
+
+        Map<String, Object>  map = new HashMap<>();
+
+        if(StringUtils.notEmp(wtId))
+        {
+
+
+            Calendar cal = Calendar.getInstance();
+
+            Date recodedate = DateUtils.truncate(cal.getTime());
+            //获取故障类型和风机健康得分
+            Map<String,String>  stoptypemap = healthSubService.findWtInfo(wtId);
+            //获取健康管理风机部件基础信息
+            Map<String, Map<String, Object>>  partmap = healthSubService.findPartHealthInfo(wtId);
+            //故障数据统计
+            List<GzfxVo>  gzls = healthSubService.initalGzjfx(wtId,recodedate);
+            //预警数据统计
+            List<YjfxVo>  yjls = healthSubService.initalYjfx(wtId,recodedate);
+            //部件运行数据
+            List<YxfxVo>  bjyxls = healthSubService.initalYxfx(wtId,recodedate);
+            //获得日、月等级评估
+            List<XnfxVo>  djpgls = healthSubService.initalXnfx(wtId,cal);
+            //当日停机
+            List<ShutdowneventVo>  stopls = healthSubService.initalShutdown(wtId);
+            //各个区间曲线偏差率
+            List<QxpcVo>  qxpcls = healthSubService.findQxpcList(wtId);
+            //温度范围
+            List<YxfxVo>  wdls = healthSubService.findWdList(wtId);
+            //获得健康评价列表
+            List<ValueVo>  jkls = healthSubService.findJudgmentList(wtId);
+
+
+            map.put("stoptypemap",stoptypemap);
+            map.put("partmap",partmap);
+            map.put("gzls",gzls);
+            map.put("yjls",yjls);
+            map.put("bjyxls",bjyxls);
+            map.put("djpgls",djpgls);
+            map.put("stopls",stopls);
+            map.put("qxpcls",qxpcls);
+            map.put("wdls",wdls);
+            map.put("jkls",jkls);
+
+
+
+        }
+
+        if (null!=map) {
+            return AjaxResult.successData(AjaxStatus.success.code, map);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, map);
+        }
+
+    }
+
+    @GetMapping("/findWtHealthInfo1")
+    @ResponseBody
+    @ApiOperation(value = "获取健康管理风机信息", notes = "获取健康管理风机信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
+    })
+    public AjaxResult findWtHealthInfo1(String wtId) throws Exception {
+
+
+        Map<String, Object>  map = new HashMap<>();
+
+        if(StringUtils.notEmp(wtId))
+        {
+
+
+            Calendar cal = Calendar.getInstance();
+
+            Date recodedate = DateUtils.truncate(cal.getTime());
+//            //获取故障类型和风机健康得分
+//            Map<String,String>  stoptypemap = healthSubService.findWtInfo(wtId);
+//            //获取健康管理风机部件基础信息
+//            Map<String, Map<String, Object>>  partmap = healthSubService.findPartHealthInfo(wtId);
+//            //故障数据统计
+//            List<GzfxVo>  gzls = healthSubService.initalGzjfx(wtId,recodedate);
+//            //预警数据统计
+//            List<YjfxVo>  yjls = healthSubService.initalYjfx(wtId,recodedate);
+//            //部件运行数据
+//            List<YxfxVo>  bjyxls = healthSubService.initalYxfx(wtId,recodedate);
+//            //获得日、月等级评估
+//            List<XnfxVo>  djpgls = healthSubService.initalXnfx(wtId,cal);
+//            //当日停机
+//            List<ShutdowneventVo>  stopls = healthSubService.initalShutdown(wtId);
+//            //各个区间曲线偏差率
+//            List<QxpcVo>  qxpcls = healthSubService.findQxpcList(wtId);
+//            //温度范围
+//            List<YxfxVo>  wdls = healthSubService.findWdList(wtId);
+//            //获得健康评价列表
+//            List<ValueVo>  jkls = healthSubService.findJudgmentList(wtId);
+//
+//
+//            map.put("stoptypemap",stoptypemap);
+//            map.put("partmap",partmap);
+//            map.put("gzls",gzls);
+//            map.put("yjls",yjls);
+//            map.put("bjyxls",bjyxls);
+//            map.put("djpgls",djpgls);
+//            map.put("stopls",stopls);
+//            map.put("qxpcls",qxpcls);
+//            map.put("wdls",wdls);
+//            map.put("jkls",jkls);
+
+            //获取故障类型和风机健康得分
+            Map<String,String>  stoptypemap = healthSubService.findWtInfo(wtId);
+            //获取健康管理风机部件基础信息
+            Map<String, Map<String, Object>>  partmap = healthSubService.findPartHealthInfo(wtId);
+            //故障数据统计
+            List<GzfxVo>  gzls = healthSubService.initalGzjfx(wtId,recodedate);
+            //预警数据统计
+            List<YjfxVo>  yjls = healthSubService.initalYjfx(wtId,recodedate);
+
+
+            map.put("stoptypemap",stoptypemap);
+            map.put("partmap",partmap);
+            map.put("gzls",gzls);
+            map.put("yjls",yjls);
+
+        }
+
+        if (null!=map) {
+            return AjaxResult.successData(AjaxStatus.success.code, map);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, map);
+        }
+
+    }
+
+/********************************************************************************************************/
+
+
+@GetMapping("/findWtHealthInfo2")
+@ResponseBody
+@ApiOperation(value = "获取健康管理风机信息", notes = "获取健康管理风机信息")
+@ApiImplicitParams({
+        @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
+})
+public AjaxResult findWtHealthInfo2(String wtId) throws Exception {
+
+
+    Map<String, Object>  map = new HashMap<>();
+
+    if(StringUtils.notEmp(wtId))
+    {
+
+
+        Calendar cal = Calendar.getInstance();
+
+        Date recodedate = DateUtils.truncate(cal.getTime());
+
+        //部件运行数据
+        List<YxfxVo>  bjyxls = healthSubService.initalYxfx(wtId,recodedate);
+        //获得日、月等级评估
+        List<XnfxVo>  djpgls = healthSubService.initalXnfx(wtId,cal);
+        //当日停机
+        List<ShutdowneventVo>  stopls = healthSubService.initalShutdown(wtId);
+
+
+        map.put("bjyxls",bjyxls);
+        map.put("djpgls",djpgls);
+        map.put("stopls",stopls);
+
+    }
+
+    if (null!=map) {
+        return AjaxResult.successData(AjaxStatus.success.code, map);
+    } else {
+        return AjaxResult.successData(AjaxStatus.error.code, map);
+    }
+
+}
+
+    /********************************************************************************************************/
+
+    @GetMapping("/findWtHealthInfo3")
+    @ResponseBody
+    @ApiOperation(value = "获取健康管理风机信息", notes = "获取健康管理风机信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
+    })
+    public AjaxResult findWtHealthInfo3(String wtId) throws Exception {
+
+
+        Map<String, Object>  map = new HashMap<>();
+
+        if(StringUtils.notEmp(wtId))
+        {
+
+
+            Calendar cal = Calendar.getInstance();
+
+            Date recodedate = DateUtils.truncate(cal.getTime());
+
+            //各个区间曲线偏差率
+            List<QxpcVo>  qxpcls = healthSubService.findQxpcList(wtId);
+            //温度范围
+            List<YxfxVo>  wdls = healthSubService.findWdList(wtId);
+            //获得健康评价列表
+            List<ValueVo>  jkls = healthSubService.findJudgmentList(wtId);
+
+
+            map.put("qxpcls",qxpcls);
+            map.put("wdls",wdls);
+            map.put("jkls",jkls);
+        }
+
+        if (null!=map) {
+            return AjaxResult.successData(AjaxStatus.success.code, map);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, map);
+        }
+
+    }
+
+    /********************************************************************************************************/
+
+    @GetMapping("/gadaytop5")
+    @ResponseBody
+    @ApiOperation(value = "获得等级评估前5数据", notes = "获得等级评估前5数据")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
+    })
+    public AjaxResult gadaytop5(String wtId) throws Exception {
+
+
+        Map<String, Object> map = new HashMap<>();
+
+        if(StringUtils.notEmp(wtId))
+        {
+
+            map = healthSubService.gadaytop5(wtId);
+        }
+
+        if (null!=map) {
+            return AjaxResult.successData(AjaxStatus.success.code, map);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, map);
+        }
+
+    }
+
+
+    @GetMapping("/queryStopTop10")
+    @ResponseBody
+    @ApiOperation(value = "获取最新的十次停机事件", notes = "获取最新的十次停机事件")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
+    })
+    public AjaxResult queryStopTop10(String wtId) throws Exception {
+
+
+        List<ShutdowneventVo> vos = new ArrayList<>();
+
+        if(StringUtils.notEmp(wtId))
+        {
+
+            vos = healthSubService.queryStopTop10(wtId);
+        }
+
+        if (null!=vos) {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, vos);
+        }
+
+    }
+
+
+    @GetMapping("/getWtMttrandMtbfByBj")
+    @ResponseBody
+    @ApiOperation(value = "获取风机部件MTTR和MTBF  数组 0健康状态、1部件名称 2 7天健康状态 3 故障进度 4 mtbf 5 mttr 6损失电量", notes = "获取风机部件MTTR和MTBF 数组 0健康状态、1部件名称 2 7天健康状态 3 故障进度 4 mtbf 5 mttr 6损失电量")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
+    })
+    public AjaxResult getWtMttrandMtbfByBj(String wtId) throws Exception {
+
+
+        Map<String, Object> map = new HashMap<String, Object>();
+
+        if(StringUtils.notEmp(wtId))
+        {
+
+            map = healthSubService.getWtMttrandMtbfByBj(wtId);
+        }
+
+        if (null!=map) {
+            return AjaxResult.successData(AjaxStatus.success.code, map);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, map);
+        }
+
+    }
+
+    @GetMapping("/getWeatherRealDay5Info")
+    @ResponseBody
+    @ApiOperation(value = "获取近5天气象数据", notes = "获取近5天气象数据")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query")
+    })
+    public AjaxResult getWeatherRealDay5Info(String wpId) throws Exception {
+
+
+        Map<String, Object> map = new HashMap<String, Object>();
+
+        if(StringUtils.notEmp(wpId))
+        {
+
+            map = weatherDay5Service.getWeatherRealDay5Info(wpId);
+        }
+
+        if (null!=map) {
+            return AjaxResult.successData(AjaxStatus.success.code, map);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, map);
+        }
+
+    }
+
+
+
+    @GetMapping("/findPowerChar")
+    @ResponseBody
+    @ApiOperation(value = "获得实际功率和理论功率曲线", notes = "获得实际功率和理论功率曲线")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
+    })
+    public AjaxResult findPowerChar(String wtId) throws Exception {
+
+
+        Map<String, Object[]> map = new HashMap<>();
+
+        if(StringUtils.notEmp(wtId))
+        {
+
+            map = healthSubService.findPowerChar(wtId);
+        }
+
+        if (null!=map) {
+            return AjaxResult.successData(AjaxStatus.success.code, map);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, map);
+        }
+
+    }
+/**************************************************************************************************************************************************/
+
+    @GetMapping("/hsFjValueIndex")
+    @ResponseBody
+    @ApiOperation(value = "获取部件图表", notes = "获取部件图表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
+    })
+    public AjaxResult hsFjValueIndex(String wtId) throws Exception {
+
+
+        ActivityVo vo = new ActivityVo();
+
+        if(StringUtils.notEmp(wtId))
+        {
+            Calendar cal = Calendar.getInstance();
+
+            cal.set(Calendar.HOUR_OF_DAY, 0);
+            cal.set(Calendar.MINUTE, 0);
+            cal.set(Calendar.SECOND, 0);
+
+
+            Date endDate = cal.getTime();
+
+            cal.add(Calendar.DAY_OF_MONTH, -1);
+            Date beginDate = cal.getTime();
+            vo = healthSubService.hsFjValueIndex(wtId,beginDate,endDate);
+        }
+
+        if (null!=vo) {
+            return AjaxResult.successData(AjaxStatus.success.code, vo);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, vo);
+        }
+
+    }
+
+
+    @GetMapping("/findWtHisValueForBj")
+    @ResponseBody
+    @ApiOperation(value = "获取风机部件健康曲线图表", notes = "获取风机部件健康曲线图表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
+    })
+    public AjaxResult findWtHisValueForBj(String wtId) throws Exception {
+
+
+        Map<String,Object> map = new HashMap();
+
+
+        if(StringUtils.notEmp(wtId))
+        {
+
+            map = healthSubService.findWtHisValueForBj(wtId);
+        }
+
+        if (null!=map) {
+            return AjaxResult.successData(AjaxStatus.success.code, map);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, map);
+        }
+
+    }
+
+
+    @GetMapping("/hsFjValueIndexByPart")
+    @ResponseBody
+    @ApiOperation(value = "获取风机健康部件曲线图", notes = "获取风机健康部件曲线图")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "type", value = "部件类型", required = true, dataType = "string", paramType = "query")
+    })
+    public AjaxResult hsFjValueIndexByPart(String wtId,String type) throws Exception {
+
+        Map<String, Object> result = new HashMap<String, Object>();
+        ActivityVo vo=new ActivityVo();
+
+        if(StringUtils.notEmp(wtId) && StringUtils.notEmp(type))
+        {
+            if (type.equals("1")) {
+                vo = healthSubService.getWTChart(wtId);
+            } else if (type.equals("2")) {
+                vo = healthSubService.getClxChart(wtId);
+            } else if (type.equals("3")) {
+                vo = healthSubService.getFdjChart(wtId);
+            } else if (type.equals("4")) {
+                vo = healthSubService.getKzysChart(wtId);
+            } else if (type.equals("5")) {
+                vo = healthSubService.getJcxtChart(wtId);
+            }
+
+            result.put(wtId, healthSubService.getrealValue(wtId, type));
+        }
+
+
+        result.put("activity", vo);
+
+        if (null!=vo) {
+            return AjaxResult.successData(AjaxStatus.success.code, vo);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, vo);
+        }
+
+    }
+
+}

+ 81 - 0
web/health-hb/src/main/java/com/gyee/frame/controller/health/LossPowerRateHealthController.java

@@ -0,0 +1,81 @@
+package com.gyee.frame.controller.health;
+
+import com.gyee.frame.common.conf.AjaxStatus;
+import com.gyee.frame.common.domain.AjaxResult;
+import com.gyee.frame.model.auto.LossPowerRate;
+import com.gyee.frame.service.LossPowerRateService;
+import com.gyee.frame.util.DateUtils;
+import com.gyee.frame.util.StringUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+
+@Controller
+@RequestMapping("/losspowerratehealth")
+@Api(value = "性能损失走势" ,tags =  "性能损失走势")
+public class LossPowerRateHealthController {
+
+    @Resource
+    private LossPowerRateService lossPowerRateService;
+
+    /**性能损失走势列表**/
+    @GetMapping("/losspowerrateList")
+    @ResponseBody
+    @ApiOperation(value = "性能损失走势列表", notes = "性能损失走势列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "beginDate", value = "开始日期", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "endDate", value = "结束日期", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult losspowerrateList(String wtId,String beginDate,String endDate) throws Exception {
+
+       List<LossPowerRate>  vos = new ArrayList<LossPowerRate>();
+        if (StringUtils.notEmp(wtId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate))
+        {
+            vos=lossPowerRateService.getLossPowerRateListBywtId(wtId, DateUtils.parseStrtoDate(beginDate), DateUtils.parseStrtoDate(endDate));
+        }
+
+        if (null!=vos) {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        }
+
+    }
+
+    /**性能损失走势图表**/
+    @GetMapping("/getChartlist")
+    @ResponseBody
+    @ApiOperation(value = "性能损失走势图表", notes = "性能损失走势图表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "beginDate", value = "开始日期", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "endDate", value = "结束日期", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult getChartlist(String wtId,String beginDate,String endDate) throws Exception {
+
+        List<List<List<Object>>>  vos = new ArrayList<>();
+        if (StringUtils.notEmp(wtId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate))
+        {
+            vos=lossPowerRateService.getChartlist(wtId, DateUtils.parseStrtoDate(beginDate), DateUtils.parseStrtoDate(endDate));
+        }
+
+        if (null!=vos) {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        }
+
+    }
+
+}

+ 80 - 0
web/health-hb/src/main/java/com/gyee/frame/controller/health/PartBjController.java

@@ -0,0 +1,80 @@
+package com.gyee.frame.controller.health;
+
+import com.gyee.frame.common.conf.AjaxStatus;
+import com.gyee.frame.common.domain.AjaxResult;
+import com.gyee.frame.model.custom.PartbjcountVo;
+import com.gyee.frame.model.custom.WindturbinebjCountVo;
+import com.gyee.frame.service.health.PartBjService;
+import com.gyee.frame.util.DateUtils;
+import com.gyee.frame.util.StringUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+
+@Controller
+@RequestMapping("/partbj")
+@Api(value = "批次报警分析" ,tags =  "批次报警分析")
+public class PartBjController {
+
+    @Resource
+    private PartBjService partBjService;
+
+    /**批次报警分析**/
+    @GetMapping("/partbjList")
+    @ResponseBody
+    @ApiOperation(value = "批次报警分析主列表", notes = "批次报警分析主列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "recorddate", value = "日期", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult partbjList(String recorddate) throws Exception {
+
+        List<PartbjcountVo> vos = new ArrayList<PartbjcountVo>();
+        if (StringUtils.notEmp(recorddate))
+        {
+            vos=partBjService.getPartBjCountList(DateUtils.parseStrtoDate(recorddate));
+        }
+
+        if (null!=vos) {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        }
+
+    }
+
+    /**批次报警分析**/
+    @GetMapping("/partbjsubList")
+    @ResponseBody
+    @ApiOperation(value = "批次报警分析明细列表", notes = "批次报警分析明细列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "lnid", value = "线路编号", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "part", value = "部件编号", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "recorddate", value = "日期", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult partbjsubList(String lnid, String part, String recorddate) throws Exception {
+
+        List<WindturbinebjCountVo> vos = new ArrayList<WindturbinebjCountVo>();
+        if (StringUtils.notEmp(recorddate))
+        {
+            vos=partBjService.getWindturbinebjCountVoList(lnid,  part,DateUtils.parseStrtoDate(recorddate));
+        }
+
+        if (null!=vos) {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        }
+
+    }
+
+}

+ 123 - 0
web/health-hb/src/main/java/com/gyee/frame/controller/health/ReliabilityAnalysisController.java

@@ -0,0 +1,123 @@
+package com.gyee.frame.controller.health;
+
+
+import com.gyee.frame.common.conf.AjaxStatus;
+import com.gyee.frame.common.domain.AjaxResult;
+import com.gyee.frame.common.feign.RemoteServiceBuilder;
+import com.gyee.frame.mapper.auto.WindturbineMapper;
+import com.gyee.frame.model.auto.*;
+import com.gyee.frame.model.custom.export.TsPointData;
+import com.gyee.frame.service.Alertrule2ervice;
+import com.gyee.frame.service.WindTurbineTestingPointAiService;
+import com.gyee.frame.service.WindTurbineTestingPointDiService;
+import com.gyee.frame.service.health.MetricsService;
+import com.gyee.frame.service.health.MetricsUniformCodeService;
+import io.swagger.annotations.Api;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.*;
+
+@RestController
+@CrossOrigin
+@RequestMapping("/analysis")
+@Api(value = "可靠性分析" ,tags =  "可靠性分析")
+public class ReliabilityAnalysisController {
+
+    @Resource
+    private Alertrule2ervice alertrule2ervice;
+    @Resource
+    private RemoteServiceBuilder remoteService;
+    @Resource
+    private MetricsService metricsService;
+    @Resource
+    private MetricsUniformCodeService uniformCodeService;
+    @Resource
+    private WindTurbineTestingPointAiService windAIService;
+    @Resource
+    private WindTurbineTestingPointDiService windDIService;
+    @Autowired
+    private WindturbineMapper windturbineMapper;
+
+
+    /**
+     * 查询报警规则中点的数据
+     * @param station
+     * @param wtId
+     * @param name
+     * @param startTs
+     * @param endTs
+     * @return
+     */
+    @GetMapping("/detail")
+    public AjaxResult analysisDetails(
+            @RequestParam(name = "station") String station,
+            @RequestParam(name = "wtId") String wtId,
+            @RequestParam(name = "name") String name,
+            @RequestParam(name = "startTs") long startTs,
+            @RequestParam(name = "endTs") long endTs,
+            @RequestParam(name = "interval", required = false) Optional<Integer> interval){
+
+        List<Object> list = new ArrayList<>();
+        Windturbine wtmid = windturbineMapper.selectByPrimaryKey(wtId);
+
+        List<String> codes = alertrule2ervice.getUniformCodeByNameAndStation(name, station, wtmid.getModelid());
+        if (codes == null || codes.size() == 0)
+            return AjaxResult.successData(AjaxStatus.success.code, list);
+
+        for (String code : codes){
+            Map<String, Object> map = new HashMap<>();
+            if (code.startsWith("AI")){
+                Windturbinetestingpointnew windAI = windAIService.getWindTurbineTestingPointAi2(wtId, code);
+                List<TsPointData> data = null;
+                if (interval.isPresent() && interval.get() > 0)
+                    data = remoteService.ShardingService().getHistorySnap(windAI.getCode(), startTs, endTs, interval.get());
+                else
+                    data = remoteService.ShardingService().getHistoryRaw(windAI.getCode(), startTs, endTs);
+
+                // 查询点的单位和描述属性
+                String unit = "--";
+                String desc = "----";
+                /*List<MetricsUniformCode> metricsList = uniformCodeService.getListByStationAndUniforCode(station, windAI.getUniformcode());
+                if (metricsList != null && metricsList.size() > 0) {
+                    MetricsUniformCode metricsUniformCode = metricsList.get(0);
+                    List<Metrics> metrics = metricsService.getMetricsByMetricsId(metricsUniformCode.getMetricid());
+                    if (metrics != null && metrics.size() > 0){
+                        unit = metrics.get(0).getUnitname();
+                        desc = metrics.get(1).getMetricname();
+                    }
+                }*/
+                MetricsCode metrics=uniformCodeService.getListName(wtId,windAI.getUniformcode());
+                String nm = metrics==null?"":metrics.getName();
+                map.put("unit", unit);
+                map.put("name", nm);
+                map.put("data", data);
+
+                list.add(map);
+            }
+        }
+
+        return AjaxResult.successData(AjaxStatus.success.code, list);
+    }
+
+
+    @Resource
+    WindTurbineTestingPointAiService windTurbineTestingPointAiService;
+
+    @GetMapping("/test")
+    public AjaxResult get(){
+        List<String> list = alertrule2ervice.getUniformCodeByNameAndStations();
+
+        List<String> modelID = alertrule2ervice.getModelID();
+
+
+//        for (String model : modelID)
+//            System.out.println(model);
+
+        List<String> winds = windTurbineTestingPointAiService.findPointByUniformcode(list, modelID);
+
+        return AjaxResult.successData(AjaxStatus.success.code, winds);
+    }
+
+}

+ 97 - 0
web/health-hb/src/main/java/com/gyee/frame/controller/health/StopAnalysisController.java

@@ -0,0 +1,97 @@
+package com.gyee.frame.controller.health;
+
+import com.gyee.frame.common.conf.AjaxStatus;
+import com.gyee.frame.common.domain.AjaxResult;
+import com.gyee.frame.model.auto.StopAnalysismainVo;
+import com.gyee.frame.model.custom.StopAnalysisNodeVo;
+import com.gyee.frame.service.stopanalysis.StopAnalysisStaticService;
+import com.gyee.frame.util.StringUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+
+@Controller
+@RequestMapping("/stopanalysis")
+@Api(value = "故障诊断" ,tags =  "故障诊断")
+public class StopAnalysisController {
+
+    @Resource
+    private StopAnalysisStaticService stopAnalysisStaticService;
+
+
+    @GetMapping("/stopAnalysisList")
+    @ResponseBody
+    @ApiOperation(value = "故障诊断列表", notes = "故障诊断列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "modelId", value = "模型编号", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "typeId", value = "时间类型", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult stopAnalysisList( String wpId, String modelId, String typeId) throws Exception {
+
+        List<StopAnalysismainVo> vos = new ArrayList<StopAnalysismainVo>();
+        if (StringUtils.notEmp(wpId) && StringUtils.notEmp(modelId)&& StringUtils.notEmp(typeId))
+        {
+
+            vos=stopAnalysisStaticService.stopAnalysisList(wpId, modelId, typeId);
+        }
+
+        if (null!=vos) {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        }
+
+    }
+
+    @GetMapping("/stopAnalysisTree")
+    @ResponseBody
+    @ApiOperation(value = "故障诊断部件树", notes = "故障诊断部件树")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wtId", value = "风场编号", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult stopAnalysisTree( String mainId,String wtId, String values) throws Exception {
+
+        List<StopAnalysisNodeVo> vos = new ArrayList<StopAnalysisNodeVo>();
+        if (StringUtils.notEmp(mainId) && StringUtils.notEmp(wtId) && StringUtils.notEmp(values))
+        {
+
+            vos=stopAnalysisStaticService.findLocationTreeByWtId(mainId,wtId,values);
+        }
+
+        if (null!=vos) {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        }
+
+    }
+
+    @PostMapping("/saveStopAnalysis")
+    @ResponseBody
+    @ApiOperation(value = "保存故障诊断结果", notes = "保存故障诊断结果")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "modelId", value = "模型编号", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "typeId", value = "时间类型", required = true, dataType = "string", paramType = "query")})
+
+        public AjaxResult saveStopAnalysis( String wpId, String modelId, String typeId) throws Exception {
+
+
+        stopAnalysisStaticService.saveStopAnalysis(wpId, modelId, typeId);
+
+        return AjaxResult.successData(AjaxStatus.success.code, "保存成功!");
+
+    }
+
+}

+ 160 - 0
web/health-hb/src/main/java/com/gyee/frame/controller/health/WindTurbineCurveController.java

@@ -0,0 +1,160 @@
+package com.gyee.frame.controller.health;
+
+import com.gyee.frame.common.conf.AjaxStatus;
+import com.gyee.frame.common.domain.AjaxResult;
+import com.gyee.frame.common.spring.Constant;
+import com.gyee.frame.model.auto.Windturbinecurvefittingmonth;
+import com.gyee.frame.model.auto.Windturbinetestingpointnew;
+import com.gyee.frame.model.custom.PointData;
+import com.gyee.frame.model.custom.QxpcVo;
+import com.gyee.frame.model.custom.Tablepar;
+import com.gyee.frame.service.CurvefittingsubService;
+import com.gyee.frame.service.WindTurbineTestingPointAiService;
+import com.gyee.frame.service.WindturbinecurvefittingmonthService;
+import com.gyee.frame.util.DateUtils;
+import com.gyee.frame.util.IRealTimeDataBaseUtil;
+import com.gyee.frame.util.RealTimeDataBaseFactory;
+import com.gyee.frame.util.StringUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.text.DecimalFormat;
+import java.util.*;
+
+@Controller
+@RequestMapping("/wtcurve")
+@Api(value = "单机区间曲线偏差率" ,tags =  "单机区间曲线偏差率")
+public class WindTurbineCurveController {
+
+    @Resource
+    private CurvefittingsubService curvefittingsubService;
+    @Resource
+    private WindturbinecurvefittingmonthService windturbinecurvefittingmonthService;
+
+    @Resource
+    private WindTurbineTestingPointAiService windTurbineTestingPointAiService;
+
+
+    IRealTimeDataBaseUtil realApiUtil = RealTimeDataBaseFactory.createRealTimeDataBase();
+    /**单机区间曲线偏差率**/
+    @PostMapping("/windTurbineCurveList")
+    @ResponseBody
+    @ApiOperation(value = "单机区间曲线偏差率", notes = "单机区间曲线偏差率")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "tablepar", value = "分页排序对象", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "recorddate", value = "日期", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult windTurbineCurveList(@RequestBody Tablepar tablepar, String wpId, String recorddate) throws Exception {
+
+        List<QxpcVo> vos = new ArrayList<QxpcVo>();
+        if (StringUtils.notEmp(wpId) && StringUtils.notEmp(recorddate))
+        {
+            Date date= DateUtils.parseDate(recorddate);
+            vos=curvefittingsubService.getCurvefittingsubList(tablepar, wpId, date);
+        }
+
+        if (null!=vos) {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        }
+
+    }
+
+    /**
+     * @throws
+     * @Title: scatterWtByDayAjax
+     * @Description: 获得选择风机、年份、月份相关散点图
+     */
+    @GetMapping("/scatterWtByDayAjax")
+    @ResponseBody
+    @ApiOperation(value = "获得选择风机、年份、月份相关散点图", notes = "获得选择风机、年份、月份相关散点图")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "recorddate", value = "日期", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult scatterWtByDayAjax(String wtId, String recorddate) throws Exception {
+
+        Map<String, List<List<Double>>> result = new HashMap<String, List<List<Double>>>();
+        if (StringUtils.notEmp(recorddate)) {
+
+
+            Date date = DateUtils.parseDate(recorddate);
+            Calendar cal = Calendar.getInstance();
+            cal.setTime(date);
+            cal.set(Calendar.HOUR_OF_DAY, 0);
+            cal.set(Calendar.MINUTE, 0);
+            cal.set(Calendar.SECOND, 0);
+            Date endDate = cal.getTime();
+            cal.add(Calendar.DAY_OF_MONTH, -7);
+            Date beginDate = cal.getTime();
+
+
+            Windturbinetestingpointnew gl = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, Constant.TPOINT_WT_FJGL);
+            int daynum = DateUtils.daysDiff(beginDate, endDate);
+            long pried = 300;
+            long count = 12 * 24 * daynum;
+            DecimalFormat dcmFmt = new DecimalFormat("0.00");
+            List<PointData> gls = realApiUtil.getHistoryDatasSnap(gl, beginDate.getTime() / 1000, endDate.getTime() / 1000, count, pried);
+            Windturbinetestingpointnew fs = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, Constant.TPOINT_WT_FJSSFS);
+            List<PointData> fss = realApiUtil.getHistoryDatasSnap(fs, beginDate.getTime() / 1000, endDate.getTime() / 1000, count, pried);
+
+            List<List<Double>> vos = new ArrayList<List<Double>>();
+            if (!gls.isEmpty() && !fss.isEmpty()) {
+                for (int i = 0; i < fss.size(); i++) {
+
+                    List<Double> ds = new ArrayList<Double>();
+
+                    double f = fss.get(i).getPointValueInDouble();
+                    ds.add(Double.valueOf(dcmFmt.format(f)));
+                    f = gls.get(i).getPointValueInDouble();
+                    ds.add(Double.valueOf(dcmFmt.format(f)));
+                    vos.add(ds);
+                }
+            }
+
+            cal = Calendar.getInstance();
+            cal.setTime(date);
+            List<List<Double>> vos2 = new ArrayList<List<Double>>();
+
+            int year = cal.get(Calendar.YEAR);
+            int month = cal.get(Calendar.MONTH) + 1;
+
+            List<Windturbinecurvefittingmonth> wcls = windturbinecurvefittingmonthService.getWindturbinecurvefittingmonthList(wtId, String.valueOf(year), String.valueOf(month));
+
+            for (Windturbinecurvefittingmonth wc : wcls) {
+
+                List<Double> ds = new ArrayList<Double>();
+                int c = (int) wc.getSpeed().intValue();
+
+                if (c == wc.getSpeed()) {
+                    ds.add(wc.getSpeed());
+                    ds.add(wc.getOptimalpower());
+                    // vo.setValue1(wc.getSpeed());// 风速
+                    // vo.setValue2(wc.getActualpower());// 实际拟合功率
+                    // vo.setValue3(wc.getOptimalpower());// 最优拟合功率
+                    vos2.add(ds);
+                }
+            }
+
+            result.put("line", vos2);
+
+            result.put("scatter", vos);
+
+
+        }
+        if (null != result) {
+            return AjaxResult.successData(AjaxStatus.success.code, result);
+        } else {
+            return AjaxResult.successData(AjaxStatus.success.code, result);
+        }
+
+    }
+
+}

+ 55 - 0
web/health-hb/src/main/java/com/gyee/frame/controller/health/WindTurbineHealthListController.java

@@ -0,0 +1,55 @@
+package com.gyee.frame.controller.health;
+
+import com.gyee.frame.common.conf.AjaxStatus;
+import com.gyee.frame.common.domain.AjaxResult;
+import com.gyee.frame.model.custom.HealthmodelrecordsVo;
+import com.gyee.frame.service.health.WindTurbineHealthListService;
+import com.gyee.frame.util.StringUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+
+@Controller
+@RequestMapping("/wtHealthList")
+@Api(value = "风机健康列表" ,tags =  "风机健康列表")
+public class WindTurbineHealthListController {
+
+    @Resource
+    private WindTurbineHealthListService windTurbineHealthListService;
+
+    /**风机健康列表**/
+    @GetMapping("/windTurbineHealthList")
+    @ResponseBody
+    @ApiOperation(value = "风机健康列表", notes = "风机健康列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult windTurbineHealthList(String wpId) throws Exception {
+
+        List<HealthmodelrecordsVo> vos = new ArrayList<HealthmodelrecordsVo>();
+        if (StringUtils.notEmp(wpId))
+        {
+            vos=windTurbineHealthListService.windTurbineHealthList(wpId);
+        }
+
+        if (null!=vos) {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        }
+
+    }
+
+
+
+}

+ 520 - 0
web/health-hb/src/main/java/com/gyee/frame/controller/recommen/RecommenController.java

@@ -0,0 +1,520 @@
+package com.gyee.frame.controller.recommen;
+
+import com.gyee.frame.common.conf.AjaxStatus;
+import com.gyee.frame.common.domain.AjaxResult;
+import com.gyee.frame.model.auto.Recommenmain;
+import com.gyee.frame.model.custom.*;
+import com.gyee.frame.service.recommen.RecommenService;
+import com.gyee.frame.util.DateUtils;
+import com.gyee.frame.util.StringUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.annotation.Resource;
+import java.util.*;
+
+@Controller
+@RequestMapping("/recommen")
+@Api(value = "健康风机推荐",tags =  "健康风机推荐")
+public class RecommenController {
+
+    @Resource
+    private RecommenService recommenService;
+
+    /**
+     * 获得当日健康推荐检修风机
+     * @return
+     */
+    @GetMapping("/getRecommenmainDay1")
+    @ResponseBody
+    @ApiOperation(value = "获得当日健康推荐检修风机", notes = "获得当日健康推荐检修风机")
+     public AjaxResult getRecommenmainDay1() {
+
+        List<Recommenmain> vos=new ArrayList<>();
+
+        vos=recommenService.getRecommenmainDay1();
+
+        if (null!=vos) {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        }
+    }
+
+    /**
+     * 获得3日健康推荐检修风机
+     * @return
+     */
+    @GetMapping("/getRecommenmainDay3")
+    @ResponseBody
+    @ApiOperation(value = "获得3日健康推荐检修风机", notes = "获得3日健康推荐检修风机")
+    public AjaxResult getRecommenmainDay3() {
+
+        List<Recommenmain> vos=new ArrayList<>();
+
+        vos=recommenService.getRecommenmainDay3();
+
+        if (null!=vos) {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        }
+    }
+
+    /**
+     * 获得7日健康推荐检修风机
+     * @return
+     */
+    @GetMapping("/getRecommenmainDay7")
+    @ResponseBody
+    @ApiOperation(value = "获得7日健康推荐检修风机", notes = "获得7日健康推荐检修风机")
+    public AjaxResult getRecommenmainDay7() {
+
+        List<Recommenmain> vos=new ArrayList<>();
+
+        vos=recommenService.getRecommenmainDay7();
+
+        if (null!=vos) {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        }
+    }
+
+    /**
+     * 确认推荐检修风机,并添加记录到生产系统
+     * @param rid
+     */
+    @PostMapping("/confirpush")
+    @ResponseBody
+    @ApiOperation(value = "确认推荐检修风机,并添加记录到生产系统", notes = "确认推荐检修风机,并添加记录到生产系统")
+    @ApiImplicitParams({
+
+            @ApiImplicitParam(name = "rid", value = "推荐记录编号", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult confirpush(String rid)
+    {
+        int result=0;
+        if(StringUtils.notEmp(rid))
+        {
+            result= recommenService.confirpush(rid);
+        }
+
+        return AjaxResult.successData(AjaxStatus.success.code, result);
+    }
+
+    /**
+     * 全部确认不同时间段的推荐检修风机
+     * @param typeid 1代表全部确认当日推荐  2 代表全部确认三天推荐 3 代表全部确认未来七天推荐
+     */
+    @PostMapping("/confirpushAll")
+    @ResponseBody
+    @ApiOperation(value = "全部确认不同时间段的推荐检修风机", notes = "全部确认不同时间段的推荐检修风机")
+    @ApiImplicitParams({
+
+            @ApiImplicitParam(name = "typeid", value = "类型编号 1代表全部确认当日推荐  2 代表全部确认三天推荐 3 代表全部确认未来七天推荐", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult confirpushAll(String typeid)
+    {
+
+        List<Recommenmain> vos=new ArrayList<>();
+
+        if (StringUtils.notEmp(typeid)) {
+            switch(typeid) {
+                case "1":
+                    vos=recommenService.getRecommenmainDay1();
+                    if(!vos.isEmpty())
+                    {
+                        for(Recommenmain vo:vos)
+                        {
+                            recommenService.confirpush(vo.getRid());
+                        }
+                    }
+                    break;
+                case "2":
+                    vos=recommenService.getRecommenmainDay3();
+                    if(!vos.isEmpty())
+                    {
+                        for(Recommenmain vo:vos)
+                        {
+                            recommenService.confirpush(vo.getRid());
+                        }
+                    }
+                    break;
+                case "3":
+                    vos=recommenService.getRecommenmainDay7();
+                    if(!vos.isEmpty())
+                    {
+                        for(Recommenmain vo:vos)
+                        {
+                            recommenService.confirpush(vo.getRid());
+                        }
+                    }
+                    break;
+                default:
+                    break;
+            }
+        }
+
+        return AjaxResult.successData(AjaxStatus.success.code, 1);
+    }
+    /**
+     * 取消推荐检修风机
+     * @param rid
+     */
+    @PostMapping("/ignorepush")
+    @ResponseBody
+    @ApiOperation(value = "取消推荐检修风机", notes = "取消推荐检修风机")
+    @ApiImplicitParams({
+
+            @ApiImplicitParam(name = "rid", value = "推荐记录编号", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult ignorepush(String rid)
+    {
+        int result=0;
+        if(StringUtils.notEmp(rid))
+        {
+            result= recommenService.ignorepush(rid);
+        }
+
+        return AjaxResult.successData(AjaxStatus.success.code, result);
+    }
+
+    /**
+     * 全部取消不同时间段的推荐检修风机
+     * @param typeid 1代表全部取消当日推荐  2 代表全部取消三天推荐 3 代表全部取消未来七天推荐
+     */
+    @PostMapping("/ignorepushAll")
+    @ResponseBody
+    @ApiOperation(value = "全部取消不同时间段的推荐检修风机", notes = "全部取消不同时间段的推荐检修风机")
+    @ApiImplicitParams({
+
+            @ApiImplicitParam(name = "typeid", value = "类型编号 1代表全部取消当日推荐  2 代表全部取消三天推荐 3 代表全部取消未来七天推荐", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult ignorepushAll(String typeid)
+    {
+
+        List<Recommenmain> vos=new ArrayList<>();
+
+        if (StringUtils.notEmp(typeid)) {
+            switch(typeid) {
+                case "1":
+                    vos=recommenService.getRecommenmainDay1();
+                    if(!vos.isEmpty())
+                    {
+                        for(Recommenmain vo:vos)
+                        {
+                            recommenService.ignorepush(vo.getRid());
+                        }
+                    }
+                    break;
+                case "2":
+                    vos=recommenService.getRecommenmainDay3();
+                    if(!vos.isEmpty())
+                    {
+                        for(Recommenmain vo:vos)
+                        {
+                            recommenService.ignorepush(vo.getRid());
+                        }
+                    }
+                    break;
+                case "3":
+                    vos=recommenService.getRecommenmainDay7();
+                    if(!vos.isEmpty())
+                    {
+                        for(Recommenmain vo:vos)
+                        {
+                            recommenService.ignorepush(vo.getRid());
+                        }
+                    }
+                    break;
+                default:
+                    break;
+            }
+        }
+
+        return AjaxResult.successData(AjaxStatus.success.code, 1);
+    }
+
+    /**
+     * 获得已经确认检修风机
+     * @return
+     */
+    @GetMapping("/recommenConfirmedList")
+    @ResponseBody
+    @ApiOperation(value = "获得已经确认检修风机", notes = "获得已经确认检修风机")
+
+    public AjaxResult recommenConfirmedList() {
+
+        List<Recommenmain> vos=new ArrayList<>();
+
+        vos=recommenService.recommenConfirmedList();
+
+        if (null!=vos) {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        }
+
+
+    }
+
+    /**
+     * 获得健康状态预测
+     * @param wpId
+     * @param type 1 表示24小时健康趋势,2 表示七天健康趋势 3 表示30天健康趋势,
+     * @return map.put(" yslchart ", yslchart); //优数量
+     *             map.put("lslchart", lslchart);//良数量
+     *             map.put("cslchart", cslchart);//差数量
+     *             map.put("lvchart", lvchart);//健康率
+     *             map.put("datechart", datechart);//日期
+     * @throws Exception
+     */
+    @GetMapping("/findAllChartjz")
+    @ResponseBody
+    @ApiOperation(value = "获得健康状态预测", notes = "获得健康状态预测")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "type", value = "类型编号 1 表示24小时健康趋势,2 表示七天健康趋势 3 表示30天健康趋势", required = true, dataType = "string", paramType = "query")})
+
+    public AjaxResult findAllChartjz(String wpId,  String type) throws Exception {
+
+        Map<String, Object[]> map = new HashMap<String, Object[]>();
+
+        if (StringUtils.notEmp(wpId) && StringUtils.notEmp(type) ) {
+
+            map=recommenService.findAllChartjz(wpId, type);
+
+        }
+        if (null!=map) {
+            return AjaxResult.successData(AjaxStatus.success.code, map);
+        } else {
+            return AjaxResult.successData(AjaxStatus.success.code, map);
+        }
+
+    }
+
+
+    /**
+     * 通过消缺单获得详细信息
+     * @param rid
+     * @return
+     */
+    @GetMapping("/findMainTrack")
+    @ResponseBody
+    @ApiOperation(value = "通过消缺单获得详细信息", notes = "通过消缺单获得详细信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "rid", value = "推荐检修编号", required = true, dataType = "string", paramType = "query")
+        })
+
+    public AjaxResult findMainTrack(String rid) {
+
+        MainTrackVo vo = new MainTrackVo();
+
+        if(StringUtils.notEmp(rid))
+        {
+            vo =recommenService.findMainTrack(rid);
+        }
+
+        return AjaxResult.successData(AjaxStatus.success.code, vo);
+
+    }
+
+    /**
+     * 获得未完成消缺单列表
+     * @return
+     */
+    @GetMapping("/unfinishedList")
+    @ResponseBody
+    @ApiOperation(value = "获得未完成消缺单列表", notes = "获得未完成消缺单列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wpId", value = "风场编号", required = false, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "wtId", value = "风机编号", required = false, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "beginDate", value = "开始日期", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "endDate", value = "结束日期", required = true, dataType = "string", paramType = "query")
+    })
+
+    public AjaxResult unfinishedList(String wpId, String wtId, String beginDate, String endDate) {
+
+        List<WoBugEqVo> vos=new ArrayList<>();
+
+        if(StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate))
+        {
+            vos=recommenService.unfinishedList(wpId,wtId, DateUtils.parseDate(beginDate),DateUtils.parseDate(endDate));
+        }
+
+        if (null!=vos) {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        }
+
+    }
+    /**
+     * 获得完成消缺单列表
+     * @return
+     */
+    @GetMapping("/finishedList")
+    @ResponseBody
+    @ApiOperation(value = "获得完成消缺单列表", notes = "获得完成消缺单列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wpId", value = "风场编号", required = false, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "wtId", value = "风机编号", required = false, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "beginDate", value = "开始日期", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "endDate", value = "结束日期", required = true, dataType = "string", paramType = "query")
+    })
+
+    public AjaxResult finishedList(String wpId, String wtId, String beginDate, String endDate) {
+
+        List<WoBugEqVo> vos=new ArrayList<>();
+
+        if(StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate))
+        {
+            vos=recommenService.finishedList(wpId,wtId, DateUtils.parseDate(beginDate),DateUtils.parseDate(endDate) );
+        }
+
+        if (null!=vos) {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        }
+
+    }
+
+
+    /**
+     * 通过用户姓名和开始检修时间和结束检修时间获取手环实时和历史数据
+     * @param name
+     * @param beginDate
+     * @param endDate
+     * @return
+     * @throws Exception
+     */
+    @GetMapping("/findShbraceletList")
+    @ResponseBody
+    @ApiOperation(value = "通过用户姓名和开始检修时间和结束检修时间获取手环实时和历史数据", notes = "通过用户姓名和开始检修时间和结束检修时间获取手环实时和历史数据")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "name", value = "名称", required = false, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "beginDate", value = "开始日期", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "endDate", value = "结束日期", required = true, dataType = "string", paramType = "query")
+    })
+
+    public AjaxResult findShbraceletList(String name,String beginDate,String endDate) throws Exception {
+
+        Map<String,Map<String,Object>> result=new HashMap<>();
+
+        if(StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate))
+        {
+            result=recommenService.findShbraceletList(name,beginDate,endDate);
+        }
+
+        if (null!=result) {
+            return AjaxResult.successData(AjaxStatus.success.code, result);
+        } else {
+            return AjaxResult.successData(AjaxStatus.success.code, result);
+        }
+
+    }
+
+
+    /**
+     * 获取部件结构树
+     * @return
+     */
+    @GetMapping("/findLocationTreeByWtId")
+    @ResponseBody
+    @ApiOperation(value = "获取部件结构树", notes = "获取部件结构树")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wtId", value = "风机编号", required = false, dataType = "string", paramType = "query")
+    })
+
+    public AjaxResult findLocationTreeByWtId(String wtId) throws Exception {
+
+        List<ElementNode> vos=new ArrayList<>();
+
+        if(StringUtils.notEmp(wtId))
+        {
+
+            vos=recommenService.findLocationTreeByWtId(wtId);
+        }
+
+        return AjaxResult.successData(AjaxStatus.success.code, vos);
+
+    }
+
+    /**
+     * 通过位置编号获得缺陷单信息
+     * @return
+     */
+    @PostMapping("/findWobugeqByLocation")
+    @ResponseBody
+    @ApiOperation(value = "通过位置编号获得缺陷单信息", notes = "通过位置编号获得缺陷单信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "tablepar", value = "分页对象1", required = false, dataType = "Tablepar", paramType = "query"),
+            @ApiImplicitParam(name = "location", value = "位置", required = true, dataType = "string", paramType = "query")
+    })
+    public AjaxResult findWobugeqByLocation(Tablepar tablepar, String location) throws Exception {
+
+        List<WoBugVo> vos=new ArrayList<>();
+
+        if(StringUtils.notEmp(tablepar) && StringUtils.notEmp(location))
+        {
+            Calendar c = Calendar.getInstance();
+
+            c.set(Calendar.HOUR_OF_DAY, 0);
+            c.set(Calendar.MINUTE, 0);
+            c.set(Calendar.SECOND, 0);
+            c.set(Calendar.MILLISECOND,0);
+
+            c.set(Calendar.DAY_OF_YEAR, c.getActualMinimum(Calendar.DAY_OF_YEAR));
+            Date beginDate = DateUtils.truncate(c.getTime());
+            c.set(Calendar.DAY_OF_YEAR, c.getActualMaximum(Calendar.DAY_OF_YEAR));
+            Date endDate = DateUtils.truncate(c.getTime());
+            vos=recommenService.findWobugeqByLocation(tablepar,location, beginDate, endDate);
+        }
+
+        if (null!=vos) {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        }
+
+    }
+
+
+    /**
+     * 获得对应风机的1个月健康推荐检修记录
+     * @return
+     */
+    @GetMapping("/getRecommenmainMonth")
+    @ResponseBody
+    @ApiOperation(value = "获得对应风机的1个月健康推荐检修记录", notes = "获得对应风机的1个月健康推荐检修记录")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
+    })
+
+    public AjaxResult getRecommenmainMonth(String wtId) throws Exception {
+
+        List<Recommenmain> result=new ArrayList<>();
+
+        if(StringUtils.notEmp(wtId))
+        {
+
+            result=recommenService.getRecommenmainMonth(wtId);
+        }
+
+        if (null!=result) {
+            return AjaxResult.successData(AjaxStatus.success.code, result);
+        } else {
+            return AjaxResult.successData(AjaxStatus.success.code, result);
+        }
+
+    }
+}

+ 20 - 0
web/health-hb/src/main/java/com/gyee/frame/mapper/FanStatusQueryExportMapper/FanStatusQueryExportMapper.java

@@ -0,0 +1,20 @@
+package com.gyee.frame.mapper.FanStatusQueryExportMapper;
+
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.springframework.stereotype.Repository;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Repository
+public interface FanStatusQueryExportMapper {
+    //获取风机Name
+    @Select("select id,name from windturbine where windpowerstationid ='${windpowerstationid}'")
+    List<Map<String, Object>> getFanName(@Param("windpowerstationid") String windpowerstationid);
+
+    @Select("select windturbineid,statusdesc,starttime,speed,stoptime from windturbinestatus where windturbineid='${windturbineid}' and satuscode='${satuscode}' and stoptime >= TO_DATE ('${starttime} ',' yyyy-MM-dd ') and stoptime <= TO_DATE ('${stoptime} ',' yyyy-MM-dd ')")
+    List<Map<String, Object>> getFjStatus(@Param("windturbineid") String windturbineid, @Param("satuscode") String satuscode,@Param("starttime")String starttime,@Param("stoptime") String stoptime);
+
+}

+ 35 - 0
web/health-hb/src/main/java/com/gyee/frame/mapper/StandardPointTableMapper/StandardPointTableMapper.java

@@ -0,0 +1,35 @@
+package com.gyee.frame.mapper.StandardPointTableMapper;
+
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+@Repository
+public interface StandardPointTableMapper {
+
+    //所有表名
+    @Select("select table_name from user_tables")
+    List<String> getTableName();
+
+    //指定表字段
+    @Select( "SELECT column_name FROM user_tab_columns where table_name = upper('${tableName}') ")
+    List<String> getAllColumns(@Param("tableName") String tableName);
+
+    //根据指定列查询出数据
+    @Select( "SELECT ${columnsName} FROM ${tableName}")
+    List<Map<String, Object>> getDataByColumns(@Param("tableName") String tableName, @Param("columnsName") String columnsName);
+
+    //存到数据库
+//    @Select("insert into ${tableName}\n" +
+//            "    <foreach item=\"value\" collection=\"unionData\" index=\"key\" open=\"(\"   separator=\",\" close=\")\">\n" +
+//            "      ${key}\n" +
+//            "    </foreach>\n" +
+//            "    values\n" +
+//            "    <foreach item=\"value\" collection=\"unionData\" index=\"key\"  open=\"(\"   separator=\",\" close=\")\">\n" +
+//            "      #{value}\n" +
+//            "    </foreach>")
+    void saveData(@Param("unionData") Map<String, Object> unionData,@Param("tableName") String tableName);
+}

+ 97 - 0
web/health-hb/src/main/java/com/gyee/frame/mapper/auto/ActivePowerDataMapper.java

@@ -0,0 +1,97 @@
+package com.gyee.frame.mapper.auto;
+
+import com.gyee.frame.model.auto.ActivePowerData;
+import com.gyee.frame.model.auto.ActivePowerDataExample;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface ActivePowerDataMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table activepowerdata
+     *
+     * @mbg.generated
+     */
+    long countByExample(ActivePowerDataExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table activepowerdata
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(ActivePowerDataExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table activepowerdata
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table activepowerdata
+     *
+     * @mbg.generated
+     */
+    int insert(ActivePowerData record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table activepowerdata
+     *
+     * @mbg.generated
+     */
+    int insertSelective(ActivePowerData record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table activepowerdata
+     *
+     * @mbg.generated
+     */
+    List<ActivePowerData> selectByExample(ActivePowerDataExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table activepowerdata
+     *
+     * @mbg.generated
+     */
+    ActivePowerData selectByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table activepowerdata
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") ActivePowerData record, @Param("example") ActivePowerDataExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table activepowerdata
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") ActivePowerData record, @Param("example") ActivePowerDataExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table activepowerdata
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(ActivePowerData record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table activepowerdata
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(ActivePowerData record);
+}

+ 64 - 0
web/health-hb/src/main/java/com/gyee/frame/mapper/auto/AlarmcountMapper.java

@@ -0,0 +1,64 @@
+package com.gyee.frame.mapper.auto;
+
+import com.gyee.frame.model.auto.Alarmcount;
+import com.gyee.frame.model.auto.AlarmcountExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface AlarmcountMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALARMCOUNT
+     *
+     * @mbg.generated
+     */
+    long countByExample(AlarmcountExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALARMCOUNT
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(AlarmcountExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALARMCOUNT
+     *
+     * @mbg.generated
+     */
+    int insert(Alarmcount record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALARMCOUNT
+     *
+     * @mbg.generated
+     */
+    int insertSelective(Alarmcount record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALARMCOUNT
+     *
+     * @mbg.generated
+     */
+    List<Alarmcount> selectByExample(AlarmcountExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALARMCOUNT
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") Alarmcount record, @Param("example") AlarmcountExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALARMCOUNT
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") Alarmcount record, @Param("example") AlarmcountExample example);
+}

+ 105 - 0
web/health-hb/src/main/java/com/gyee/frame/mapper/auto/AlarmsnapMapper.java

@@ -0,0 +1,105 @@
+package com.gyee.frame.mapper.auto;
+
+import com.gyee.frame.model.auto.Alarmsnap;
+import com.gyee.frame.model.auto.AlarmsnapExample;
+import com.gyee.frame.model.custom.TotalNumVo;
+import com.gyee.frame.model.custom.TotalNumsVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface AlarmsnapMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALARMSNAP
+     *
+     * @mbg.generated
+     */
+    long countByExample(AlarmsnapExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALARMSNAP
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(AlarmsnapExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALARMSNAP
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALARMSNAP
+     *
+     * @mbg.generated
+     */
+    int insert(Alarmsnap record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALARMSNAP
+     *
+     * @mbg.generated
+     */
+    int insertSelective(Alarmsnap record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALARMSNAP
+     *
+     * @mbg.generated
+     */
+    List<Alarmsnap> selectByExample(AlarmsnapExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALARMSNAP
+     *
+     * @mbg.generated
+     */
+    Alarmsnap selectByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALARMSNAP
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") Alarmsnap record, @Param("example") AlarmsnapExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALARMSNAP
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") Alarmsnap record, @Param("example") AlarmsnapExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALARMSNAP
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(Alarmsnap record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALARMSNAP
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(Alarmsnap record);
+
+    List<TotalNumsVo> getAlarmhistoryList(@Param("tname") String tname, @Param("beginDate") String beginDate, @Param("endDate") String endDate);
+
+    List<TotalNumVo> findAlertrulefailuresubMap();
+
+
+}

+ 104 - 0
web/health-hb/src/main/java/com/gyee/frame/mapper/auto/Alertrule2Mapper.java

@@ -0,0 +1,104 @@
+package com.gyee.frame.mapper.auto;
+
+import com.gyee.frame.model.auto.Alertrule2;
+import com.gyee.frame.model.auto.Alertrule2Example;
+import com.gyee.frame.model.custom.AlarmTotalVo;
+import com.gyee.frame.model.custom.SimpleVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface Alertrule2Mapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALERTRULE2
+     *
+     * @mbg.generated
+     */
+    long countByExample(Alertrule2Example example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALERTRULE2
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(Alertrule2Example example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALERTRULE2
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(String id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALERTRULE2
+     *
+     * @mbg.generated
+     */
+    int insert(Alertrule2 record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALERTRULE2
+     *
+     * @mbg.generated
+     */
+    int insertSelective(Alertrule2 record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALERTRULE2
+     *
+     * @mbg.generated
+     */
+    List<Alertrule2> selectByExample(Alertrule2Example example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALERTRULE2
+     *
+     * @mbg.generated
+     */
+    Alertrule2 selectByPrimaryKey(String id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALERTRULE2
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") Alertrule2 record, @Param("example") Alertrule2Example example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALERTRULE2
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") Alertrule2 record, @Param("example") Alertrule2Example example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALERTRULE2
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(Alertrule2 record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALERTRULE2
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(Alertrule2 record);
+
+    List<AlarmTotalVo> getAlarmTotal(@Param("wtId") String wtId, @Param("beginDate") String beginDate, @Param("endDate") String endDate);
+    List<SimpleVo> getAlarmTypenum();
+
+
+}

+ 96 - 0
web/health-hb/src/main/java/com/gyee/frame/mapper/auto/AlertrulefailureMapper.java

@@ -0,0 +1,96 @@
+package com.gyee.frame.mapper.auto;
+
+import com.gyee.frame.model.auto.Alertrulefailure;
+import com.gyee.frame.model.auto.AlertrulefailureExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface AlertrulefailureMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALERTRULEFAILURE
+     *
+     * @mbg.generated
+     */
+    long countByExample(AlertrulefailureExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALERTRULEFAILURE
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(AlertrulefailureExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALERTRULEFAILURE
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(String id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALERTRULEFAILURE
+     *
+     * @mbg.generated
+     */
+    int insert(Alertrulefailure record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALERTRULEFAILURE
+     *
+     * @mbg.generated
+     */
+    int insertSelective(Alertrulefailure record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALERTRULEFAILURE
+     *
+     * @mbg.generated
+     */
+    List<Alertrulefailure> selectByExample(AlertrulefailureExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALERTRULEFAILURE
+     *
+     * @mbg.generated
+     */
+    Alertrulefailure selectByPrimaryKey(String id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALERTRULEFAILURE
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") Alertrulefailure record, @Param("example") AlertrulefailureExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALERTRULEFAILURE
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") Alertrulefailure record, @Param("example") AlertrulefailureExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALERTRULEFAILURE
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(Alertrulefailure record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ALERTRULEFAILURE
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(Alertrulefailure record);
+}

+ 106 - 0
web/health-hb/src/main/java/com/gyee/frame/mapper/auto/AnalysissubtablebottomMapper.java

@@ -0,0 +1,106 @@
+package com.gyee.frame.mapper.auto;
+
+import com.gyee.frame.model.auto.Analysissubtablebottom;
+import com.gyee.frame.model.auto.AnalysissubtablebottomExample;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.ibatis.annotations.Param;
+
+public interface AnalysissubtablebottomMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ANALYSISSUBTABLEBOTTOM
+     *
+     * @mbg.generated
+     */
+    long countByExample(AnalysissubtablebottomExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ANALYSISSUBTABLEBOTTOM
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(AnalysissubtablebottomExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ANALYSISSUBTABLEBOTTOM
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(Short id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ANALYSISSUBTABLEBOTTOM
+     *
+     * @mbg.generated
+     */
+    int insert(Analysissubtablebottom record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ANALYSISSUBTABLEBOTTOM
+     *
+     * @mbg.generated
+     */
+    int insertSelective(Analysissubtablebottom record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ANALYSISSUBTABLEBOTTOM
+     *
+     * @mbg.generated
+     */
+    List<Analysissubtablebottom> selectByExample(AnalysissubtablebottomExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ANALYSISSUBTABLEBOTTOM
+     *
+     * @mbg.generated
+     */
+    Analysissubtablebottom selectByPrimaryKey(Short id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ANALYSISSUBTABLEBOTTOM
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") Analysissubtablebottom record, @Param("example") AnalysissubtablebottomExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ANALYSISSUBTABLEBOTTOM
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") Analysissubtablebottom record, @Param("example") AnalysissubtablebottomExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ANALYSISSUBTABLEBOTTOM
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(Analysissubtablebottom record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table ANALYSISSUBTABLEBOTTOM
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(Analysissubtablebottom record);
+
+    /**
+     * 更具时间获取日上网电量
+     * @return
+     */
+    List<Map> selectByRecorddateGrop(@Param("startTs")String startTs, @Param("endTs")String endTs, @Param("wpid")String wpid,@Param("point")String [] point);
+}

+ 97 - 0
web/health-hb/src/main/java/com/gyee/frame/mapper/auto/Brownoutsevent2Mapper.java

@@ -0,0 +1,97 @@
+package com.gyee.frame.mapper.auto;
+
+import com.gyee.frame.model.auto.Brownoutsevent2;
+import com.gyee.frame.model.auto.Brownoutsevent2Example;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface Brownoutsevent2Mapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table brownoutsevent2
+     *
+     * @mbg.generated
+     */
+    long countByExample(Brownoutsevent2Example example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table brownoutsevent2
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(Brownoutsevent2Example example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table brownoutsevent2
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(String id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table brownoutsevent2
+     *
+     * @mbg.generated
+     */
+    int insert(Brownoutsevent2 record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table brownoutsevent2
+     *
+     * @mbg.generated
+     */
+    int insertSelective(Brownoutsevent2 record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table brownoutsevent2
+     *
+     * @mbg.generated
+     */
+    List<Brownoutsevent2> selectByExample(Brownoutsevent2Example example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table brownoutsevent2
+     *
+     * @mbg.generated
+     */
+    Brownoutsevent2 selectByPrimaryKey(String id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table brownoutsevent2
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") Brownoutsevent2 record, @Param("example") Brownoutsevent2Example example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table brownoutsevent2
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") Brownoutsevent2 record, @Param("example") Brownoutsevent2Example example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table brownoutsevent2
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(Brownoutsevent2 record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table brownoutsevent2
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(Brownoutsevent2 record);
+}

+ 0 - 0
web/health-hb/src/main/java/com/gyee/frame/mapper/auto/CompanysMapper.java


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.