Sfoglia il codice sorgente

新增报警模块

shilin 3 anni fa
parent
commit
2bf0f7ec5c
100 ha cambiato i file con 6029 aggiunte e 0 eliminazioni
  1. 2 0
      web/alarm-hb/alarm-hb.iml
  2. 206 0
      web/alarm-hb/pom.xml
  3. 22 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/Bootstrap.java
  4. 265 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/RSA/RSAService.java
  5. 79 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/cache/AlarmInfoCache.java
  6. 119 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/config/AjaxResult.java
  7. 37 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/config/ConfigProperties.java
  8. 32 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/config/InterceptorConfig.java
  9. 45 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/config/MyWebAppConfigurer.java
  10. 30 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/config/MybatisPlusConfig.java
  11. 495 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/AlarmCountController.java
  12. 105 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/AlarmHistoryController.java
  13. 151 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/AlarmSnapController.java
  14. 299 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/AlarmUserController.java
  15. 45 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/AlertKnowledgeController.java
  16. 161 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/Alertrule2Controller.java
  17. 283 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/DeviceController.java
  18. 89 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/DeviceFaultModeController.java
  19. 27 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/EquipmentmodelController.java
  20. 196 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/FaultInfoController.java
  21. 64 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/FaultSnapController.java
  22. 24 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/FaultStatisticWindturbineContrller.java
  23. 200 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/InfoController.java
  24. 125 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/ScadabjController.java
  25. 43 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/ScadafaultController.java
  26. 68 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/ShutdownEventController.java
  27. 36 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/StopTypeController.java
  28. 120 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/Warning2Controller.java
  29. 37 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/WindpowerstationController.java
  30. 24 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/AlarmCount.java
  31. 26 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/AlarmHistory.java
  32. 18 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/AlarmInformation.java
  33. 75 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/AlarmSnap.java
  34. 25 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/AlarmStat.java
  35. 26 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/AlarmStat1.java
  36. 19 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/AlarmStatLine.java
  37. 37 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/AlarmUser.java
  38. 33 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/AlertKnowledge.java
  39. 58 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/Alertrule2.java
  40. 23 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/Datadictionary.java
  41. 25 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/Device.java
  42. 39 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/DeviceFaultMode.java
  43. 27 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/DeviceFaultModeMetrics.java
  44. 70 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/DeviceMetrics.java
  45. 38 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/DeviceModel.java
  46. 33 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/DeviceModelMetrics.java
  47. 33 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/DeviceStructure.java
  48. 27 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/ElectricalTestingPointAI.java
  49. 24 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/ElectricalTestingPointDI.java
  50. 37 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/Equipmentmodel.java
  51. 38 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/FaultHistory.java
  52. 103 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/FaultInfo.java
  53. 62 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/FaultSnap.java
  54. 91 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/FaultStatisticWindturbine.java
  55. 21 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/FaultWarning.java
  56. 52 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/FeatureStat.java
  57. 55 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/MainBrownouts2.java
  58. 42 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/Scadabj.java
  59. 35 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/Scadafault.java
  60. 58 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/ShutdownEvent.java
  61. 28 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/StopType.java
  62. 20 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/StopTypeCount.java
  63. 40 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/TestingPointAI.java
  64. 39 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/TestingPointDI.java
  65. 54 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/Warning2.java
  66. 22 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/WarningClassify.java
  67. 28 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/WarningType.java
  68. 25 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/Warningrecords.java
  69. 71 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/WindPowerStation.java
  70. 24 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/Windturbine.java
  71. 23 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/WindturbineParts.java
  72. 120 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/filter/LoginInterceptor.java
  73. 94 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/logtool/LogService.java
  74. 56 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/AlarmCountMapper.java
  75. 68 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/AlarmHisotryMapper.java
  76. 63 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/AlarmSnapMapper.java
  77. 26 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/AlarmUserMapper.java
  78. 18 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/AlertKnowledgeMapper.java
  79. 39 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/Alertrule2Mapper.java
  80. 16 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/DatadictionaryMapper.java
  81. 33 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/DeviceFaultModeMapper.java
  82. 17 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/DeviceMapper.java
  83. 35 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/DeviceMetricsMapper.java
  84. 22 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/DeviceModelMapper.java
  85. 25 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/DeviceModelMetricsMapper.java
  86. 28 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/DeviceStructureMapper.java
  87. 16 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/ElectricalTestingPointAIMapper.java
  88. 16 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/ElectricalTestingPointDIMapper.java
  89. 12 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/EquipmentmodelMapper.java
  90. 37 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/FaultHisotryMapper.java
  91. 47 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/FaultInfoMapper.java
  92. 33 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/FaultSnapMapper.java
  93. 23 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/FaultStatisticWindturbineMapper.java
  94. 27 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/FeatureStatMapper.java
  95. 17 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/MainBrownoutsMapper.java
  96. 24 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/ScadabjMapper.java
  97. 14 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/ScadafaultMapper.java
  98. 26 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/ShutdownEventMapper.java
  99. 24 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/StopTypeMapper.java
  100. 0 0
      web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/TestingPointAIMapper.java

+ 2 - 0
web/alarm-hb/alarm-hb.iml

@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4" />

+ 206 - 0
web/alarm-hb/pom.xml

@@ -0,0 +1,206 @@
+<?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>alarm-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>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.oracle</groupId>
+            <artifactId>ojdbc6</artifactId>
+            <version>11.2.0.3</version>
+        </dependency>
+
+
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-math3</artifactId>
+            <version>3.6.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>1.1.10</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-aop</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-generator</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.freemarker</groupId>
+            <artifactId>freemarker</artifactId>
+            <version>2.3.28</version>
+        </dependency>
+        <!--mysql-connector-java-->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.microsoft.sqlserver</groupId>
+            <artifactId>sqljdbc4</artifactId>
+            <version>4.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.17</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-configuration-processor</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.gyee</groupId>
+            <artifactId>mr</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>slf4j-log4j12</artifactId>
+                    <groupId>org.slf4j</groupId>
+                </exclusion>
+            </exclusions>
+
+        </dependency>
+        <!-- ********************** plugin ********************** -->
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt</artifactId>
+            <version>0.9.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-websocket</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-undertow</artifactId>
+        </dependency>
+        <!--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>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 22 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/Bootstrap.java

@@ -0,0 +1,22 @@
+package com.gyee.wisdom;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.web.servlet.ServletComponentScan;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+/**
+ * @author northriver
+ */
+@SpringBootApplication
+@ServletComponentScan
+@EnableScheduling
+public class Bootstrap {
+
+    public static void main(String[] args) {
+        SpringApplication.run(Bootstrap.class, args);
+    }
+
+}
+
+

+ 265 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/RSA/RSAService.java

@@ -0,0 +1,265 @@
+package com.gyee.wisdom.alarm.sharding.RSA;
+
+
+import org.springframework.stereotype.Component;
+
+import java.util.Base64;
+
+import javax.crypto.BadPaddingException;
+import javax.crypto.Cipher;
+import javax.crypto.IllegalBlockSizeException;
+import javax.crypto.NoSuchPaddingException;
+import java.security.*;
+import java.security.interfaces.RSAPrivateKey;
+import java.security.interfaces.RSAPublicKey;
+import java.security.spec.InvalidKeySpecException;
+import java.security.spec.PKCS8EncodedKeySpec;
+import java.security.spec.X509EncodedKeySpec;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2020-05-21
+ */
+@Component
+public class RSAService {
+
+    public static Map<PublicKey, PrivateKey> keyMap = new HashMap<>();
+
+    public static final String KEY_ALGORITHM = "RSA";
+    public static final String CIPHER_ALGORITHM = "RSA/ECB/PKCS1Padding";
+    public static final String PUBLIC_KEY = "publicKey";
+    public static final String PRIVATE_KEY = "privateKey";
+    public static final Integer KEY_SIZE = 2048;
+
+    /**
+     * 生成密钥对。注意这里是生成密钥对KeyMap,再由密钥对获取公私钥  方法每运行一次获得一对不同的公钥私钥。
+     *
+     * @return
+     */
+    public static Map<String, byte[]> getKeyMap() {
+        try {
+            //返回生成指定算法的 public/private 密钥对的 KeyPairGenerator 对象。 参数RSA算法
+            KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(KEY_ALGORITHM);
+            //初始化RSA长度,RSA密钥长度必须是64的倍数,在512~65536之间。默认是1024
+            keyPairGenerator.initialize(KEY_SIZE);
+            //生成一个密钥对
+            KeyPair keyPair = keyPairGenerator.generateKeyPair();
+            //获得公钥
+            RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic();
+            //获得私钥
+            RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate();
+
+            Map<String, byte[]> keyMap = new HashMap<String, byte[]>(2);
+            //可以通过getEncoded()方法获取返回类型为byte[]的数组
+            keyMap.put(PUBLIC_KEY, publicKey.getEncoded());
+
+            keyMap.put(PRIVATE_KEY, privateKey.getEncoded());
+            return keyMap;
+        } catch (NoSuchAlgorithmException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+            return null;
+        }
+
+
+    }
+
+    /**
+     * 公钥,X509EncodedKeySpec 用于构建公钥的规范
+     *
+     * @param keyBytes
+     * @return
+     */
+    public static PublicKey restorePublicKey(byte[] keyBytes) {
+        X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec(keyBytes);
+
+        try {
+            KeyFactory factory = KeyFactory.getInstance(KEY_ALGORITHM);
+            PublicKey publicKey = factory.generatePublic(x509EncodedKeySpec);
+            return publicKey;
+        } catch (NoSuchAlgorithmException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (InvalidKeySpecException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    /**
+     * 私钥,PKCS8EncodedKeySpec 用于构建私钥的规范
+     *
+     * @param keyBytes
+     * @return
+     */
+    public static PrivateKey restorePrivateKey(byte[] keyBytes) {
+
+        PKCS8EncodedKeySpec pkcs8EncodedKeySpec = new PKCS8EncodedKeySpec(
+                keyBytes);
+
+        KeyFactory factory;
+        try {
+            factory = KeyFactory.getInstance(KEY_ALGORITHM);
+            PrivateKey privateKey = factory
+                    .generatePrivate(pkcs8EncodedKeySpec);
+            return privateKey;
+        } catch (NoSuchAlgorithmException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (InvalidKeySpecException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+
+
+        return null;
+    }
+
+    /**
+     * 加密
+     *
+     * @param key
+     * @param plainText
+     * @return
+     */
+    public static byte[] encryptionByPublicKey(PublicKey key, byte[] plainText) {
+
+        try {
+            Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);
+            cipher.init(Cipher.ENCRYPT_MODE, key);
+            return cipher.doFinal(plainText);
+        } catch (NoSuchAlgorithmException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (NoSuchPaddingException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (InvalidKeyException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (IllegalBlockSizeException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (BadPaddingException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        return null;
+
+    }
+
+    /**
+     * 解密
+     *
+     * @param key
+     * @param encodedText
+     * @return
+     */
+    public static String decryptByPrivateKey(PrivateKey key, byte[] encodedText) {
+
+        try {
+            Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);
+            cipher.init(Cipher.DECRYPT_MODE, key);
+            return new String(cipher.doFinal(encodedText));
+        } catch (NoSuchAlgorithmException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (NoSuchPaddingException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (InvalidKeyException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (IllegalBlockSizeException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (BadPaddingException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        return null;
+
+    }
+
+    /**
+     * 将String转换为字节数组
+     **/
+    public static byte[] decryptBASE64(String key) throws Exception {
+        return Base64.getDecoder().decode(key);
+    }
+
+    /**
+     * 将字节数组转换为String
+     **/
+    public static String encryptBASE64(byte[] key) throws Exception {
+        return Base64.getEncoder().encodeToString(key);
+    }
+
+    // 将字节转换为十六进制字符串
+    private static String byteToHexString(byte ib) {
+        char[] Digit = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A',
+                'B', 'C', 'D', 'E', 'F'};
+        char[] ob = new char[2];
+        ob[0] = Digit[(ib >>> 4) & 0X0F];
+        ob[1] = Digit[ib & 0X0F];
+        String s = new String(ob);
+        return s;
+    }
+
+    // 将字节数组转换为十六进制字符串
+    private static String byteArrayToHexString(byte[] bytearray) {
+        String strDigest = "";
+        for (int i = 0; i < bytearray.length; i++) {
+            strDigest += byteToHexString(bytearray[i]);
+        }
+        return strDigest;
+    }
+
+    //16进制字符串转为字节数组
+    public static byte[] hexStringToByte(String hex) {
+        int len = (hex.length() / 2);
+        byte[] result = new byte[len];
+        char[] achar = hex.toCharArray();
+        for (int i = 0; i < len; i++) {
+            int pos = i * 2;
+            result[i] = (byte) (toByte(achar[pos]) << 4 | toByte(achar[pos + 1]));
+        }
+
+        return result;
+    }
+
+    public static int toByte(char c) {
+        byte b = (byte) "0123456789ABCDEF".indexOf(c);
+        return b;
+    }
+
+    /**
+     * @param dataStr      需要解密的数据
+     * @param publickeyStr 公钥
+     * @return java.lang.String 解密后的数据json
+     * @description
+     * @author wanghs
+     * @date 2020-05-29
+     */
+    public static String translateByPublicKey(String dataStr, String publickeyStr) {
+
+        String jsonStr = "";
+        try {
+            byte[] dataByte = Base64.getDecoder().decode(dataStr);
+            //根据公钥字符串获取公钥对象
+            PublicKey publicKey = restorePublicKey(decryptBASE64(publickeyStr));
+            //根据公钥获取私钥
+            PrivateKey privateKey = RSAService.keyMap.get(publicKey);
+            jsonStr = RSAService.decryptByPrivateKey(privateKey, dataByte);
+        } catch (Exception ex) {
+            System.out.println(ex.getStackTrace());
+        } finally {
+            return jsonStr;
+        }
+    }
+
+}

+ 79 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/cache/AlarmInfoCache.java

@@ -0,0 +1,79 @@
+package com.gyee.wisdom.alarm.sharding.cache;
+
+import com.gyee.wisdom.alarm.sharding.entity.AlertKnowledge;
+import com.gyee.wisdom.alarm.sharding.entity.Alertrule2;
+import com.gyee.wisdom.alarm.sharding.entity.WindturbineParts;
+import com.gyee.wisdom.alarm.sharding.mapper.AlertKnowledgeMapper;
+import com.gyee.wisdom.alarm.sharding.mapper.Alertrule2Mapper;
+import com.gyee.wisdom.alarm.sharding.mapper.WindturbinePartsMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * @descrition: 报警信息类缓存
+ * @author:Wanghs
+ * @date:2020-06-22
+ */
+@Component
+public class AlarmInfoCache {
+
+    @Autowired
+    private Alertrule2Mapper alertrule2Mapper;
+    @Autowired
+    private WindturbinePartsMapper windturbinePartsMapper;
+    @Autowired
+    private AlertKnowledgeMapper alertKnowledgeMapper;
+
+
+    //key:自定义报警内容(AlertText) ,value:所属部件(relatedParts)
+    private HashMap<String, String> alertTextToPartMap = new HashMap<>();
+
+    private HashMap<String, String> relatePartsMap = new HashMap<>();
+
+    private HashMap<String,AlertKnowledge> knowledgeHashMap=new HashMap<>();
+
+
+    public HashMap<String, String> getAlertTextToPartMap() {
+        if (alertTextToPartMap.size() <= 0) {
+            List<Alertrule2> lst = alertrule2Mapper.getAllByStationIdAndModelId("");
+            this.alertTextToPartMap.clear();
+            for (Alertrule2 data : lst) {
+                if (!alertTextToPartMap.containsKey(data.getName())) {
+                    alertTextToPartMap.put(data.getName(), data.getRelatedParts());
+                }
+            }
+        }
+        return alertTextToPartMap;
+
+    }
+
+    public HashMap<String, String> getRelatePartsMap() {
+        if (relatePartsMap.size() <= 0) {
+
+            List<WindturbineParts> lst = windturbinePartsMapper.selectAllWindturbineParts();
+            for (WindturbineParts parts : lst) {
+                if (!relatePartsMap.containsKey(parts.getPartCode())) {
+                    relatePartsMap.put(parts.getPartCode(), parts.getName());
+                }
+            }
+        }
+        return relatePartsMap;
+    }
+
+    public HashMap<String,AlertKnowledge> getKnowledgeHashMap(){
+        if(knowledgeHashMap.size()<=0){
+            List<AlertKnowledge> lst=alertKnowledgeMapper.searchAll();
+            for (AlertKnowledge data:lst) {
+
+                if(!knowledgeHashMap.containsKey(data.getAlertName().trim())){
+                    knowledgeHashMap.put(data.getAlertName().trim(),data);
+                }
+            }
+        }
+
+        return  knowledgeHashMap;
+    }
+}

+ 119 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/config/AjaxResult.java

@@ -0,0 +1,119 @@
+package com.gyee.wisdom.alarm.sharding.config;
+
+import java.util.HashMap;
+import java.util.List;
+
+/**
+* @ClassName: AjaxResult
+* @Description: TODO(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(Object value){
+        AjaxResult json = new AjaxResult();
+        json.put("code", 200);
+        json.put("data", value);
+        return json;
+    }
+
+    public static AjaxResult successData(int code, Object value){
+        AjaxResult json = new AjaxResult();
+        json.put("code", code);
+        json.put("data", value);
+        return json;
+    }
+
+    public static <T> AjaxResult successData(List<Entry<String, List<T>>> list) {
+        AjaxResult json = new AjaxResult();
+        json.put("code", 200);
+        json.put("data", list);
+        return json;
+    }
+
+
+    /**
+     * 返回成功消息
+     *
+     * @param key 键值
+     * @param value 内容
+     * @return 成功消息
+     */
+    @Override
+    public AjaxResult put(String key, Object value)
+    {
+        super.put(key, value);
+        return this;
+    }
+}

+ 37 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/config/ConfigProperties.java

@@ -0,0 +1,37 @@
+package com.gyee.wisdom.alarm.sharding.config;
+
+
+import com.gyee.wisdom.alarm.sharding.util.DateUtil;
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+@Data
+@Component
+@ConfigurationProperties("sharding.config")
+public class ConfigProperties {
+
+    //分表开始时间
+    private String startDate;
+
+    private Date setupDate;
+
+    public Date getSetupDate() {
+
+        if (setupDate != null)
+            return setupDate;
+
+        else {
+            try {
+                setupDate = DateUtil.parseDate(startDate);
+            } catch (Exception ex) {
+                setupDate = new Date(2018, 8, 1);
+            }
+            return setupDate;
+        }
+
+
+    }
+}

+ 32 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/config/InterceptorConfig.java

@@ -0,0 +1,32 @@
+package com.gyee.wisdom.alarm.sharding.config;
+
+import com.gyee.wisdom.alarm.sharding.filter.LoginInterceptor;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2020-05-21
+ */
+@Configuration
+public class InterceptorConfig  implements  WebMvcConfigurer {
+
+    @Bean
+    LoginInterceptor loginInterceptor() {
+        return new LoginInterceptor();
+    }
+
+    /**
+     * @Function: 配置生成器:添加一个拦截器,拦截路径为login以后的路径
+     * @author:   YangXueFeng
+     * @Date:     2019/4/14 13:10
+     */
+    @Override
+    public void addInterceptors(InterceptorRegistry registry ) {
+        registry.addInterceptor(loginInterceptor()).addPathPatterns("/**").excludePathPatterns("/login", "/register", "/static");
+
+    }
+}

+ 45 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/config/MyWebAppConfigurer.java

@@ -0,0 +1,45 @@
+package com.gyee.wisdom.alarm.sharding.config;
+
+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  implements  WebMvcConfigurer  {
+	
+	private static Logger logger=LoggerFactory.getLogger(WebMvcConfigurationSupport.class);
+
+	
+	
+	/** 解决跨域问题 **/
+	@Override
+	public void addCorsMappings(CorsRegistry registry){
+
+        registry.addMapping("/**")
+			// 设置允许跨域请求的域名
+			.allowedOrigins("*")
+			// 是否允许证书
+			.allowCredentials(true)
+			// 设置允许的方法
+			.allowedMethods("GET", "POST", "DELETE", "PUT")
+			// 设置允许的header属性
+			.allowedHeaders("*")
+				// 跨域允许时间
+			.maxAge(3600);
+			//super.addCorsMappings(registry);
+
+	}
+	
+
+	
+	
+	
+}

+ 30 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/config/MybatisPlusConfig.java

@@ -0,0 +1,30 @@
+package com.gyee.wisdom.alarm.sharding.config;
+
+import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
+import com.baomidou.mybatisplus.core.injector.ISqlInjector;
+import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+
+@Configuration
+public class MybatisPlusConfig {
+
+    /*
+     * 分页插件,自动识别数据库类型
+     * 多租户,请参考官网【插件扩展】
+     */
+    @Bean
+    public PaginationInterceptor paginationInterceptor() {
+        PaginationInterceptor pi =  new PaginationInterceptor();
+        pi.setLimit(10000L);
+        return pi;
+    }
+
+    @Bean
+    public ISqlInjector sqlInjector() {
+        return new DefaultSqlInjector();
+    }
+
+
+}

File diff suppressed because it is too large
+ 495 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/AlarmCountController.java


+ 105 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/AlarmHistoryController.java

@@ -0,0 +1,105 @@
+package com.gyee.wisdom.alarm.sharding.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gyee.wisdom.alarm.sharding.config.AjaxResult;
+import com.gyee.wisdom.alarm.sharding.entity.AlarmHistory;
+import com.gyee.wisdom.alarm.sharding.entity.AlarmSnap;
+import com.gyee.wisdom.alarm.sharding.model.AlarmHistoryInfo;
+import com.gyee.wisdom.alarm.sharding.service.AlarmHistoryService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.HashMap;
+import java.util.Map;
+
+
+@Slf4j
+@RestController
+@RequestMapping("/alarm")
+@CrossOrigin
+public class AlarmHistoryController {
+
+    @Autowired
+    private AlarmHistoryService alarmHistoryService;
+
+    @GetMapping(value = "/history/{historyId}")
+    public AlarmHistory queryById(@PathVariable("historyId")  Long historyId ){
+            return alarmHistoryService.queryById(historyId);
+    }
+
+
+    @GetMapping(value = "/history/page2")
+    public AjaxResult queryByPage(
+            @RequestParam(value = "pagenum")Integer pageNum,
+            @RequestParam(value = "pagesize")Integer pageSize,
+            @RequestParam(value = "stationid", required = false) String stId,
+            @RequestParam(value = "windturbineid",required = false) String wtId,
+            @RequestParam(value = "category1",required = false) String category1,
+            @RequestParam(value = "category2",required = false) String category2,
+            @RequestParam(value = "rank",required = false) String rank,
+            @RequestParam(value = "modelid",required = false) String modelId,
+            @RequestParam(value = "snapid",required = false) Long snapId,
+            @RequestParam(value = "messagetype",required = false) Integer messageType,
+            @RequestParam(value = "keyword",required = false) String keyWord,
+            @RequestParam(value = "starttime", required = false) String startTime,
+            @RequestParam(value = "endtime", required = false) String endTime
+    ){
+        Page<AlarmSnap> page =new Page(pageNum,pageSize);
+        try {
+            IPage<AlarmHistoryInfo> pages = alarmHistoryService.pageQueryAll(page,stId,wtId,category1,category2,rank,modelId,snapId,messageType,keyWord,startTime,endTime);
+            return AjaxResult.successData(pages);
+        } catch (Exception e) {
+            log.error("操作失败",e);
+           return AjaxResult.error();
+        }
+
+    }
+
+    @GetMapping(value = "/history/page")
+    public IPage<AlarmHistoryInfo> queryByPage1(
+            @RequestParam(value = "pagenum")Integer pageNum,
+            @RequestParam(value = "pagesize")Integer pageSize,
+            @RequestParam(value = "stationid", required = false) String stId,
+            @RequestParam(value = "windturbineid",required = false) String wtId,
+            @RequestParam(value = "category1",required = false) String category1,
+            @RequestParam(value = "category2",required = false) String category2,
+            @RequestParam(value = "rank",required = false) String rank,
+            @RequestParam(value = "modelid",required = false) String modelId,
+            @RequestParam(value = "snapid",required = false) Long snapId,
+            @RequestParam(value = "messagetype",required = false) Integer messageType,
+            @RequestParam(value = "keyword",required = false) String keyWord,
+            @RequestParam(value = "starttime", required = false) String startTime,
+            @RequestParam(value = "endtime", required = false) String endTime
+    ){
+        Page<AlarmSnap> page =new Page(pageNum,pageSize);
+        try {
+            IPage<AlarmHistoryInfo> pages = alarmHistoryService.pageQueryAll(page,stId,wtId,category1,category2,rank,modelId,snapId,messageType,keyWord,startTime,endTime);
+            return pages;
+        } catch (Exception e) {
+            log.error("操作失败",e);
+            return null;
+        }
+    }
+
+    @GetMapping(value = "/count/todaycount")
+    public AjaxResult getTodayCount(@RequestParam(value = "stId", required = false) String stId ){
+        Map<String, String> map = new HashMap<>();
+
+        try {
+            map = alarmHistoryService.getListmap();
+            if (null == map){
+                map =  alarmHistoryService.getTodayCount();
+            }
+
+            return  AjaxResult.successData(200,map);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return null;
+    }
+
+
+}

+ 151 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/AlarmSnapController.java

@@ -0,0 +1,151 @@
+package com.gyee.wisdom.alarm.sharding.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gyee.wisdom.alarm.sharding.entity.AlarmSnap;
+import com.gyee.wisdom.alarm.sharding.service.AlarmSnapService;
+import com.gyee.wisdom.alarm.sharding.util.DateUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+import java.util.List;
+
+
+@Slf4j
+@RestController
+@RequestMapping("/alarm")
+@CrossOrigin
+public class AlarmSnapController {
+
+    Logger logger = LogManager.getLogger(AlarmSnapController.class);
+    @Autowired
+    private AlarmSnapService alarmSnapService;
+
+    @GetMapping(value = "/snap/test")
+    public void test(){
+        alarmSnapService.testSave();
+    }
+
+    @GetMapping(value = "/snap/{snapId}")
+    public AlarmSnap queryById( @PathVariable("snapId")  Long snapId ){
+            return alarmSnapService.queryById(snapId);
+    }
+
+    @GetMapping(value = "/snap/single")
+    public AlarmSnap querySingle(@RequestParam(value = "stationid", required = false) String stId,
+                                 @RequestParam(value = "windturbineid",required = false) String wtId,
+                                 @RequestParam(value = "alertvalue", required = false) Integer alertValue,
+                                 @RequestParam(value = "testingpointkey", required = false) String testingpointkey){
+        if (stId != null && stId.trim() !="" && alertValue != null )
+            return alarmSnapService.findByStationIdAndAlertValue(stId, alertValue);
+        else if (wtId != null && wtId.trim() != "" && alertValue != null)
+            return alarmSnapService.findByWindturbineIdAndAlertValue(wtId, alertValue);
+        else if (testingpointkey != null && testingpointkey.trim() !="")
+            return alarmSnapService.findByTestingpointkey(testingpointkey);
+        return  null;
+    }
+
+    @GetMapping(value = "/snap")
+    public List<AlarmSnap> queryAll(
+            @RequestParam(value = "stationid", required = false) String stId,
+            @RequestParam(value = "windturbineid",required = false) String wtId,
+            @RequestParam(value = "category1",required = false) String category1,
+            @RequestParam(value = "category2",required = false) String category2,
+            @RequestParam(value = "rank",required = false) String rank,
+            @RequestParam(value = "modelid",required = false) String modelId,
+            @RequestParam(value = "isopened",required = false) Integer isOpened,
+            @RequestParam(value = "keyword",required = false) String keyWord,
+            @RequestParam(value = "starttime", required = false) String startTime,
+            @RequestParam(value = "endtime", required = false) String endTime
+    ){
+        try {
+            return alarmSnapService.queryAll(stId,wtId,category1,category2,rank,modelId,isOpened,keyWord,startTime,endTime);
+        } catch (Exception e) {
+            logger.error("操作失败",e);
+            return null;
+        }
+    }
+
+    @GetMapping(value = "/snap/page")
+    public IPage<AlarmSnap> queryByPage(
+            @RequestParam(value = "pagenum")Integer pageNum,
+            @RequestParam(value = "pagesize")Integer pageSize,
+            @RequestParam(value = "stationid", required = false) String stId,
+            @RequestParam(value = "windturbineid",required = false) String wtId,
+            @RequestParam(value = "category1",required = false) String category1,
+            @RequestParam(value = "category2",required = false) String category2,
+            @RequestParam(value = "rank",required = false) String rank,
+            @RequestParam(value = "modelid",required = false) String modelId,
+            @RequestParam(value = "isopened",required = false) Integer isOpened,
+            @RequestParam(value = "keyword",required = false) String keyWord,
+            @RequestParam(value = "starttime", required = false) String startTime,
+            @RequestParam(value = "endtime", required = false) String endTime
+    ){
+        Page<AlarmSnap> page =new Page(pageNum,pageSize);
+
+        try {
+            return  alarmSnapService.pageQueryAll(page,stId,wtId,category1,category2,rank,modelId,isOpened,keyWord,startTime,endTime);
+        } catch (Exception e) {
+            logger.error("操作失败",e);
+            return null;
+        }
+
+    }
+
+    @PostMapping("/snap/batch")
+    public void writeLatestBatch(@RequestBody List<AlarmSnap> alarmSnaps) {
+        try {
+            alarmSnapService.saveAlarmSnaps(alarmSnaps);
+        } catch (Exception e) {
+            logger.error("操作失败",e);
+        }
+    }
+
+    @PostMapping("/snap")
+    public void saveAlarmSnap(@RequestBody AlarmSnap alarmSnap) {
+        try {
+            alarmSnapService.saveAlarmSnap(alarmSnap);
+        } catch (Exception e) {
+            logger.error("操作失败",e);
+        }
+    }
+
+    @GetMapping(value = "/snap/top")
+    public List<AlarmSnap> getTopNumAlarm(
+            @RequestParam(value = "category1", required = true) String category1,
+            @RequestParam(value = "topnum", required = true) String topNum
+    ) {
+        try {
+            return alarmSnapService.getTopNumAlarm(category1,topNum);
+            //return faultSnapService.getTopNumFault(topNum);
+        } catch (Exception e) {
+            log.error("操作失败",e);
+            return null;
+        }
+    }
+
+    @GetMapping(value = "/snap/recent")
+    public List<AlarmSnap> getRecentAlarm(
+            @RequestParam(value = "category1", required = true) String category1,
+            @RequestParam(value = "lastupdatetime", required = true) String lastUpdateTime
+    ) {
+        lastUpdateTime = lastUpdateTime.trim();
+
+        Date dtFault = null;
+        if (lastUpdateTime != null && lastUpdateTime != "") {
+            if (lastUpdateTime.length() < 19)
+                dtFault = DateUtil.parseDate(lastUpdateTime);
+            else
+                dtFault = DateUtil.parseDate1(lastUpdateTime);
+        }
+
+        if (dtFault == null)
+            return null;
+
+        return alarmSnapService.getRecentAlarm(category1, dtFault);
+    }
+}

+ 299 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/AlarmUserController.java

@@ -0,0 +1,299 @@
+package com.gyee.wisdom.alarm.sharding.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.gyee.wisdom.alarm.sharding.RSA.RSAService;
+import com.gyee.wisdom.alarm.sharding.entity.AlarmUser;
+import com.gyee.wisdom.alarm.sharding.entity.Alertrule2;
+import com.gyee.wisdom.alarm.sharding.service.AlarmUserService;
+import com.gyee.wisdom.alarm.sharding.service.UserLoginToken;
+import com.gyee.wisdom.alarm.sharding.util.RequestWrapper;
+import com.gyee.wisdom.alarm.sharding.util.ResponseWrapper;
+import com.gyee.wisdom.alarm.sharding.util.TokenUtil;
+import io.jsonwebtoken.Claims;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2020-04-24
+ */
+@RestController
+@RequestMapping("/user")
+public class AlarmUserController {
+
+    @Autowired
+    private AlarmUserService alarmUserService;
+
+    @Autowired
+    private RSAService rsaService;
+
+
+    @PostMapping(value = "/login")
+    @ResponseBody
+    public ResponseWrapper login(@RequestBody RequestWrapper<Object> requestData) {
+        ResponseWrapper<AlarmUser> wrapper = null;
+        try {
+            //将请求数据进行解密
+            String obj = requestData.getData().toString();
+            String jsonData = RSAService.translateByPublicKey(obj,requestData.getPublicKey());
+            AlarmUser user = JSONObject.parseObject(jsonData, AlarmUser.class);
+
+            AlarmUser dataUser = alarmUserService.login(user);
+
+            if (dataUser != null) {
+                String token = "";
+                token = TokenUtil.createJwtToken(dataUser.getUserName());
+                AlarmUser data = new AlarmUser();
+                data.setChineseName(dataUser.getChineseName());
+                data.setUserName(dataUser.getUserName());
+                data.setId(dataUser.getId());
+                data.setIdentity(dataUser.getIdentity());
+                wrapper = ResponseWrapper.success("登陆成功", data);
+                wrapper.setToken(token);
+            } else {
+                wrapper = ResponseWrapper.error("用户名或密码错误");
+            }
+
+        } catch (Exception ex) {
+            wrapper = ResponseWrapper.error("请求错误");
+        } finally {
+            return wrapper;
+        }
+
+    }
+
+
+    @PostMapping(value = "/register")
+    @ResponseBody
+    public ResponseWrapper<AlarmUser> registers(@RequestBody RequestWrapper<Object> requestData) {
+        ResponseWrapper<AlarmUser> wrapper = null;
+        try {
+            String obj = requestData.getData().toString();
+            String jsonData = RSAService.translateByPublicKey(obj,requestData.getPublicKey());
+            AlarmUser user = JSONObject.parseObject(jsonData, AlarmUser.class);
+            wrapper = dataCheck(user);
+            AlarmUser existUser = alarmUserService.isExistUser(user.getUserName());
+            if (existUser != null) {
+                wrapper.setMsg("用户名已存在");
+                wrapper.setSuccess(false);
+            }
+            if (wrapper.getSuccess()) {
+                int result = alarmUserService.registerUser(user);
+                if (result <= 0) {
+                    wrapper.setSuccess(false);
+                    if (result == -999) {
+                        wrapper.setMsg("注册失败请联系管理员");
+                    } else {
+                        wrapper.setMsg("操作数据库失败");
+                    }
+
+                    wrapper.setSuccess(false);
+                }
+            }
+        } catch (Exception ex) {
+            wrapper = ResponseWrapper.error("请求失败,请重试");
+        } finally {
+            return wrapper;
+        }
+
+
+    }
+
+    @PostMapping(value = "/registers")
+    @ResponseBody
+    public ResponseWrapper<AlarmUser> register(@RequestBody AlarmUser user) {
+        ResponseWrapper<AlarmUser> wrapper = null;
+            wrapper = dataCheck(user);
+            AlarmUser existUser = alarmUserService.isExistUser(user.getUserName());
+            if (existUser != null) {
+                wrapper.setMsg("用户名已存在");
+                wrapper.setSuccess(false);
+            }
+            if (wrapper.getSuccess()) {
+                int result = alarmUserService.registerUser(user);
+                if (result <= 0) {
+                    wrapper.setSuccess(false);
+                    if (result == -999) {
+                        wrapper.setMsg("注册失败请联系管理员");
+                    } else {
+                        wrapper.setMsg("操作数据库失败");
+                    }
+
+                    wrapper.setSuccess(false);
+                }
+            }
+        return wrapper;
+
+    }
+
+    @PostMapping(value = "/edit")
+    @ResponseBody
+    public ResponseWrapper<AlarmUser> edit(@RequestBody RequestWrapper<Object> requestData) {
+
+        ResponseWrapper<AlarmUser> wrapper = new ResponseWrapper<>();
+        wrapper.setSuccess(true);
+        try {
+            //将请求数据进行解密
+            String obj = requestData.getData().toString();
+            String jsonData = RSAService.translateByPublicKey(obj,requestData.getPublicKey());
+            AlarmUser user = JSONObject.parseObject(jsonData, AlarmUser.class);
+
+            AlarmUser loginUser = alarmUserService.login(user);
+            if (loginUser == null) {
+                wrapper.setSuccess(false);
+                wrapper.setMsg("用户不存在或旧密码错误");
+            }
+            if (wrapper.getSuccess()) {
+                int result = alarmUserService.updateUser(loginUser, user);
+                if (result <= 0) {
+                    if (result == -999) {
+                        wrapper.setMsg("编辑用户错误,请联系管理员");
+                    } else {
+                        wrapper.setMsg("操作数据库失败");
+                    }
+
+                    wrapper.setSuccess(false);
+                } else {
+                    wrapper.setMsg("编辑成功");
+                }
+            }
+        } catch (Exception ex) {
+
+        }
+
+        return wrapper;
+    }
+
+    @PostMapping(value = "/edituser")
+    @ResponseBody
+    public ResponseWrapper<AlarmUser> editAlarmUser(@RequestBody AlarmUser alarmUser) {
+        ResponseWrapper<AlarmUser> wrapper = new ResponseWrapper<>();
+        wrapper.setSuccess(true);
+        AlarmUser loginUser = alarmUserService.login(alarmUser);
+        if (loginUser == null) {
+            wrapper.setSuccess(false);
+            wrapper.setMsg("用户不存在或旧密码错误");
+        }
+        if (wrapper.getSuccess()) {
+            int result = alarmUserService.updateUser(loginUser, alarmUser);
+            if (result <= 0) {
+                if (result == -999) {
+                    wrapper.setMsg("编辑用户错误,请联系管理员");
+                } else {
+                    wrapper.setMsg("操作数据库失败");
+                }
+
+                wrapper.setSuccess(false);
+            } else {
+                wrapper.setMsg("编辑成功");
+            }
+        }
+        return wrapper;
+    }
+
+    //获取所有用户,仅限于管理员进行用户密码重置
+    //@UserLoginToken
+    @PostMapping(value = "/get")
+    @ResponseBody
+    public ResponseWrapper<List<AlarmUser>> getAllUser(@RequestBody RequestWrapper<Object> requestData) {
+
+        ResponseWrapper wrapper = null;
+        Claims claims = TokenUtil.parseJWT(requestData.getToken());
+        String tokenUserName = (String) claims.get("jti");
+        if (!tokenUserName.equals("admin")) {
+            wrapper = ResponseWrapper.error("没有权限!", new ArrayList<>());
+        } else {
+            List<AlarmUser> lst = alarmUserService.getAllUser();
+            wrapper = ResponseWrapper.success("请求成功!", lst);
+        }
+
+        return wrapper;
+    }
+
+    @GetMapping(value = "/getall")
+    public List<AlarmUser> getAllUser1() {
+        List<AlarmUser> lst = alarmUserService.getAllUser();
+        return lst;
+    }
+
+    //用户密码重置
+    //@UserLoginToken
+    @PostMapping(value = "/reset")
+    public ResponseWrapper<Object> resetUser(@RequestBody RequestWrapper<Object> requestData) {
+        ResponseWrapper wrapper = null;
+        try {
+            Claims claims = TokenUtil.parseJWT(requestData.getToken());
+            String tokenUserName = (String) claims.get("jti");
+            if (!tokenUserName.equals("admin")) {
+                wrapper = ResponseWrapper.error("没有权限!");
+            } else {
+                String obj = requestData.getData().toString();
+                //解密
+                String jsonData = RSAService.translateByPublicKey(obj,requestData.getPublicKey());
+                AlarmUser resetUser = JSONObject.parseObject(jsonData, AlarmUser.class);
+                AlarmUser existUser = alarmUserService.isExistUser(resetUser.getUserName());
+                if (existUser != null) {
+                    int result = alarmUserService.updateUser(existUser, resetUser);
+                    if (result > 0) {
+                        wrapper = ResponseWrapper.success("重置成功!");
+                    }else {
+                        wrapper = ResponseWrapper.error("数据库操作失败,请重试!");
+                    }
+                }
+            }
+
+        } catch (Exception ex) {
+            wrapper = ResponseWrapper.error("重置失败,请重试或联系管理员!");
+        } finally {
+            return wrapper;
+        }
+    }
+
+    //删除用户
+    @DeleteMapping(value = "/{id}")
+    @ResponseBody
+    public ResponseWrapper deleteAlarmUser(@PathVariable("id") String id) {
+        ResponseWrapper wrapper = null;
+        int s = alarmUserService.deleteAlarmUser(id);
+        if(s>0){
+            wrapper = ResponseWrapper.success("删除成功!", s);
+            return wrapper;
+        }
+        else {
+            wrapper = ResponseWrapper.error("删除失败!");
+            return wrapper;
+        }
+
+    }
+
+
+    private ResponseWrapper<AlarmUser> dataCheck(AlarmUser user) {
+        ResponseWrapper<AlarmUser> wrapper = null;
+        String msg = "";
+        boolean result = true;
+        if (StringUtils.isBlank(user.getUserName())) {
+            msg = "用户名不能为空";
+            result = false;
+        } else if (StringUtils.isBlank(user.getPassWord())) {
+            msg = "密码不能为空";
+            result = false;
+        } else if (StringUtils.isBlank(user.getChineseName())) {
+            msg = "姓名不能为空";
+            result = false;
+        }
+
+        if (result) {
+            wrapper = ResponseWrapper.success(msg, user);
+        } else {
+            wrapper = ResponseWrapper.error(msg, user);
+        }
+        return wrapper;
+    }
+
+
+}

+ 45 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/AlertKnowledgeController.java

@@ -0,0 +1,45 @@
+package com.gyee.wisdom.alarm.sharding.controller;
+
+import com.gyee.wisdom.alarm.sharding.cache.AlarmInfoCache;
+import com.gyee.wisdom.alarm.sharding.entity.AlertKnowledge;
+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.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * @descrition:预警专家知识
+ * @author:Wanghs
+ * @date:2020-07-14
+ */
+@RestController
+@RequestMapping("/knowledge")
+public class AlertKnowledgeController {
+
+    @Autowired
+    private AlarmInfoCache infoCache;
+
+    @GetMapping(value = "/search")
+    public List<AlertKnowledge> getKnowledge(@RequestParam(value = "alertText", required = true) String alertText) {
+        List<AlertKnowledge> resultList = new ArrayList<>();
+
+        //将数组转化为list;
+        List<String> alertTextList = Arrays.asList(alertText.split(","));
+        HashMap<String, AlertKnowledge> knowledgeHashMap = infoCache.getKnowledgeHashMap();
+        for (String s : alertTextList) {
+            if (knowledgeHashMap.containsKey(s)) {
+                resultList.add(knowledgeHashMap.get(s));
+            }
+        }
+
+        return resultList;
+
+    }
+
+}

+ 161 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/Alertrule2Controller.java

@@ -0,0 +1,161 @@
+package com.gyee.wisdom.alarm.sharding.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gyee.wisdom.alarm.sharding.entity.Alertrule2;
+import com.gyee.wisdom.alarm.sharding.model.TreeNode;
+import com.gyee.wisdom.alarm.sharding.service.Alertrule2Service;
+import com.gyee.wisdom.alarm.sharding.service.UserLoginToken;
+import com.gyee.wisdom.alarm.sharding.util.ResponseWrapper;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+
+@Slf4j
+@RestController
+@RequestMapping("/alertrule2")
+@CrossOrigin
+public class Alertrule2Controller {
+
+    @Autowired
+    private Alertrule2Service alertrule2Service;
+
+    @GetMapping(value = "/list")
+    public List<Alertrule2> queryTree() {
+        List<Alertrule2> alertrules = alertrule2Service.queryTree();
+        return alertrules;
+    }
+
+    @GetMapping(value = "/map")
+    public List<Map<String, Alertrule2>> queryMap() {
+        List<Map<String, Alertrule2>> alertrules = alertrule2Service.queryMap();
+        return alertrules;
+    }
+
+
+    //@UserLoginToken
+    @PostMapping(value = "/save")
+    @ResponseBody
+    public ResponseWrapper<Alertrule2> saveAlertrule2(@RequestBody Alertrule2 alertrule2) {
+
+
+        ResponseWrapper<Alertrule2> wrapper = dataCheck(alertrule2);
+        if (wrapper.getSuccess()) {
+            int result = alertrule2Service.saveAndUpdateAlertrule2(alertrule2);
+            if (result <= 0) {
+                if(result==-999)
+                {
+                    wrapper.setMsg("报警规则id生成错误,请联系管理员");
+                }
+                else {
+                    wrapper.setMsg("操作数据库失败");
+                }
+
+                wrapper.setSuccess(false);
+            }
+        }
+        return wrapper;
+
+    }
+
+    @DeleteMapping(value = "/delete")
+    public int deleteAlertrule2(Alertrule2 alertrule2) {
+        return alertrule2Service.deleteAlertrule2(alertrule2);
+    }
+
+    //@UserLoginToken
+    @GetMapping(value = "/page")
+    public IPage<Alertrule2> queryByPage(
+            @RequestParam(value = "pagenum") Integer pageNum,
+            @RequestParam(value = "pagesize") Integer pageSize,
+            @RequestParam(value = "name", required = false) String name,
+            @RequestParam(value = "station", required = false) String station,
+            @RequestParam(value = "modelId", required = false) String modelId,
+            @RequestParam(value = "rank", required = false) String rank
+    ) {
+        Page<Alertrule2> page = new Page(pageNum, pageSize);
+        IPage<Alertrule2> pageResult = alertrule2Service.pageQueryAll(page, name,station,modelId,rank);
+
+        return pageResult;
+    }
+
+    private ResponseWrapper<Alertrule2> dataCheck(Alertrule2 alertrule) {
+        ResponseWrapper<Alertrule2> wrapper = null;
+        String msg = "";
+        boolean result = true;
+        if (StringUtils.isBlank(alertrule.getName())) {
+            msg = "报警名称不能为空";
+            result = false;
+        } else if (StringUtils.isBlank(alertrule.getDescription())) {
+            msg = "规则描述不能为空";
+            result = false;
+        } else if (StringUtils.isBlank(alertrule.getExpression())) {
+            msg = "报警规则不能为空";
+            result = false;
+        } else if (StringUtils.isBlank(alertrule.getRank())) {
+            msg = "报警级别不能为空";
+            result = false;
+        } else if (StringUtils.isBlank(alertrule.getEnabled())) {
+            msg = "是否可用不能为空";
+            result = false;
+        } else if (StringUtils.isBlank(alertrule.getStation())) {
+            msg = "风场不能为空";
+            result = false;
+        } else if (StringUtils.isBlank(alertrule.getCategory())) {
+            msg = "报警类别不能为空";
+            result = false;
+        }
+        if (alertrule.getCategory().equals("1")) {
+            if (StringUtils.isBlank(alertrule.getModelId())) {
+                msg = "风机型号不能为空";
+                result = false;
+            }
+        }
+
+        if (result) {
+            wrapper = ResponseWrapper.success(msg, alertrule);
+        } else {
+            wrapper = ResponseWrapper.error(msg, alertrule);
+        }
+        return wrapper;
+    }
+
+    //@UserLoginToken
+    @PostMapping(value = "/save-batch")
+    @ResponseBody
+    public ResponseWrapper<Alertrule2> saveAlertrule2Batch(@RequestBody List<Alertrule2> lst) {
+
+        boolean allCheck = true;
+        ResponseWrapper<Alertrule2> wrapper = null;
+        for (Alertrule2 alertRule : lst) {
+            wrapper = dataCheck(alertRule);
+            if (wrapper.getSuccess() != true) {
+                allCheck = false;
+                String msg = wrapper.getMsg();
+                wrapper.setMsg(alertRule.getName() + ":" + msg);
+                break;
+            }
+        }
+        if (allCheck) {
+            for (Alertrule2 alertRule : lst) {
+                int result = alertrule2Service.saveAndUpdateAlertrule2(alertRule);
+                if (result <= 0) {
+                    wrapper.setMsg(alertRule.getName() + ":" + "操作数据库失败");
+                    wrapper.setSuccess(false);
+                    break;
+                }
+            }
+            return wrapper;
+        } else {
+            return wrapper;
+        }
+
+
+    }
+
+}

+ 283 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/DeviceController.java

@@ -0,0 +1,283 @@
+package com.gyee.wisdom.alarm.sharding.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gyee.wisdom.alarm.sharding.RSA.RSAService;
+import com.gyee.wisdom.alarm.sharding.entity.*;
+import com.gyee.wisdom.alarm.sharding.mapper.*;
+import com.gyee.wisdom.alarm.sharding.model.TreeNode;
+import com.gyee.wisdom.alarm.sharding.service.DeviceService;
+import com.gyee.wisdom.alarm.sharding.service.UserLoginToken;
+import com.gyee.wisdom.alarm.sharding.util.ResponseWrapper;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.security.PrivateKey;
+import java.security.PublicKey;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 设备管理类数据接口
+ */
+@Slf4j
+@RestController
+@RequestMapping("/device")
+@CrossOrigin
+public class DeviceController {
+    Logger logger = LogManager.getLogger(DeviceController.class);
+
+    @Autowired
+    private DeviceService deviceService;
+
+
+    @GetMapping(value = "/list")
+    public List<Device> getAllDevice() {
+        return deviceService.getAllDevice();
+    }
+
+    @GetMapping(value = "/structure/all")
+    public List<DeviceStructure> getAllDeviceStructure() {
+        return deviceService.getAllDeviceStructure();
+    }
+
+    @GetMapping(value = "/structure/{deviceId}")
+    public List<DeviceStructure> getDeviceStructureByDeviceId(@PathVariable("deviceId")  String deviceId) {
+        return deviceService.getDeviceStructureByDeviceId(deviceId);
+    }
+
+    @GetMapping(value = "/structure/{deviceId}/{nodeCode}")
+    public List<DeviceStructure> getAllDeviceStructure(@PathVariable("deviceId")  String deviceId,
+                                                       @PathVariable("nodeCode")  String nodeCode) {
+        return deviceService.getDeviceStructureChildNode(deviceId, nodeCode);
+    }
+
+    @GetMapping(value = "/structure/single/{deviceId}/{nodeCode}")
+    public DeviceStructure getDeviceStructureByCode(@PathVariable("deviceId")  String deviceId,
+                                                       @PathVariable("nodeCode")  String nodeCode) {
+        return deviceService.getDeviceStructureByCode(deviceId, nodeCode);
+    }
+
+    @GetMapping(value = "/structure/tree/{deviceId}/{nodeCode}")
+    public TreeNode<DeviceStructure> getDeviceStructureTree(@PathVariable("deviceId")  String deviceId,
+                                                              @PathVariable("nodeCode")  String nodeCode) {
+        return deviceService.getDeviceStructureTree(deviceId, nodeCode);
+    }
+
+    @GetMapping(value = "/structure/tree/{deviceId}")
+    public TreeNode<DeviceStructure> getDeviceStructureTree(@PathVariable("deviceId")  String deviceId) {
+        return deviceService.getDeviceStructureTree(deviceId);
+    }
+
+    @DeleteMapping(value = "/structure/delete/{dsId}")
+    public int deleteDeviceStructure(@PathVariable("dsId") long dsId) {
+        return deviceService.deleteDeviceStructure(dsId);
+    }
+
+    //@UserLoginToken
+    @PostMapping(value = "/structure")
+    @ResponseBody
+    public ResponseWrapper<DeviceStructure> saveDeviceStructure(@RequestBody DeviceStructure ds) {
+        ResponseWrapper<DeviceStructure> wrapper = dataCheck(ds);
+        if (wrapper.getSuccess()) {
+            //mybatis 操作数据库成功会返回影响的条数,如果成功则为1,失败为0
+            int result = deviceService.saveOrUpdateDeviceStructure(ds);
+            if (result <= 0) {
+                wrapper.setSuccess(false);
+                wrapper.setMsg("操作数据库失败");
+            }
+        }
+        return wrapper;
+
+    }
+
+    private ResponseWrapper<DeviceStructure> dataCheck(DeviceStructure ds) {
+
+        ResponseWrapper<DeviceStructure> wrapper = null;
+        String msg = "";
+        boolean result = true;
+
+        if (ds.getCode() == null || ds.getCode().equals("")) {
+            msg = "结构编码不能为空";
+            result = false;
+        } else if (ds.getParentcode() == null || ds.getParentcode().equals("")) {
+            msg = "父节点不能为空";
+            result = false;
+        } else if (ds.getDeviceid() == null || ds.getDeviceid().equals("")) {
+            msg = "设备ID不能为空";
+            result = false;
+        } else if (ds.getName() == null || ds.getName().equals("")) {
+            msg = "名称不能为空";
+            result = false;
+        }
+
+        if (result) {
+            wrapper = ResponseWrapper.success(msg, ds);
+        } else {
+            wrapper = ResponseWrapper.error(msg, ds);
+        }
+
+        return wrapper;
+    }
+
+    @GetMapping(value = "/metrics/{deviceId}")
+    public List<DeviceMetrics> getDeviceMetricsByDeviceId(@PathVariable("deviceId")  String deviceId) {
+        return deviceService.getDeviceMetricsByDeviceId(deviceId);
+    }
+
+    @GetMapping(value = "/metrics/{deviceId}/{structureCode}")
+    public List<DeviceMetrics> getDeviceMetricsBySturctureCode(@PathVariable("deviceId")  String deviceId,
+                                                       @PathVariable("structureCode")  String structureCode) {
+        return deviceService.getDeviceMetricsByStructureCode(deviceId, structureCode);
+    }
+
+    @GetMapping(value = "/metrics/page")
+    public IPage<DeviceMetrics> queryByPage(
+            @RequestParam(value = "pagenum")Integer pageNum,
+            @RequestParam(value = "pagesize")Integer pageSize,
+            @RequestParam(value = "deviceId", required = false) String deviceId,
+            @RequestParam(value = "structureCode",required = false) String structureCode
+    ){
+        Page<DeviceMetrics> page =new Page(pageNum,pageSize);
+
+        try {
+            return  deviceService.pageQueryAll(page,deviceId,structureCode);
+        } catch (Exception e) {
+            logger.error("操作失败",e);
+            return null;
+        }
+
+    }
+
+
+    @GetMapping(value = "/metrics/single/{deviceId}/{metricCode}")
+    public DeviceMetrics getDeviceMetricsByCode(@PathVariable("deviceId")  String deviceId,
+                                                    @PathVariable("metricCode")  String metricCode) {
+        return deviceService.getDeviceMetricsByCode(deviceId, metricCode);
+    }
+
+
+    @DeleteMapping(value = "/metrics/single/delete/{metricId}")
+    public int deleteDeviceMetric(@PathVariable("metricId") long metricId) {
+        return deviceService.deleteDeviceMetric(metricId);
+    }
+
+    //@UserLoginToken
+    @PostMapping(value = "/metrics/single")
+    @ResponseBody
+    public ResponseWrapper<DeviceMetrics> saveDeviceMetrics(@RequestBody DeviceMetrics ds) {
+        ResponseWrapper<DeviceMetrics> wrapper = dataCheck(ds);
+        if (wrapper.getSuccess()) {
+            //mybatis 操作数据库成功会返回影响的条数,如果成功则为1,失败为0
+            List<DeviceModelMetrics> deviceModelMetrics =ds.getDeviceModelMetrics();
+            int result = deviceService.saveOrUpdateDeviceMetric(ds,deviceModelMetrics);
+            if (result <= 0) {
+                wrapper.setSuccess(false);
+                wrapper.setMsg("操作数据库失败");
+            }
+        }
+        return wrapper;
+
+    }
+
+    private ResponseWrapper<DeviceMetrics> dataCheck(DeviceMetrics ds) {
+
+        ResponseWrapper<DeviceMetrics> wrapper = null;
+        String msg = "";
+        boolean result = true;
+
+        if (ds.getMetriccode() == null || ds.getMetriccode().equals("")) {
+            msg = "指标编码不能为空";
+            result = false;
+        } else if (ds.getStructurecode() == null || ds.getStructurecode().equals("")) {
+            msg = "设备结构编码不能为空";
+            result = false;
+        } else if (ds.getDeviceid() == null || ds.getDeviceid().equals("")) {
+            msg = "设备ID不能为空";
+            result = false;
+        } else if (ds.getName() == null || ds.getName().equals("")) {
+            msg = "名称不能为空";
+            result = false;
+        }
+
+        /*if (deviceService.getDeviceMetricsByCode(ds.getDeviceid(), ds.getMetriccode()) != null) {
+            msg = "指标编码重复!!";
+            result = false;
+        }*/
+
+        if (result) {
+            wrapper = ResponseWrapper.success(msg, ds);
+        } else {
+            wrapper = ResponseWrapper.error(msg, ds);
+        }
+
+        return wrapper;
+    }
+
+    @GetMapping(value = "/model/list")
+    public List<DeviceModel> getDeviceModelList() {
+        return deviceService.getDeviceModelList();
+    }
+
+    @GetMapping(value = "/model/{id}")
+    public List<DeviceModel> getDeviceModelsById(@PathVariable("id")  String id) {
+        return deviceService.getDeviceModelsById(id);
+    }
+
+
+    @DeleteMapping(value = "/model/delete/{id}")
+    public int deleteDeviceModel(@PathVariable("id") int id) {
+        return deviceService.deleteDeviceModel(id);
+    }
+
+    @PostMapping(value = "/model")
+    @ResponseBody
+    public ResponseWrapper<DeviceModel> saveDeviceModel(@RequestBody DeviceModel ds) {
+        ResponseWrapper<DeviceModel> wrapper = dataCheck2(ds);
+        if (wrapper.getSuccess()) {
+            //mybatis 操作数据库成功会返回影响的条数,如果成功则为1,失败为0
+            int result = deviceService.saveOrUpdateDeviceModel(ds);
+            if (result <= 0) {
+                wrapper.setSuccess(false);
+                wrapper.setMsg("操作数据库失败");
+            }
+        }
+        return wrapper;
+    }
+    private ResponseWrapper<DeviceModel> dataCheck2(DeviceModel ds) {
+
+        ResponseWrapper<DeviceModel> wrapper = null;
+        String msg = "";
+        boolean result = true;
+
+        if (ds.getCode() == null || ds.getCode().equals("")) {
+            msg = "设备编码不能为空";
+            result = false;
+        }  else if (ds.getDeviceid() == null || ds.getDeviceid().equals("")) {
+            msg = "设备ID不能为空";
+            result = false;
+        } else if (ds.getName() == null || ds.getName().equals("")) {
+            msg = "名称不能为空";
+            result = false;
+        }
+
+        if (deviceService.getDeviceModelByCode(ds.getDeviceid(), ds.getCode()) != null) {
+            msg = "指标编码重复!!";
+            result = false;
+        }
+
+        if (result) {
+            wrapper = ResponseWrapper.success(msg, ds);
+        } else {
+            wrapper = ResponseWrapper.error(msg, ds);
+        }
+
+        return wrapper;
+    }
+}

+ 89 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/DeviceFaultModeController.java

@@ -0,0 +1,89 @@
+package com.gyee.wisdom.alarm.sharding.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gyee.wisdom.alarm.sharding.entity.DeviceFaultMode;
+import com.gyee.wisdom.alarm.sharding.entity.FaultInfo;
+import com.gyee.wisdom.alarm.sharding.service.DeviceFaultModeService;
+import com.gyee.wisdom.alarm.sharding.util.ResponseWrapper;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@Slf4j
+@RestController
+@RequestMapping("/device/faultmode")
+@CrossOrigin
+public class DeviceFaultModeController {
+
+    @Autowired
+    private DeviceFaultModeService deviceFaultModeService;
+
+
+    @GetMapping(value = "/{deviceId}")
+    public List<DeviceFaultMode> getDeviceFaultModeByDeviceId(@PathVariable("deviceId")  String deviceId) {
+        return deviceFaultModeService.getDeviceFaultModeByDeviceId(deviceId);
+    }
+
+    @GetMapping(value = "/{deviceId}/{structurecode}")
+    public List<DeviceFaultMode> getDeviceFaultModeBySturctureCode(@PathVariable("deviceId")  String deviceId,
+                                                               @PathVariable("structurecode")  String structurecode) {
+        return deviceFaultModeService.getDeviceFaultModeByStructureCode(deviceId, structurecode);
+    }
+
+
+    @GetMapping(value = "/single/{code}")
+    public DeviceFaultMode getDeviceFaultModeByCode(@PathVariable("code")  String code) {
+        return deviceFaultModeService.getDeviceFaultModeByCode(code);
+    }
+
+
+    @DeleteMapping(value = "/delete/{id}")
+    public int deleteDeviceFaultMode(@PathVariable("id") Long id) {
+        int result = deviceFaultModeService.deleteDeviceFaultMode(id);
+        return result;
+    }
+
+    @PostMapping()
+    @ResponseBody
+    public ResponseWrapper<DeviceFaultMode> saveDeviceFaultMode(@RequestBody DeviceFaultMode ds) {
+        ResponseWrapper<DeviceFaultMode> wrapper = dataCheck(ds);
+        if (wrapper.getSuccess()) {
+            //mybatis 操作数据库成功会返回影响的条数,如果成功则为1,失败为0
+            int result = deviceFaultModeService.saveorUpdateDeviceFaultMode(ds);
+            if (result <= 0) {
+                wrapper.setSuccess(false);
+                wrapper.setMsg("操作数据库失败");
+            }
+        }
+        return wrapper;
+    }
+
+    private ResponseWrapper<DeviceFaultMode> dataCheck(DeviceFaultMode ds) {
+
+        ResponseWrapper<DeviceFaultMode> wrapper = null;
+        String msg = "";
+        boolean result = true;
+
+        if (ds.getCode() == null || ds.getCode().equals("")) {
+            msg = "结构编码不能为空";
+            result = false;
+        } else if (ds.getDeviceid() == null || ds.getDeviceid().equals("")) {
+            msg = "设备ID不能为空";
+            result = false;
+        } else if (ds.getName() == null || ds.getName().equals("")) {
+            msg = "名称不能为空";
+            result = false;
+        }
+        if (result) {
+            wrapper = ResponseWrapper.success(msg, ds);
+        } else {
+            wrapper = ResponseWrapper.error(msg, ds);
+        }
+        return wrapper;
+    }
+
+
+}

+ 27 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/EquipmentmodelController.java

@@ -0,0 +1,27 @@
+package com.gyee.wisdom.alarm.sharding.controller;
+
+import com.gyee.wisdom.alarm.sharding.entity.Device;
+import com.gyee.wisdom.alarm.sharding.entity.Equipmentmodel;
+import com.gyee.wisdom.alarm.sharding.service.EquipmentmodelService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 风机接口
+ */
+@Slf4j
+@RestController
+@RequestMapping("/equipmentmodel")
+@CrossOrigin
+public class EquipmentmodelController {
+    @Autowired
+    private EquipmentmodelService equipmentmodelService;
+
+    @GetMapping(value = "/list")
+    public List<Equipmentmodel> getAllEquipmentmodel() {
+        return equipmentmodelService.getAllEquipmentmodel();
+    }
+}

+ 196 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/FaultInfoController.java

@@ -0,0 +1,196 @@
+package com.gyee.wisdom.alarm.sharding.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gyee.wisdom.alarm.sharding.entity.FaultHistory;
+import com.gyee.wisdom.alarm.sharding.entity.FaultInfo;
+import com.gyee.wisdom.alarm.sharding.entity.FaultSnap;
+import com.gyee.wisdom.alarm.sharding.service.FaultInfoService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2020-06-10
+ */
+@Slf4j
+@RestController
+@RequestMapping("/fault")
+@CrossOrigin
+public class FaultInfoController {
+
+    Logger logger = LogManager.getLogger(FaultInfoController.class);
+    @Autowired
+    private FaultInfoService faultService;
+
+    @GetMapping(value = "/history/list")
+    public List<FaultInfo> queryByList(
+            @RequestParam(value = "pagenum", required = false) Integer pageNum,
+            @RequestParam(value = "pagesize", required = false) Integer pageSize,
+            @RequestParam(value = "stationid", required = false) String stId,
+            @RequestParam(value = "keyword", required = false) String keyWord,
+            @RequestParam(value = "category1", required = false) String cateGory1,
+            @RequestParam(value = "starttime", required = false) String startTime,
+            @RequestParam(value = "endtime", required = false) String endTime,
+            @RequestParam(value = "messagetype", required = false) Integer messageType,
+            @RequestParam(value = "isopened", required = false) Integer isOpened
+    ) {
+        try {
+            if(null != pageNum && null !=pageSize ){
+                Page<FaultInfo> page = new Page(pageNum, pageSize);
+                IPage<FaultInfo> result = faultService.queryFaultInfo(page, stId, keyWord,cateGory1, startTime, endTime, isOpened);
+                for (FaultInfo fi : result.getRecords()) {
+                    fi.setProjectId("" + result.getTotal());
+                }
+                return result.getRecords();
+            }
+            List<FaultInfo> result = faultService.queryFaultInfo(stId, keyWord, startTime, endTime,messageType);
+            return result;
+        } catch (Exception e) {
+            logger.error("操作失败",e);
+            return null;
+        }
+    }
+
+    @GetMapping("/history")
+    public List<FaultInfo> getHistoryById(@RequestParam(value = "ids", required = false) String ids){
+        if(ids==null){
+            return null;
+        }
+        String[] nids = ids.split(",");
+        List<FaultInfo> fi = faultService.getFaultInfoById(nids);
+        return fi;
+    }
+
+
+    @GetMapping(value = "/history/station")
+    public List<FaultSnap> queryByTimeAndStation(
+            @RequestParam(value = "startTime", required = false) String startTime,
+            @RequestParam(value = "endTime", required = false) String endTime,
+            @RequestParam(value = "stationId", required = false) String stationId){
+        return faultService.queryByTimeAndStation(startTime,endTime,stationId);
+    }
+
+
+    @GetMapping(value = "/recent")
+    public List<FaultInfo> getRecentFault(
+            @RequestParam(value = "faulttime", required = true) String faultTime
+    ) {
+        return faultService.getRecentFault(faultTime);
+    }
+
+    @GetMapping(value = "/history/page")
+    public IPage<FaultInfo> queryByPage(
+            @RequestParam(value = "pagenum") Integer pageNum,
+            @RequestParam(value = "pagesize") Integer pageSize,
+            @RequestParam(value = "stationid", required = false) String stId,
+            @RequestParam(value = "isopened", required = false) Integer isOpened,
+            @RequestParam(value = "keyword", required = false) String keyWord,
+            @RequestParam(value = "starttime", required = false) String startTime,
+            @RequestParam(value = "endtime", required = false) String endTime
+    ) {
+        try {
+            Page<FaultInfo> page = new Page(pageNum, pageSize);
+            return faultService.queryFaultInfo(page, stId, keyWord, "", startTime, endTime, isOpened);
+        } catch (Exception e) {
+            logger.error("操作失败",e);
+            return null;
+        }
+
+    }
+
+
+    @GetMapping(value = "/top")
+    public List<FaultInfo> getTopNumFault(
+            @RequestParam(value = "topnum", required = true) String topNum
+    ) {
+        try {
+            return faultService.getTopNumFault(topNum);
+        } catch (Exception e) {
+            logger.error("操作失败",e);
+            return null;
+        }
+    }
+
+
+    @PostMapping("/history")
+    public void saveFaultHistory(@RequestBody FaultHistory faultHistory){
+        logger.info("请求数据:id = {},snapId = {},confirmPerson = {}",faultHistory.getId(),faultHistory.getSnapId(),faultHistory.getConfirmPerson());
+        try {
+            faultService.saveFaultHistory(faultHistory);
+        } catch (Exception e) {
+            logger.error("操作失败",e);
+        }
+    }
+
+
+    @GetMapping(value = "/history/{historyId}")
+    public FaultHistory queryFaultHistoryById(@PathVariable("historyId") Long historyId) {
+        try {
+            return faultService.queryFaultHistoryById(historyId);
+        } catch (Exception e) {
+            logger.error("操作失败",e);
+            return null;
+        }
+    }
+
+
+    @GetMapping(value = "/snap/ids")
+    public List<FaultSnap> queryMultiFaultSnap(@RequestParam(value = "ids") String snapIds) {
+        try {
+            return faultService.queryMultiFaultSnap(snapIds);
+        } catch (Exception e) {
+            logger.error("操作失败",e);
+            return null;
+        }
+    }
+
+
+    @GetMapping(value = "/snap/single")
+    public FaultSnap queryByTagId(@RequestParam(value = "tagId", required = true) String tagId){
+        return faultService.queryByTagId(tagId);
+    }
+
+    @PostMapping("/snap/batch")
+    public void writeLatestBatch(@RequestBody List<FaultSnap> faultSnaps) throws Exception {
+        faultService.saveFaultSnaps(faultSnaps);
+    }
+
+    //一次性批量确认
+    @GetMapping("/clear")
+    public void clearFaultBatch(@RequestParam(value = "startTime") long startTime,
+                                @RequestParam(value = "endTime") long endTime) {
+        try {
+            Date st = new Date(startTime);
+            Date et = new Date(endTime);
+            faultService.faultClear(st, et);
+        } catch (Exception e) {
+            logger.error("操作失败",e);
+        }
+    }
+
+
+
+    //故障确认操作
+    @GetMapping("/confirm")
+    public void confirmFault(
+            @RequestParam(value = "faultHistoryId") long faultHistoryId,
+            @RequestParam(value = "confirmType") int confirmType,
+            @RequestParam(value = "userName") String userName,
+            @RequestParam(value = "snpaId") long snpaId) {
+
+        try {
+            faultService.confirmBatch(faultHistoryId,confirmType,userName,snpaId);
+        } catch (Exception e) {
+            logger.error("操作失败",e);
+        }
+    }
+}

+ 64 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/FaultSnapController.java

@@ -0,0 +1,64 @@
+package com.gyee.wisdom.alarm.sharding.controller;
+
+import com.gyee.wisdom.alarm.sharding.entity.FaultSnap;
+import com.gyee.wisdom.alarm.sharding.mapper.FaultSnapMapper;
+import com.gyee.wisdom.alarm.sharding.service.FaultSnapService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@Slf4j
+@RestController
+@RequestMapping("/fault")
+@CrossOrigin
+public class FaultSnapController {
+
+    @Autowired
+    private FaultSnapService faultSnapService;
+
+    /**
+     * 根据条件查询所有数据
+     *
+     * @return
+     */
+    @GetMapping("/snap/list")
+    public List<FaultSnap> queryAll(
+            @RequestParam(value = "stationid", required = false) String stationId,
+            @RequestParam(value = "windturbineid", required = false) String windturbineId,
+            @RequestParam(value = "category1", required = false) String category1,
+            @RequestParam(value = "category2", required = false) String category2,
+            @RequestParam(value = "category3", required = false) String category3,
+            @RequestParam(value = "rank", required = false) String rank,
+            @RequestParam(value = "starttime", required = false) String startTime,
+            @RequestParam(value = "endtime", required = false) String endTime,
+            @RequestParam(value = "isopened", required = false) String isOpened,
+            @RequestParam(value = "alerttext", required = false) String alertText) {
+
+        List<FaultSnap> list;
+
+        try {
+            list = faultSnapService.queryAll(stationId, windturbineId, category1, category2, category3,
+                    rank, startTime, endTime, isOpened, alertText);
+
+            return list;
+
+        } catch (Exception e) {
+            log.error("查询失败: ", e);
+            return null;
+        }
+    }
+
+    @GetMapping(value = "/snap/top")
+    public List<FaultSnap> getTopNumFault(
+            @RequestParam(value = "topnum", required = true) String topNum
+    ) {
+        try {
+            return faultSnapService.getTopNumFault(topNum);
+        } catch (Exception e) {
+            log.error("操作失败",e);
+            return null;
+        }
+    }
+}

+ 24 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/FaultStatisticWindturbineContrller.java

@@ -0,0 +1,24 @@
+package com.gyee.wisdom.alarm.sharding.controller;
+
+
+import com.gyee.wisdom.alarm.sharding.entity.FaultSnap;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@Slf4j
+@RestController
+@RequestMapping("/faultStatistic")
+@CrossOrigin
+public class FaultStatisticWindturbineContrller {
+
+
+    @GetMapping("/snap/list")
+    public String  queryCount(){
+        return null;
+    }
+}

+ 200 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/InfoController.java

@@ -0,0 +1,200 @@
+package com.gyee.wisdom.alarm.sharding.controller;
+
+import com.gyee.wisdom.alarm.sharding.RSA.RSAService;
+import com.gyee.wisdom.alarm.sharding.entity.*;
+import com.gyee.wisdom.alarm.sharding.mapper.*;
+import com.gyee.wisdom.alarm.sharding.util.ResponseWrapper;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.security.PrivateKey;
+import java.security.PublicKey;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @descrition: 页面基本信息
+ * @author:Wanghs
+ * @date:2019-12-06
+ */
+@Slf4j
+@RestController
+@RequestMapping("/info")
+@CrossOrigin
+public class InfoController {
+
+    @Autowired
+    private WindPowerStationMapper windPowerStationMapper;
+
+    @Autowired
+    private WindturbineMapper windturbineMapper;
+
+    @Autowired
+    private TestingPointAIMapper testingPointAIMapper;
+
+    @Autowired
+    private TestingPointDIMapper testingPointDIMapper;
+
+    @Autowired
+    private WindturbinePartsMapper windturbinePartsMapper;
+
+    @Autowired
+    private ElectricalTestingPointAIMapper electricalTestingPointAIMapper;
+
+    @Autowired
+    private ElectricalTestingPointDIMapper electricalTestingPointDIMapper;
+
+    @Autowired
+    private WarningTypeMapper warningTypeMapper;
+
+    @Autowired
+    private WarningClassifyMapper warningClassifyMapper;
+
+    @Autowired
+    private RSAService rsaService;
+
+
+    @RequestMapping(value = "/station")
+    @ResponseBody
+    public List<WindPowerStation> getAllStation(@RequestParam(value = "id", required = false) String id) {
+
+        String md5Str = DigestUtils.md5Hex("12345678" + "gdnxfd");
+
+        if (StringUtils.isBlank(id)) {
+            id = "_FDC";
+        }
+        List<WindPowerStation> lst = windPowerStationMapper.getStationAll(id);
+        return lst;
+    }
+
+    @RequestMapping(value = "/windturbine")
+    @ResponseBody
+    public List<Windturbine> getWindturbineByStation(@RequestParam(value = "stationId", required = false) String stationId,
+                                                     @RequestParam(value = "modelId", required = false) String modelId) {
+        List<Windturbine> lst = windturbineMapper.selectWindturbineByCondition(stationId, modelId);
+        return lst;
+    }
+
+    @RequestMapping(value = "/testing_point_ai")
+    @ResponseBody
+    public List<TestingPointAI> getTestingPointAIByStationIdAndModelId(
+            @RequestParam(value = "stationId") String stationId,
+            @RequestParam(value = "modelId") String modelId
+    ) {
+
+        List<TestingPointAI> lst = new ArrayList<>();
+        if (StringUtils.isNotBlank(stationId) && StringUtils.isNotBlank(modelId)) {
+            String stationStr = stationId.replace("_FDC", "").replace("_GDC", "").trim();
+            lst = testingPointAIMapper.selectByStationAndModel(stationStr, modelId);
+        }
+        return lst;
+    }
+
+    @RequestMapping(value = "/testing_point_di")
+    @ResponseBody
+    public List<TestingPointDI> getTestingPointDIByStationIdAndModelId(
+            @RequestParam(value = "stationId", required = false) String stationId,
+            @RequestParam(value = "modelId", required = false) String modelId
+    ) {
+        List<TestingPointDI> lst = new ArrayList<>();
+        if (StringUtils.isNotBlank(stationId) || StringUtils.isNotBlank(modelId)) {
+            String stationStr = "";
+            if (StringUtils.isNotBlank(stationId))
+                stationStr = stationId.replace("_FDC", "").replace("_GDC", "").trim();
+            lst = testingPointDIMapper.selectByStationAndModel(stationStr, modelId);
+        }
+        return lst;
+
+    }
+
+    @RequestMapping(value = "/electrical_point_ai")
+    @ResponseBody
+    public List<ElectricalTestingPointAI> getElectricaTestingPointAIByStationId(@RequestParam(value = "stationId") String stationId) {
+        return electricalTestingPointAIMapper.selectPointByStation(stationId);
+    }
+
+    @RequestMapping(value = "/electrical_point_di")
+    @ResponseBody
+    public List<ElectricalTestingPointDI> getElectricaTestingPointDIByStationId(@RequestParam(value = "stationId") String stationId) {
+        return electricalTestingPointDIMapper.selectPointByStation(stationId);
+    }
+
+
+    @RequestMapping(value = "/windturbine_parts")
+    public List<WindturbineParts> getWindturbineParts() {
+        List<WindturbineParts> lst = new ArrayList<>();
+        try {
+            lst = windturbinePartsMapper.selectAllWindturbineParts();
+
+        } catch (Exception ex) {
+            log.error("获取风机部件信息失败" + ex.getMessage() + ex.getStackTrace());
+        } finally {
+            return lst;
+        }
+    }
+
+    @RequestMapping(value = "/warning_type")
+    public List<WarningType> getWarningType() {
+        List<WarningType> lst = new ArrayList<>();
+        try {
+            lst = warningTypeMapper.getAll();
+
+        } catch (Exception ex) {
+            log.error("获取报警种类信息失败" + ex.getMessage() + ex.getStackTrace());
+        } finally {
+            return lst;
+        }
+    }
+
+    @RequestMapping(value = "/warning_classify")
+    public List<WarningClassify> getWarningClassify() {
+        List<WarningClassify> lst = new ArrayList<>();
+        try {
+            lst = warningClassifyMapper.getAll();
+
+        } catch (Exception ex) {
+            log.error("获取报警分类信息失败" + ex.getMessage() + ex.getStackTrace());
+        } finally {
+            return lst;
+        }
+    }
+
+    @RequestMapping(value = "/publickey")
+    public String getPublicKey() throws Exception {
+        //获得密钥对Map
+        Map<String, byte[]> keyMap = rsaService.getKeyMap();
+        //获得公钥
+        String publicKeyStr = rsaService.encryptBASE64(keyMap.get("publicKey"));
+        //获得私钥
+        String privateKeyStr = rsaService.encryptBASE64(keyMap.get("privateKey"));
+
+        PrivateKey privateKey = rsaService.restorePrivateKey(rsaService.decryptBASE64(privateKeyStr));
+        PublicKey publicKey = rsaService.restorePublicKey(rsaService.decryptBASE64(publicKeyStr));
+        RSAService.keyMap.put(publicKey, privateKey);
+        System.out.println(publicKeyStr);
+        return publicKeyStr;
+    }
+
+
+
+    @PostMapping(value = "/sendkey")
+    @ResponseBody
+    public ResponseWrapper sendWebPublickey(@RequestBody String webPublicKey ){
+
+
+        System.out.println(webPublicKey);
+       PublicKey publicKey=RSAService.restorePublicKey(webPublicKey.getBytes());
+        byte [] data=RSAService.encryptionByPublicKey(publicKey,"wanghs的加密信息".getBytes());
+        ResponseWrapper wrapper=ResponseWrapper.success("返回数据",data);
+
+        return  wrapper;
+
+
+
+    }
+}

+ 125 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/ScadabjController.java

@@ -0,0 +1,125 @@
+package com.gyee.wisdom.alarm.sharding.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gyee.wisdom.alarm.sharding.entity.Alertrule2;
+import com.gyee.wisdom.alarm.sharding.entity.Scadabj;
+import com.gyee.wisdom.alarm.sharding.service.Alertrule2Service;
+import com.gyee.wisdom.alarm.sharding.service.ScadabjService;
+import com.gyee.wisdom.alarm.sharding.service.UserLoginToken;
+import com.gyee.wisdom.alarm.sharding.util.ResponseWrapper;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@Slf4j
+@RestController
+@RequestMapping("/scadabj")
+@CrossOrigin
+public class ScadabjController {
+
+    @Autowired
+    private ScadabjService scadabjService;
+
+    //@UserLoginToken
+    @PostMapping(value = "/save")
+    @ResponseBody
+    public ResponseWrapper<Scadabj> saveScadabj(@RequestBody Scadabj scadabj) {
+        ResponseWrapper<Scadabj> wrapper = dataCheck(scadabj);
+        if (wrapper.getSuccess()) {
+            //mybatis 操作数据库成功会返回影响的条数,如果成功则为1,失败为0
+            int result = scadabjService.saveAndUpdateScadabj(scadabj);
+            if (result <= 0) {
+                wrapper.setSuccess(false);
+                wrapper.setMsg("操作数据库失败");
+            }
+        }
+        return wrapper;
+
+    }
+
+    @DeleteMapping(value = "/delete")
+    public int deleteScadabj(Scadabj scadabj) {
+        return scadabjService.deleteScadabj(scadabj);
+    }
+
+
+    //@UserLoginToken
+    @GetMapping(value = "/page")
+    public IPage<Scadabj> queryByPage(
+            @RequestParam(value = "pagenum") Integer pageNum,
+            @RequestParam(value = "pagesize") Integer pageSize,
+            @RequestParam(value = "pointKey", required = false) String pointKey,
+            @RequestParam(value = "stationId", required = false) String stationId,
+            @RequestParam(value = "enable", required = false) String enable,
+            @RequestParam(value = "description", required = false) String description
+
+    ) {
+        Page<Scadabj> page = new Page(pageNum, pageSize);
+        IPage<Scadabj> pg = scadabjService.pageQueryAll(page, pointKey, stationId, enable, description);
+        return pg;
+    }
+
+    //@UserLoginToken
+    @PostMapping(value = "/save-batch")
+    @ResponseBody
+    public ResponseWrapper<Scadabj> saveScadabjBatch(@RequestBody List<Scadabj> lst) {
+        boolean allCheck = true;
+        ResponseWrapper<Scadabj> wrapper = null;
+        for (Scadabj scadabj : lst) {
+            wrapper = dataCheck(scadabj);
+            if (wrapper.getSuccess() != true) {
+                allCheck = false;
+                String msg = wrapper.getMsg();
+                wrapper.setMsg(scadabj.getDescription() + ":" + msg);
+                break;
+            }
+        }
+        if (allCheck) {
+            for (Scadabj scadabj : lst) {
+                int result = scadabjService.saveAndUpdateScadabj(scadabj);
+                if (result <= 0) {
+                    wrapper.setMsg(scadabj.getDescription() + ":" + "操作数据库失败");
+                    wrapper.setSuccess(false);
+                    break;
+                }
+            }
+            return wrapper;
+        } else {
+            return wrapper;
+        }
+
+    }
+
+
+    private ResponseWrapper<Scadabj> dataCheck(Scadabj scadabj) {
+
+        ResponseWrapper<Scadabj> wrapper = null;
+        String msg = "";
+        boolean result = true;
+        if (scadabj.getPointKey() != null && scadabj.getPointKey().equals("")) {
+            msg = "测点不能为空";
+            result = false;
+        } else if (scadabj.getDescription() != null && scadabj.getDescription().equals("")) {
+            msg = "描述不能为空";
+            result = false;
+        } else if (scadabj.getRank() != null && scadabj.getRank().equals("")) {
+            msg = "报警级别不能为空";
+            result = false;
+        } else if (scadabj.getEnabled() == -1) {
+            msg = "是否可用不能为空";
+            result = false;
+        } else if (scadabj.getAlarmType() == -1) {
+            msg = "报警逻辑不能为空";
+            result = false;
+        }
+        if (result) {
+            wrapper = ResponseWrapper.success(msg, scadabj);
+        } else {
+            wrapper = ResponseWrapper.error(msg, scadabj);
+        }
+        return wrapper;
+    }
+}

+ 43 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/ScadafaultController.java

@@ -0,0 +1,43 @@
+package com.gyee.wisdom.alarm.sharding.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gyee.wisdom.alarm.sharding.entity.Scadabj;
+import com.gyee.wisdom.alarm.sharding.entity.Scadafault;
+import com.gyee.wisdom.alarm.sharding.service.ScadabjService;
+import com.gyee.wisdom.alarm.sharding.service.ScadafaultService;
+import com.gyee.wisdom.alarm.sharding.service.UserLoginToken;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@Slf4j
+@RestController
+@RequestMapping("/scadafault")
+@CrossOrigin
+public class ScadafaultController {
+
+    @Autowired
+    private ScadafaultService scadafaultService;
+
+    //@UserLoginToken
+    @PostMapping(value = "/save")
+    public int saveScadafault( Scadafault scadafault){
+        return scadafaultService.saveAndUpdateScadafault(scadafault);
+    }
+
+    @DeleteMapping(value = "/delete")
+    public int deleteScadafault( Scadafault scadafault){
+        return scadafaultService.deleteScadafault(scadafault);
+    }
+
+    //@UserLoginToken
+    @GetMapping(value = "/page")
+    public IPage<Scadafault> queryByPage(
+            @RequestParam(value = "pagenum")Integer pageNum,
+            @RequestParam(value = "pagesize")Integer pageSize
+    ){
+        Page<Scadafault> page =new Page(pageNum,pageSize);
+        return  scadafaultService.pageQueryAll(page);
+    }
+}

+ 68 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/ShutdownEventController.java

@@ -0,0 +1,68 @@
+package com.gyee.wisdom.alarm.sharding.controller;
+import com.gyee.wisdom.alarm.sharding.config.AjaxResult;
+import com.gyee.wisdom.alarm.sharding.entity.StopTypeCount;
+import com.gyee.wisdom.alarm.sharding.service.ShutdownEventService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Map;
+
+@Slf4j
+@RestController
+@RequestMapping("/shutdown")
+@CrossOrigin
+public class ShutdownEventController {
+
+
+    @Autowired
+    private ShutdownEventService shutdownEventService;
+
+
+
+    @CrossOrigin(origins = "*",maxAge = 3600)
+    @GetMapping(value = "/list")
+    public AjaxResult  getRecentFault(
+            @RequestParam(value = "stId", required = true) String stId,
+            @RequestParam(value = "startDate", required = true) String startDate,
+            @RequestParam(value = "endDate", required = true) String endDate
+
+    )throws Exception {
+
+        try {
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            Date startdate = sdf.parse(startDate);
+            Date edtend = sdf.parse(endDate);
+            return AjaxResult.successData(shutdownEventService.queryShutdownEventList(stId,startdate,edtend));
+        } catch (Exception e) {
+            return AjaxResult.error();
+        }
+
+
+    }
+
+
+    /**
+     * 停机事件全场统计次数和时间
+     * @param stId 场站id(例:MHS_FDC)
+     * @return
+     */
+    @CrossOrigin(origins = "*",maxAge = 3600)
+    @GetMapping(value = "/count/alltotal")
+    public AjaxResult  getRecentFaultCount(@RequestParam(value = "stId", required = false) String stId ){
+        try {
+            if(null ==stId || "0".equals(stId.trim())){
+                stId = "";
+            }
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            Date currentDate = sdf.parse( sdf.format(new Date()));
+            Map<String, StopTypeCount> map = shutdownEventService.queryShutdownEventCurrentDate(stId,currentDate);
+            return  AjaxResult.successData(map);
+        } catch (Exception e) {
+            return AjaxResult.error();
+        }
+    }
+
+
+}

+ 36 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/StopTypeController.java

@@ -0,0 +1,36 @@
+package com.gyee.wisdom.alarm.sharding.controller;
+
+import com.gyee.wisdom.alarm.sharding.config.AjaxResult;
+import com.gyee.wisdom.alarm.sharding.entity.StopType;
+import com.gyee.wisdom.alarm.sharding.service.StopTypeService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import java.util.List;
+
+
+@Slf4j
+@RestController
+@RequestMapping("/Stoptype")
+@CrossOrigin
+public class StopTypeController {
+
+
+
+    @Autowired
+    private StopTypeService stopTypeService;
+
+
+
+    @CrossOrigin(origins = "*",maxAge = 3600)
+    @GetMapping(value = "/treeType")
+    public AjaxResult  getRecentFault()throws Exception {
+        try {
+            List<StopType> types= stopTypeService.queryStopTypeList();
+            return AjaxResult.successData(200,types);
+        } catch (Exception e) {
+            return AjaxResult.error();
+        }
+
+    }
+}

+ 120 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/Warning2Controller.java

@@ -0,0 +1,120 @@
+package com.gyee.wisdom.alarm.sharding.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gyee.wisdom.alarm.sharding.entity.Scadabj;
+import com.gyee.wisdom.alarm.sharding.entity.Scadafault;
+import com.gyee.wisdom.alarm.sharding.entity.Warning2;
+import com.gyee.wisdom.alarm.sharding.service.ScadafaultService;
+import com.gyee.wisdom.alarm.sharding.service.UserLoginToken;
+import com.gyee.wisdom.alarm.sharding.service.Warning2Service;
+import com.gyee.wisdom.alarm.sharding.util.ResponseWrapper;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Slf4j
+@RestController
+@RequestMapping("/warning2")
+@CrossOrigin
+public class Warning2Controller {
+
+    @Autowired
+    private Warning2Service warning2Service;
+
+    //@UserLoginToken
+    @PostMapping(value = "/save")
+    @ResponseBody
+    public ResponseWrapper saveWarning(@RequestBody Warning2 warning2) {
+        ResponseWrapper<Warning2> wrapper = dataCheck(warning2);
+        if (wrapper.getSuccess()) {
+            int result = warning2Service.saveAndUpdateWarning2(warning2);
+            if (result <= 0) {
+                wrapper.setSuccess(false);
+                wrapper.setMsg("操作数据库失败");
+            }
+        }
+        return wrapper;
+    }
+
+    //@UserLoginToken
+    @PostMapping(value = "/save-batch")
+    @ResponseBody
+    public ResponseWrapper saveWarningBatch( @RequestBody List<Warning2> lst) {
+        boolean allCheck = true;
+        ResponseWrapper<Warning2> wrapper = null;
+        for (Warning2 warning : lst) {
+            wrapper = dataCheck(warning);
+            if (wrapper.getSuccess() != true) {
+                allCheck = false;
+                String msg = wrapper.getMsg();
+                wrapper.setMsg(warning.getChineseText() + ":" + msg);
+                break;
+            }
+        }
+        if (allCheck) {
+            for (Warning2 warning : lst) {
+                int result = warning2Service.saveAndUpdateWarning2(warning);
+                if (result <= 0) {
+                    wrapper.setMsg(warning.getChineseText() + ":" + "操作数据库失败");
+                    wrapper.setSuccess(false);
+                    break;
+                }
+            }
+            return wrapper;
+        } else {
+            return wrapper;
+        }
+
+
+    }
+
+
+    @DeleteMapping(value = "/delete")
+    public int deleteScadafault(Warning2 warning2) {
+        return warning2Service.deleteWarning2(warning2);
+    }
+
+    //@UserLoginToken
+    @GetMapping(value = "/page")
+    public IPage<Warning2> queryByPage(
+            @RequestParam(value = "pagenum") Integer pageNum,
+            @RequestParam(value = "pagesize") Integer pageSize,
+            @RequestParam(value = "modelId", required = false) String modelId,
+            @RequestParam(value = "name", required = false) String name,
+            @RequestParam(value = "isLeaf", required = false) String isLeaf
+    ) {
+        Page<Warning2> page = new Page(pageNum, pageSize);
+        return warning2Service.pageQueryAll(page, modelId, name, isLeaf);
+    }
+
+    private ResponseWrapper<Warning2> dataCheck(Warning2 warning) {
+
+        ResponseWrapper<Warning2> wrapper = null;
+        String msg = "";
+        boolean result = true;
+        if (warning.getModelId() != null && warning.getModelId().equals("")) {
+            msg = "风机型号不能为空";
+            result = false;
+        } else if (warning.getEdnaValue() == 0) {
+            msg = "统一编码不能为空";
+            result = false;
+        } else if (warning.getChineseText() != null && warning.getChineseText().equals("")) {
+            msg = "报警名称不能为空";
+            result = false;
+        } else if (StringUtils.isBlank(warning.getLevelId())) {
+            msg = "报警级别不能为空";
+            result = false;
+        }
+        if (result) {
+            wrapper = ResponseWrapper.success(msg, warning);
+        } else {
+            wrapper = ResponseWrapper.error(msg, warning);
+        }
+        return wrapper;
+    }
+}

+ 37 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/controller/WindpowerstationController.java

@@ -0,0 +1,37 @@
+package com.gyee.wisdom.alarm.sharding.controller;
+
+import com.gyee.wisdom.alarm.sharding.entity.Equipmentmodel;
+import com.gyee.wisdom.alarm.sharding.entity.WindPowerStation;
+import com.gyee.wisdom.alarm.sharding.service.EquipmentmodelService;
+import com.gyee.wisdom.alarm.sharding.service.WindpowerstationService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 风机接口
+ */
+@Slf4j
+@RestController
+@RequestMapping("/windpowerstation")
+@CrossOrigin
+public class WindpowerstationController {
+    @Autowired
+    private WindpowerstationService windpowerstationService;
+
+    @Autowired
+    private EquipmentmodelService equipmentmodelService;
+
+    @GetMapping()
+    public WindPowerStation getAllWindPowerStation(@RequestParam(value = "id", required = false) String id) {
+        if(id.isEmpty()){
+            List<Equipmentmodel> equipmentmodels =  equipmentmodelService.getAllEquipmentmodel();
+            WindPowerStation windPowerStation = new WindPowerStation();
+            windPowerStation.setEquipmentmodel(equipmentmodels);
+            return windPowerStation;
+        }
+        return windpowerstationService.getAllWindPowerStation(id);
+    }
+}

+ 24 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/AlarmCount.java

@@ -0,0 +1,24 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class AlarmCount implements Serializable{
+
+    @TableId("ID")
+    private Long id;
+    @TableField("ALARMDATE")
+    private Date alarmDate;
+    @TableField("SNAPID")
+    private Long snapId;
+    @TableField("COUNT")
+    private int count;
+    @TableField("time")
+    private Double time;
+
+}

+ 26 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/AlarmHistory.java

@@ -0,0 +1,26 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class AlarmHistory implements Serializable{
+
+    @TableId("ID")
+    private Long id;
+    @TableField("ALERTTIME")
+    private Date alertTime;
+    @TableField("MESSAGETYPE")
+    private int messageType;
+    @TableField("SNAPID")
+    private Long snapId;
+    @TableField("DATAINFO")
+    private String dataInfo;
+    //仅针对升压站报警使用  测点值为0时字段为--分位,测点值为1时字段为--合位
+    @TableField("ALERTTEXTLAST")
+    private String alertTextLast;
+}

+ 18 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/AlarmInformation.java

@@ -0,0 +1,18 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class AlarmInformation implements Serializable{
+
+    private Long snapId;
+
+    private int sum;
+
+    private String alarmtext;
+
+    private Double times;
+
+}

+ 75 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/AlarmSnap.java

@@ -0,0 +1,75 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@TableName("ALARMSNAP")
+public class AlarmSnap implements Serializable{
+
+    @TableId("ID")
+    private Long id;
+    @TableField("STATIONID")
+    private String stationId;
+    @TableField("PROJECTID")
+    private String projectId;
+    @TableField("LINEID")
+    private String lineId;
+    @TableField("WINDTURBINEID")
+    private String windturbineId;
+    @TableField("ALERTVALUE")
+    private int alertValue;
+    @TableField("CATEGORY1")
+    private String category1;
+    @TableField("CATEGORY2")
+    private String category2;
+    @TableField("CATEGORY3")
+    private String category3;
+    @TableField("RANK")
+    private String rank;
+    @TableField("ISOPENED")
+    private int isOpened;
+    @TableField("LASTUPDATETIME")
+    private Date lastUpdateTime;
+    @TableField("STATIONNAME")
+    private String stationName;
+    @TableField("PROJECTNAME")
+    private String projectName;
+    @TableField("LINENAME")
+    private String lineName;
+    @TableField("WINDTURBINENAME")
+    private String windturbineName;
+    @TableField("ALERTTEXT")
+    private String alertText;
+    @TableField("MODELID")
+    private String modelId;
+    @TableField("TESTINGPOINTKEY")
+    private String testingpointKey;
+    @TableField("DATAINFO")
+    private String dataInfo;
+    @TableField("ISCONFIRMED")
+    private int isconfirmed;
+    @TableField("CONFIRMTIME")
+    private Date confirmtime;
+    @TableField("LASTUPDATEPERSON")
+    private String lastUpdatePerson;
+    @TableField("IFIXPICTURE")
+    private String ifixpicture;
+    @TableField("IFIXTAG")
+    private String ifixtag;
+    @TableField("LASTCLOSETIME")
+    private Date lastCloseTime;
+    @TableField("LASTCLOSEPERSON")
+    private String lastClosePerson;
+    @TableField("CONFIRMPERSON")
+    private String confirmPerson;
+
+
+
+   // private int isNew = 0;
+}

+ 25 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/AlarmStat.java

@@ -0,0 +1,25 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class AlarmStat implements Serializable{
+
+    private Long snapid;
+
+    private String wtnum;
+
+    private String text;
+
+    private int sum;
+
+    private Windturbine wtnumobj;
+
+    private Double times;
+
+}

+ 26 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/AlarmStat1.java

@@ -0,0 +1,26 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class AlarmStat1 implements Serializable{
+
+    private Long snapId;
+
+    private String stationId;
+
+    private String windturbineId;
+
+    private String alertText;
+
+    private int count;
+
+    private double time;
+    //关联部件编号
+    private String relateParts;
+    //关联部件名称
+    private String relatePartsText;
+
+}

+ 19 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/AlarmStatLine.java

@@ -0,0 +1,19 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class AlarmStatLine implements Serializable{
+
+
+
+    private String linenum;
+
+    private String projectnum;
+
+    private int sum;
+
+    private int happendsum;
+}

+ 37 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/AlarmUser.java

@@ -0,0 +1,37 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @descrition:报警配置工具用户
+ * @author:Wanghs
+ * @date:2020-04-24
+ */
+@Data
+@TableName("ALARM_USER")
+public class AlarmUser implements Serializable {
+    @JsonFormat(shape = JsonFormat.Shape.STRING)
+    @TableId("ID")
+    private long Id;
+    @TableField("USERNAME")
+    private String userName;
+    @TableField("PASSWORD")
+    private String passWord;
+    @TableField(exist = false)
+    private String newPassWord;
+    @TableField("CHINESENAME")
+    private String chineseName;
+    @TableField("ENABLED")
+    private int enabled;
+    @TableField("IDENTITY")
+    private String identity;
+    public String getIds(){
+        return Id + "";
+    }
+}

+ 33 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/AlertKnowledge.java

@@ -0,0 +1,33 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @descrition: 风机报警信息(产生后果,产生原因,排查方法,处理方法)
+ * @author:Wanghs
+ * @date:2020-07-13
+ */
+@Data
+public class AlertKnowledge implements Serializable {
+    @TableId("ID")
+    private  long id;
+    //预警名称
+    @TableField("NAME")
+    private String alertName;
+    //产生后果
+    @TableField("CONSEQUENCE")
+    private String consequence;
+    //产生原因
+    @TableField("REASON")
+    private String reason;
+    //排查方法
+    @TableField("INVESTIGATION")
+    private String investigation;
+    //处理方法
+    @TableField("DISPOSE")
+    private String dispose;
+}

+ 58 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/Alertrule2.java

@@ -0,0 +1,58 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@TableName("ALERTRULE2")
+public class Alertrule2 implements Serializable {
+
+    @TableId("ID")
+    private String id;
+    @TableField("NAME")
+    private String name;
+    @TableField("DESCRIPTION")
+    private String description;
+    @TableField("EXPRESSION")
+    private String expression;
+    @TableField("TAG")
+    private String tag;
+    @TableField("RANK")
+    private String rank;
+    @TableField("ENABLED")
+    private String enabled;
+    @TableField("MODELID")
+    private String modelId;
+    @TableField("EDNAVALUE")
+    private String ednaValue;
+    @TableField("CATEGORY")
+    private String category;
+    @TableField("RANGE")
+    private String range;
+    @TableField("STATION")
+    private String station;
+    @TableField("WINDTURBINE")
+    private String windturbine;
+    @TableField("LINE")
+    private String line;
+    @TableField("PROJECT")
+    private String project;
+    @TableField("ELECTRICAL")
+    private String electrical;
+    @TableField("TASKSTART")
+    private String taskstart;
+    @TableField("RELATEDPARTS")
+    private String relatedParts;//关联部件
+    @TableField(exist = false)
+    private String userName;//操作人
+    @TableField("CREATETIME")
+    private Date createtime;//操作时间
+
+    private WindPowerStation windPowerStation;
+    private Datadictionary datadictionary;
+}

+ 23 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/Datadictionary.java

@@ -0,0 +1,23 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+@Data
+@TableName("DATADICTIONARY")
+public class Datadictionary {
+    @TableId("ID")
+    private int id;
+    @TableField("CATEGORY")
+    private String category;
+    @TableField("CODE")
+    private String code;
+    @TableField("NAME")
+    private String name;
+    @TableField("ORDERNO")
+    private int orderno;
+    @TableField("ENABLED")
+    private int enabled;
+}

+ 25 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/Device.java

@@ -0,0 +1,25 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 设备
+ */
+@Data
+public class Device implements Serializable{
+
+    private String id;
+
+    private String name;
+
+    private String enname;
+
+    private String description;
+
+    private int orderno;
+
+    private boolean enabled;
+
+}

+ 39 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/DeviceFaultMode.java

@@ -0,0 +1,39 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 设备故障模式
+ */
+@Data
+public class DeviceFaultMode implements Serializable{
+
+//    ID                   NUMBER               not null,
+//    CODE                 VARCHAR2(50),
+//    NAME                 VARCHAR2(100),
+//    EFFECTS              VARCHAR2(4000),
+//    CAUSE                VARCHAR2(4000),
+//    MEASURE              VARCHAR2(4000),
+//    SEVERITY             NUMBER(1),
+//    OCCURENCE            NUMBER(1),
+//    DETECTION            NUMBER(1),
+//    DEVICEID             VARCHAR2(50),
+//    STRUCTURECODE        VARCHAR2(50),
+//    MODELS               VARCHAR2(50),
+
+    private long id;
+    private String code;
+    private String name;
+    private String effects;
+    private String cause;
+    private String measure;
+    private int severity;
+    private int occurence;
+    private int detection;
+    private String deviceid;
+    private String structurecode;
+    private String models;
+
+}

+ 27 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/DeviceFaultModeMetrics.java

@@ -0,0 +1,27 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 设备故障模式与测点关联
+ */
+@Data
+public class DeviceFaultModeMetrics implements Serializable{
+
+//    ID                   NUMBER,
+//    DEVICEID             VARCHAR2(50),
+//    FAULTMODE            VARCHAR2(50),
+//    METRICCODE           VARCHAR2(50),
+//    LOWERLIMIT           NUMBER,
+//    UPPERLIMIT           NUMBER
+
+    private long id;
+    private String deviceid;
+    private String faultmode;
+    private String metriccode;
+    private double lowerlimit;
+    private double upperlimit;
+
+}

+ 70 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/DeviceMetrics.java

@@ -0,0 +1,70 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 设备度量指标
+ */
+@Data
+public class DeviceMetrics implements Serializable{
+
+    @JsonFormat(shape = JsonFormat.Shape.STRING)
+    private long id;
+
+    private String deviceid;
+
+    private String structurecode;
+
+    private String metriccode;
+
+    private String name;
+
+    private String enname;
+
+    private String unitname;
+
+    private String unitnamecn;
+
+    private String categorydata;
+
+    private String categorysci;
+
+    private String categorysys;
+
+    private String categoryres1;
+
+    private String categoryres2;
+
+    private String categoryres3;
+
+    private String categoryres4;
+
+    private String categoryres5;
+
+    private String description;
+
+    private List<DeviceModelMetrics> deviceModelMetrics;
+
+
+//    ID                   NUMBER               not null,
+//    DEVICEID             VARCHAR2(50)         not null,
+//    STRUCTURECODE        VARCHAR2(50),
+//    METRICCODE           VARCHAR2(50)         not null,
+//    NAME                 VARCHAR2(50),
+//    ENNAME               VARCHAR2(50),
+//    UNITNAME             VARCHAR2(50),
+//    UNITNAMECN           VARCHAR2(50),
+//    CATEGORYDATA         VARCHAR2(50),
+//    CATEGORYSCI          VARCHAR2(50),
+//    CATEGORYSYS          VARCHAR2(50),
+//    CATEGORYRES1         VARCHAR2(50),
+//    CATEGORYRES2         VARCHAR2(50),
+//    CATEGORYRES3         VARCHAR2(50),
+//    CATEGORYRES4         VARCHAR2(50),
+//    CATEGORYRES5         VARCHAR2(50),
+//    DESCRIPTION          VARCHAR2(500),
+}

+ 38 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/DeviceModel.java

@@ -0,0 +1,38 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 设备型号
+ */
+@Data
+public class DeviceModel implements Serializable{
+
+    private int id;
+
+    private String code;
+
+    private String deviceid;
+
+    private String name;
+
+    private String enname;
+
+    private String description;
+
+    private int orderno;
+
+    private boolean enabled;
+
+//    ID                   NUMBER               not null,
+//    DEVICEID             VARCHAR2(50)         default '1' not null,
+//    CODE                 VARCHAR2(50)         not null,
+//    NAME                 VARCHAR2(50)         not null,
+//    ENNAME               VARCHAR2(50),
+//    DESCRIPTION          VARCHAR2(500),
+//    ORDERNO              NUMBER,
+//    ENABLED              NUMBER(1)            default 1 not null,
+
+}

+ 33 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/DeviceModelMetrics.java

@@ -0,0 +1,33 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 设备型号
+ */
+@Data
+public class DeviceModelMetrics implements Serializable{
+
+    private int id;
+
+    private String deviceid;
+
+    private String devicemodel;
+
+    //private String modelcode;
+
+    private String metriccode;
+
+    private String uniformcode;
+
+    private double multiplier;
+
+//    ID                   NUMBER,
+//    MODELCODE            VARCHAR2(50),
+//    METRICCODE           VARCHAR2(50),
+//    UNIFORMCODE          VARCHAR2(50),
+//    MULTIPLIER           NUMBER
+
+}

+ 33 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/DeviceStructure.java

@@ -0,0 +1,33 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 设备结构
+ */
+@Data
+public class DeviceStructure implements Serializable{
+
+    @JsonFormat(shape = JsonFormat.Shape.STRING)
+    private long id;
+
+    private String code;
+
+    private String parentcode;
+
+    private String deviceid;
+
+    private String name;
+
+    private String enname;
+
+    private String description;
+
+    private int orderno;
+
+    private boolean enabled;
+
+}

+ 27 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/ElectricalTestingPointAI.java

@@ -0,0 +1,27 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @descrition: 电气AI点实体
+ * @author:Wanghs
+ * @date:2019-12-26
+ */
+@Data
+@TableName("ELECTRICALTESTINGPOINTAI")
+public class ElectricalTestingPointAI implements Serializable {
+    @TableId("ID")
+    private String id;
+    @TableField("NAME")
+    private String name;
+    @TableField("UNIFORMCODE")
+    private String uniformCode;
+    @TableField("WINDPOWERSTATIONID")
+    private String windPowerStationId;
+
+}

+ 24 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/ElectricalTestingPointDI.java

@@ -0,0 +1,24 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+/**
+ * @descrition: 电气DI点
+ * @author:Wanghs
+ * @date:2019-12-26
+ */
+@Data
+@TableName("ELECTRICALTESTINGPOINTDI")
+public class ElectricalTestingPointDI {
+    @TableId("ID")
+    private String id;
+    @TableField("NAME")
+    private String name;
+    @TableField("UNIFORMCODE")
+    private String uniformCode;
+    @TableField("WINDPOWERSTATIONID")
+    private String windPowerStationId;
+}

+ 37 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/Equipmentmodel.java

@@ -0,0 +1,37 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+@Data
+@TableName("EQUIPMENTMODEL")
+public class Equipmentmodel {
+    @TableId("ID")
+    private String id;
+    @TableField("CODE")
+    private String code;
+    @TableField("NAME")
+    private String name;
+    @TableField("DESCRIPTION")
+    private String desciripition;
+    @TableField("POWERPRODUCTION")
+    private long powerproduction;
+    @TableField("CUTINWINDSPEED")
+    private long cutinwindspeed;
+    @TableField("RATEDWINDSPEED")
+    private long ratedwindspeed;
+    @TableField("CUTOUTWINDSPEED")
+    private String cutoutwindspeed;
+    @TableField("WINDTURBINEMANUFACTURERID")
+    private String windturbinemanufacturerid;
+    @TableField("PHOTO")
+    private String photo;
+    @TableField("UNIT")
+    private String unit;
+    @TableField("SWEPTAREA")
+    private long sweptarea;
+    @TableField("EQUIPMENTCATEGORY")
+    private long equipmentcategory;
+}

+ 38 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/FaultHistory.java

@@ -0,0 +1,38 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@TableName("FAULTHISTORY")
+public class FaultHistory implements Serializable{
+
+    @TableId("ID")
+    private Long id;
+    @TableField("FAULTTIME")
+    private Date faultTime;
+    @TableField("OPERATOR")
+    private String operator;
+    @TableField("SNAPID")
+    private Long snapId;
+    @TableField("CONFIRMTYPE")
+    private Integer confirmType;
+    @TableField("CONFIRMTIME")
+    private Date confirmTime;
+    @TableField("CONFIRMPERSON")
+    private String confirmPerson;
+    @TableField("MESSAGETYPE")
+    private int messageType;
+    @TableField("ALERTSNAPID")
+    private Long alertSnapId;
+    //仅针对升压站报警使用  测点值为0时字段为--分位,测点值为1时字段为--合位
+    @TableField("ALERTTEXTLAST")
+    private String alertTextLast;
+
+
+}

+ 103 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/FaultInfo.java

@@ -0,0 +1,103 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+@Data
+public class FaultInfo implements Serializable {
+
+
+    private long id;
+    //报警时间
+    private Date faultTime;
+    //对象类型
+    private int messageType;
+    //报警内容
+    private long snapID;
+
+    private Integer confirmType;
+
+    private Date confirmTime;
+
+    private String confirmPerson;
+
+    private String stationId;
+
+    private String projectId;
+
+    private String lineId;
+
+    private String windturbineId;
+    //报警对应故障编码
+    private long alertValue;
+    //报警级别
+    private String rank;
+
+    private String category1;
+
+    private String category2;
+
+    private String category3;
+
+    private boolean isOpened;
+
+    private Date lastUpdateTime;
+
+    private String lastUpdatePerson;
+
+    private String stationName;
+
+    private String projectName;
+
+    private String lineName;
+
+    private String windturbineName;
+
+    private String alertText;
+
+    private String modelId;
+
+    public String getObjectName() {
+        if (category1 == "FJ")
+            return windturbineName;
+        else
+            return stationName;
+    }
+
+    public String getObjectId() {
+        if (category1.equals("FJ"))
+            return windturbineId;
+        else
+            return stationId;
+    }
+
+    public String getCategoryName() {
+        switch (category1) {
+            case "FJ":
+                return "风机";
+            case "SYZ":
+                return "升压站";
+            default:
+                return "未知";
+        }
+    }
+
+    public String getMessageTypeString() {
+        String resultString = "";
+        if (messageType == 1) {
+            resultString = "触发";
+        } else if (messageType == 2) {
+            resultString = "";
+        } else if (messageType == 3) {
+            resultString = "解除";
+        }
+        return resultString;
+    }
+
+    public String getIdString() {
+        return id + "";
+    }
+}

+ 62 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/FaultSnap.java

@@ -0,0 +1,62 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@TableName("FAULTSNAP")
+public class FaultSnap implements Serializable{
+
+    @TableId("ID")
+    private Long id;
+    @TableField("STATIONID")
+    private String stationId;
+    @TableField("PROJECTID")
+    private String projectId;
+    @TableField("LINEID")
+    private String lineId;
+    @TableField("WINDTURBINEID")
+    private String windturbineId;
+    @TableField("ALERTVALUE")
+    private int alertValue;
+    @TableField("CATEGORY1")
+    private String category1;
+    @TableField("CATEGORY2")
+    private String category2;
+    @TableField("CATEGORY3")
+    private String category3;
+    @TableField("RANK")
+    private String rank;
+    @TableField("ISOPENED")
+    private int isOpened;
+    @TableField("LASTUPDATETIME")
+    private Date lastUpdateTime;
+    @TableField("LASTUPDATEPERSON")
+    private String lastUpdatePerson;
+    @TableField("STATIONNAME")
+    private String stationName;
+    @TableField("PROJECTNAME")
+    private String projectName;
+    @TableField("LINENAME")
+    private String lineName;
+    @TableField("WINDTURBINENAME")
+    private String windturbineName;
+    @TableField("ALERTTEXT")
+    private String alertText;
+    @TableField("MODELID")
+    private String modelId;
+    @TableField("TESTINGPOINTKEY")
+    private String testingpointKey;
+    @TableField("ALARMSNAPID")
+    private long alarmSnapId;
+    //接收AlarmSnap 中dataInfo值
+    @TableField(exist = false)
+    private String dataInfo;
+    
+
+}

+ 91 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/FaultStatisticWindturbine.java

@@ -0,0 +1,91 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+@TableName("FAULTSTATISTICWINDTURBINE")
+public class FaultStatisticWindturbine implements Serializable {
+    /**
+     * id
+     */
+    @TableId("ID")
+    private Long id;
+    //报警值
+    @TableField("EDNAVALUE")
+    private String ednavalue;
+
+    /**
+     * 故障分类
+     */
+    @TableField("WARNINGTYPE")
+    private String warningtype;
+
+    /**
+     * 年份
+     */
+    @TableField("YEAR")
+    private String year;
+
+    /**
+     * 月份
+     */
+    @TableField("MONTH")
+    private String month;
+
+    /**
+     * 风机id
+     */
+    @TableField("WINDTURBINEID")
+    private String windturbineid;
+
+    /**
+     * 风场编号
+     */
+    @TableField("WINDPOWERSTATIONID")
+    private String windpowerstationid;
+
+    /**
+     * 当月故障次数
+     */
+    @TableField("MONTHWARNINGNUM")
+    private double monthwarningnum;
+
+    /**
+     * 当月故障时长
+     */
+    @TableField("MONTHWARNINGTIME")
+    private double monthwarningtime;
+
+    /**
+     * 上月故障次数
+     */
+    @TableField("MONTHONMONTHNUM")
+    private double monthonmonthnum;
+
+    /**
+     * 上月故障时长
+     */
+    @TableField("MONTHONMONTHTIME")
+    private double monthonmonthtime;
+
+    /**
+     * 上年同月故障次数
+     */
+    @TableField("YEAROVERYEARNUM")
+    private double yearoveryearnum;
+
+    /**
+     * 上年同月故障时长
+     */
+    @TableField("YEAROVERYEARTIME")
+    private double yearoveryeartime;
+
+
+
+}

+ 21 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/FaultWarning.java

@@ -0,0 +1,21 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class FaultWarning implements Serializable {
+
+    private String id;
+    private String snapid;
+    private String stationid;
+    private String windturbineid;
+    private String windturbinename;
+    private String lastupdatetime;
+    private String ednavalue;
+    private String alerttime;
+    private String warningtypeid;
+
+
+}

+ 52 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/FeatureStat.java

@@ -0,0 +1,52 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @descrition:液压泵运行统计实体
+ * @author:Wanghs
+ * @date:2019-11-19
+ */
+@Data
+@TableName("FEATURE_STAT")
+public class FeatureStat implements Serializable {
+
+    @TableId("ID")
+    private Long id;
+    //风机编号
+    @TableField("WTID")
+    private String wtId;
+   //风场编号
+    @TableField("STATIONID")
+    private String stationId;
+    //统计日期
+    @TableField("STATDATE")
+    private Date statDate;
+    //发生次数
+    @TableField("TOTAL")
+    private int total;
+    //总时长(秒)
+    @TableField("TOTALSECONDS")
+    private int totalSeconds;
+    //平均时长(秒)
+    @TableField("AVGSECONDS")
+    private int avgSeconds;
+    //最大时长
+    @TableField("MAXSECONDS")
+    private int maxSeconds;
+    //最小时长
+    @TableField("MINSECONDS")
+    private int minSeconds;
+    //最小时长
+    @TableField("TYPECODE")
+    private String typeCode;
+    //最小时长
+    @TableField("TYPENAME")
+    private String typeName;
+}

+ 55 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/MainBrownouts2.java

@@ -0,0 +1,55 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@TableName("MAINBROWNOUTS2")
+public class MainBrownouts2 implements Serializable {
+
+    @TableId("ID")
+    private String ID;
+
+    @TableField("STOPTIME")
+    private Date stoptime;
+
+    @TableField("STARTTIME")
+    private Date starttime;
+
+    @TableField("STOPTYPEID")
+    private String stoptypeid;
+
+    @TableField("DESCRIPTION")
+    private String description;
+
+    @TableField("LIMITLOAD")
+    private int limitload;
+
+    @TableField("BROWNOUTSDIRECTIVE")
+    private String brownoutsdirective;
+
+    @TableField("WINDSPEED")
+    private int windspeed;
+
+    @TableField("THISLOAD")
+    private int thisload;
+
+    @TableField("WINDPOWERSTATIONID")
+    private String windpowerstationid;
+
+    @TableField("WPNAME")
+    private String wpname;
+
+    @TableField("LOSSPOWER")
+    private int losspower;
+
+    @TableField("STOPHOURS")
+    private int stophours;
+
+}

+ 42 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/Scadabj.java

@@ -0,0 +1,42 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@TableName("SCADABJ")
+public class Scadabj implements Serializable {
+
+    @TableId("ID")
+    private Long id;
+    @TableField("POINTKEY")
+    private String pointKey;
+    @TableField("DESCRIPTION")
+    private String description;
+    @TableField("CATEGORY1")
+    private String category1;
+    @TableField("CATEGORY2")
+    private String category2;
+    @TableField("CATEGORY3")
+    private String category3;
+    @TableField("CATEGORY4")
+    private String category4;
+    @TableField("STATIONID")
+    private String stationId;
+    @TableField("DEVICEID")
+    private String deviceId;
+    @TableField("RANK")
+    private String rank;
+    @TableField("ENABLED")
+    private int enabled=-1;
+    @TableField("ALARMTYPE")
+    private int alarmType = -1;
+    @TableField(exist = false)
+    public String userName;//操作人
+
+}

+ 35 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/Scadafault.java

@@ -0,0 +1,35 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+@TableName("SCADAFAULT")
+public class Scadafault implements Serializable {
+    @TableId("ID")
+    private Long id;
+    @TableField("POINTKEY")
+    private String pointKey;
+    @TableField("DESCRIPTION")
+    private String description;
+    @TableField("CATEGORY1")
+    private String category1;
+    @TableField("CATEGORY2")
+    private String category2;
+    @TableField("CATEGORY3")
+    private String category3;
+    @TableField("CATEGORY4")
+    private String category4;
+    @TableField("STATIONID")
+    private String stationId;
+    @TableField("DEVICEID")
+    private String deviceId;
+    @TableField("RANK")
+    private String rank;
+    @TableField("ENABLED")
+    private int enabled;
+}

+ 58 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/ShutdownEvent.java

@@ -0,0 +1,58 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@TableName("SHUTDOWNEVENT")
+public class ShutdownEvent implements Serializable {
+
+    @TableId("ID")
+    private String	id;
+    @TableField("WINDPOWERSTATIONID")
+    private String	windPowerStationId;
+    @TableField("WINDTURBINEID")
+    private String windturbineId;
+    @TableField("STOPTIME")
+    private Date stopTime;
+    @TableField("STARTTIME")
+    private Date startTime;
+    @TableField("STOPHOURS")
+    private int	stopHours;
+    @TableField("LOSSPOWER")
+    private int losspower;
+    @TableField("STOPTYPEID")
+    private String stoptypeId;
+    @TableField("SHANDLE")
+    private int	shandle;
+    @TableField("WARNINGID")
+    private String	warningId;
+    @TableField("PROJECTID")
+    private String projectId;
+    @TableField("HANDLEWAY")
+    private String handleway;
+    @TableField("FAULTVIEW")
+    private String faultView;
+    @TableField("STATUSCODE")
+    private int	statusCode;
+    @TableField("MAINID")
+    private String mainId;
+    @TableField("RESETRATE")
+    private String resetrate;
+    @TableField("STATERATE")
+    private String staterate;
+    @TableField("FAILRATE")
+    private String failrate;
+    @TableField("WARNINGRECORDSID")
+    private int	warningrecordsId;
+    @TableField("TASKSTATUS")
+    private String taskStatus;
+    @TableField("PREFLIGHT")
+    private String	preflight;
+
+}

+ 28 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/StopType.java

@@ -0,0 +1,28 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+@Data
+@TableName("STOPTYPE")
+public class StopType implements Serializable {
+    @TableId("ID")
+    private String	id;
+    @TableField("NAME")
+    private String	name;
+    @TableField("ISPLAN")
+    private int	isplan;
+    @TableField("PARENTID")
+    private String	parentid;
+    @TableField("NWYS")
+    private String	nwys;
+
+
+
+
+}

+ 20 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/StopTypeCount.java

@@ -0,0 +1,20 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class StopTypeCount implements Serializable{
+
+
+
+    private String stationId;
+    private String windturbineId;
+    private String type;
+    private String typeID;
+    private int count;
+    private double time;
+
+
+}

+ 40 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/TestingPointAI.java

@@ -0,0 +1,40 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2019-11-29
+ */
+@Data
+public class TestingPointAI implements Serializable{
+
+    @TableId("ID")
+    private String id;
+
+    @TableField("NAME")
+    private String name;
+
+    @TableField("MODEL")
+    private String model;
+
+    @TableField("VALUEUNIT")
+    private String valueUnit;
+
+    @TableField("ENGLISHNAME")
+    private String englishName;
+
+    @TableField("TYPEID")
+    private String typeId;
+
+    @TableField("MODELID")
+    private String modelId;
+
+    @TableField("UNIFORMCODE")
+    private String uniformCode;
+}

+ 39 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/TestingPointDI.java

@@ -0,0 +1,39 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2019-11-29
+ */
+@Data
+public class TestingPointDI implements Serializable {
+    @TableId("ID")
+    private String id;
+
+    @TableField("NAME")
+    private String name;
+
+    @TableField("MODEL")
+    private String model;
+
+    @TableField("VALUEUNIT")
+    private String valueUnit;
+
+    @TableField("ENGLISHNAME")
+    private String englishName;
+
+    @TableField("TYPEID")
+    private String typeId;
+
+    @TableField("MODELID")
+    private String modelId;
+
+    @TableField("UNIFORMCODE")
+    private String uniformCode;
+}

+ 54 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/Warning2.java

@@ -0,0 +1,54 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+@TableName("WARNING2")
+public class Warning2 implements Serializable {
+    @TableId("ID")
+    private String id;
+    @TableField("LEVELID")
+    private String levelId;
+    @TableField("MANUFACTURERCODE")
+    private String manufacturerCode;
+    @TableField("ENGLISHTEXT")
+    private String neglishText;
+    @TableField("CHINESETEXT")
+    private String chineseText;
+    @TableField("PARENTID")
+    private String parentId;
+    @TableField("ISLEAF")
+    private int isleaf;
+    @TableField("SEQUENCENUMBER")
+    private int sequenceNumber;
+    @TableField("CHARACTERISTIC")
+    private String characteristic;
+    @TableField("MODELID")
+    private String modelId;
+    @TableField("CODENAME")
+    private String codeName;
+    @TableField("EDNAVALUE")
+    private int ednaValue;
+    @TableField("DISPLAY")
+    private int display;
+    @TableField("WARNINGCLASSIFYID")
+    private String warningClassIfyId;
+    @TableField("STANDARDTIME")
+    private int standardTime;
+    @TableField("ISRESET")
+    private int isreset;
+    @TableField("WARNINGTYPEID")
+    private String warningTypeId;
+    @TableField("FAULTCODE")
+    private String faultCode;
+    @TableField("RELATEDPARTS")
+    private String relatedParts;//关联部件
+
+    @TableField(exist = false)
+    private String userName;//操作人
+}

+ 22 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/WarningClassify.java

@@ -0,0 +1,22 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @descrition: 报警分类
+ * @author:Wanghs
+ * @date:2020-01-08
+ */
+@Data
+@TableName("WARNINGCLASSIFY")
+public class WarningClassify  implements Serializable {
+    @TableId("ID")
+    private String id;
+
+    @TableId("NAME")
+    private String name;
+}

+ 28 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/WarningType.java

@@ -0,0 +1,28 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @descrition:报警分类
+ * @author:Wanghs
+ * @date:2020-01-08
+ */
+@Data
+@TableName("WARNINGTYPE")
+public class WarningType  implements Serializable {
+    @TableId("ID")
+    private String id;
+
+    @TableId("NAME")
+    private String name;
+
+    @TableId("UNIT")
+    private String unit;
+
+    @TableId("LOGICALUNITID")
+    private String logicalUnitid;
+}

+ 25 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/Warningrecords.java

@@ -0,0 +1,25 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class Warningrecords {
+
+  private Long id;
+  private String windpowerstationid;
+  private String windturbineid;
+  private String warningid;
+  private Date warningtime;
+  private String isconfirm;
+  private String ishandle;
+  private String handle;
+  private String shutdowneventid;
+  private String levelid;
+  private String wtaiid;
+  private String durationhour;
+  private String isfilter;
+
+}

+ 71 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/WindPowerStation.java

@@ -0,0 +1,71 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @descrition:场站实体
+ * @author:Wanghs
+ * @date:2019-11-29
+ */
+public class WindPowerStation implements Serializable {
+
+    @TableId("ID")
+    private String id;
+
+    @TableField("NAME")
+    private String name;
+
+    @TableField("MODEL")
+    private String model;
+
+    private List<String> modelList;
+
+    private List<Equipmentmodel> Equipmentmodel;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getModel() {
+        return model;
+    }
+
+    public void setModel(String model) {
+        this.model = model;
+        this.modelList = Arrays.asList(model.split("/"));
+    }
+
+    public List<String> getModelList() {
+        return modelList;
+    }
+
+    public void setModelList(List<String> modelList) {
+        this.modelList = modelList;
+    }
+
+    public List<com.gyee.wisdom.alarm.sharding.entity.Equipmentmodel> getEquipmentmodel() {
+        return Equipmentmodel;
+    }
+
+    public void setEquipmentmodel(List<com.gyee.wisdom.alarm.sharding.entity.Equipmentmodel> equipmentmodel) {
+        Equipmentmodel = equipmentmodel;
+    }
+}

+ 24 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/Windturbine.java

@@ -0,0 +1,24 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+@Data
+public class Windturbine implements Serializable {
+    private String id;
+    private String code;
+    private String windpowerstationid;
+    private Double longitude;
+    private Double latitude;
+    private String modelid;
+    private String status;
+    private String projectid;
+    private String lineid;
+    private Date firstintegratedtime;
+    private String photo;
+    private String name;
+    private String standardid;
+}

+ 23 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/entity/WindturbineParts.java

@@ -0,0 +1,23 @@
+package com.gyee.wisdom.alarm.sharding.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @descrition:风机部件
+ * @author:Wanghs
+ * @date:2019-12-25
+ */
+@Data
+public class WindturbineParts implements Serializable{
+
+    private String id;
+
+    private String name;
+
+    private String partCode;
+
+    private boolean enabled;
+
+}

+ 120 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/filter/LoginInterceptor.java

@@ -0,0 +1,120 @@
+package com.gyee.wisdom.alarm.sharding.filter;
+
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.gyee.wisdom.alarm.sharding.entity.AlarmUser;
+import com.gyee.wisdom.alarm.sharding.service.AlarmUserService;
+import com.gyee.wisdom.alarm.sharding.service.PassToken;
+import com.gyee.wisdom.alarm.sharding.service.UserLoginToken;
+import com.gyee.wisdom.alarm.sharding.util.ResponseWrapper;
+import com.gyee.wisdom.alarm.sharding.util.TokenUtil;
+import io.jsonwebtoken.Claims;
+import io.jsonwebtoken.ExpiredJwtException;
+import io.jsonwebtoken.Jwt;
+import io.jsonwebtoken.Jwts;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.method.HandlerMethod;
+import org.springframework.web.servlet.HandlerInterceptor;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.lang.reflect.Method;
+import java.util.Date;
+
+/**
+ * @descrition:拦截器,拦截token
+ * @author:Wanghs
+ * @date:2020-05-21
+ */
+public class LoginInterceptor implements HandlerInterceptor {
+    @Autowired
+    protected AlarmUserService alarmUserService;
+
+    //提供查询
+    @Override
+    public void afterCompletion(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2, Exception arg3)
+            throws Exception {
+    }
+
+    @Override
+    public void postHandle(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2, ModelAndView arg3)
+            throws Exception {
+    }
+
+    @Override
+    public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object object) throws Exception {
+        String headerToken = httpServletRequest.getHeader("token");// 从 http 请求头中取出 token
+        ServletOutputStream resultWriter = httpServletResponse.getOutputStream();
+        // 如果不是映射到方法直接通过
+        if (!(object instanceof HandlerMethod)) {
+            return true;
+        }
+        HandlerMethod handlerMethod = (HandlerMethod) object;
+        Method method = handlerMethod.getMethod();
+        //检查是否有passtoken注释,有则跳过认证
+        if (method.isAnnotationPresent(PassToken.class)) {
+            PassToken passToken = method.getAnnotation(PassToken.class);
+            if (passToken.required()) {
+                return true;
+            }
+        }
+        //检查有没有需要用户权限的注解
+        if (method.isAnnotationPresent(UserLoginToken.class)) {
+            UserLoginToken userLoginToken = method.getAnnotation(UserLoginToken.class);
+            if (userLoginToken.required()) {
+                // 执行认证
+                if (headerToken == null) {
+                    ResponseWrapper wrapper=ResponseWrapper.error("请登陆!",521);
+                    resultWriter.write(JSON.toJSONString(wrapper).getBytes());
+                    resultWriter.flush();
+                    resultWriter.close();
+                    return false;
+                }
+
+                //解析Token信息
+                try {
+                    //根据token获取用户名
+                    Claims claims = TokenUtil.parseJWT(headerToken);
+                    String tokenUserName = (String) claims.get("jti");
+
+                    //根据用户名获取用户
+                    AlarmUser myTokenUser = alarmUserService.isExistUser(tokenUserName);
+
+                    //如果用户名不存在,则说明token错误
+                    if (null == myTokenUser) {
+                        ResponseWrapper wrapper=ResponseWrapper.error("身份验证错误,请重新登陆!",521);
+                        resultWriter.write(JSON.toJSONString(wrapper).getBytes());
+                        resultWriter.flush();
+                        resultWriter.close();
+                        return false;
+                    }
+
+                    //判断Token过期
+                    Date tokenDate = claims.getExpiration();
+                    int overTime = (int) (new Date().getTime() - tokenDate.getTime()) / 1000;
+                    //过期时间为一个小时
+                    if (overTime > 60*60  ) {
+                        ResponseWrapper wrapper=ResponseWrapper.error("身份验证过期,请重新登陆!",521);
+                        resultWriter.write(JSON.toJSONString(wrapper).getBytes());
+                        resultWriter.flush();
+                        resultWriter.close();
+                        return false;
+                    }
+
+                } catch (Exception e) {
+                    ResponseWrapper wrapper=ResponseWrapper.error("身份验证错误,请重新登陆!",521);
+                    resultWriter.write(JSON.toJSONString(wrapper).getBytes());
+                    resultWriter.flush();
+                    resultWriter.close();
+                    return false;
+                }
+                return true;
+            }
+        }
+        return true;
+    }
+}

+ 94 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/logtool/LogService.java

@@ -0,0 +1,94 @@
+package com.gyee.wisdom.alarm.sharding.logtool;
+
+import com.alibaba.fastjson.JSON;
+import com.gyee.wisdom.alarm.sharding.entity.Alertrule2;
+import com.gyee.wisdom.alarm.sharding.entity.Scadabj;
+import com.gyee.wisdom.alarm.sharding.entity.Warning2;
+import lombok.extern.slf4j.Slf4j;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.springframework.stereotype.Component;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * @descrition:日志记录工具
+ * @author:Wanghs
+ * @date:2020-04-23
+ */
+@Component
+
+public class LogService {
+    Logger log = LogManager.getLogger("dataChangeLogger");
+    //自定义报警--更新数据
+    public void alertRuleUpdateLog(Alertrule2 oldData,Alertrule2 newData,String userName){
+        DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+         Date nowTime=new Date();
+        log.info(format.format(nowTime)+"自定义报警数据更新-----------------------------------------------------");
+        log.info("操作人:"+userName);
+        String oldDataString= JSON.toJSONString(oldData);
+        log.info("原数据:"+oldDataString);
+        String newDataString=JSON.toJSONString(newData);
+        log.info("新数据:"+newDataString);
+        log.info("-----------------------------------------------------------------------");
+    }
+    //自定义报警--添加数据
+    public void alertRuleAddLog(Alertrule2 newData,String userName){
+        DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date nowTime=new Date();
+        log.info(format.format(nowTime)+"自定义报警数据新增-----------------------------------------------------");
+        log.info("操作人:"+userName);
+        String newDataString=JSON.toJSONString(newData);
+        log.info("新数据:"+newDataString);
+        log.info("-----------------------------------------------------------------------");
+
+    }
+
+    //风机报警--更新数据
+    public void windturbineUpdateLog(Warning2 oldData,Warning2 newData,String userName){
+        DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date nowTime=new Date();
+        log.info(format.format(nowTime)+"风机报警数据更新-----------------------------------------------------");
+        log.info("操作人:"+userName);
+        String oldDataString= JSON.toJSONString(oldData);
+        log.info("原数据:"+oldDataString);
+        String newDataString=JSON.toJSONString(newData);
+        log.info("新数据:"+newDataString);
+        log.info("---------------------------------------------------------------------");
+    }
+    //风机报警--添加数据
+    public void windturbineAddLog(Warning2 newData, String userName){
+        DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date nowTime=new Date();
+        log.info(format.format(nowTime)+"风机报警数据新增-----------------------------------------------------");
+        log.info("操作人:"+userName);
+        String newDataString=JSON.toJSONString(newData);
+        log.info("新数据:"+newDataString);
+        log.info("-----------------------------------------------------------------------");
+    }
+    //升压站报警--更新数据
+    public void scadaUpdateLog(Scadabj oldData,Scadabj newData,String userName){
+        DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date nowTime=new Date();
+        log.info(format.format(nowTime)+"升压站报警数据更新-----------------------------------------------------");
+        log.info("操作人:"+userName);
+        String oldDataString= JSON.toJSONString(oldData);
+        log.info("原数据:"+oldDataString);
+        String newDataString=JSON.toJSONString(newData);
+        log.info("新数据:"+newDataString);
+        log.info("-----------------------------------------------------------------------");
+    }
+    //升压站报警--添加数据
+    public void scadaAddLog(Scadabj newData, String userName){
+        DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date nowTime=new Date();
+        log.info(format.format(nowTime)+"升压站报警数据新增-----------------------------------------------------");
+        log.info("操作人:"+userName);
+        String newDataString=JSON.toJSONString(newData);
+        log.info("新数据:"+newDataString);
+        log.info("-----------------------------------------------------------------------");
+    }
+}

+ 56 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/AlarmCountMapper.java

@@ -0,0 +1,56 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.wisdom.alarm.sharding.entity.AlarmCount;
+import com.gyee.wisdom.alarm.sharding.entity.AlarmHistory;
+import com.gyee.wisdom.alarm.sharding.entity.AlarmStat;
+import com.gyee.wisdom.alarm.sharding.entity.AlarmStat1;
+import com.gyee.wisdom.alarm.sharding.model.CodeValue;
+import org.apache.ibatis.annotations.MapKey;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Date;
+import java.util.List;
+
+
+@Mapper
+public interface AlarmCountMapper extends BaseMapper<AlarmCount> {
+
+    void singleInsert( @Param("item") AlarmCount alarmCount);
+
+    void batchInsert(  @Param("list") List<AlarmCount> alarmCounts);
+
+
+    List<AlarmHistory> selectAlarmHistoryBySnapid(@Param("alarmhistory")String alarmhistory,
+                                                  @Param("snapid")Long snapid,
+                                                  @Param("startdate") Date startDate,
+                                                  @Param("enddate") Date endDate);
+
+
+    List<AlarmStat1> statAlarmCount1(@Param("stationid")String stationId,
+                                     @Param("startdate") Date startDate,
+                                     @Param("enddate") Date endDate);
+
+    List<AlarmStat> statAlarmCount(@Param("stationid")String stationId,
+                                   @Param("startdate") Date startDate,
+                                   @Param("enddate") Date endDate);
+
+    List<AlarmStat> statAlarmCount3(@Param("stationid")String stationid,
+                                   @Param("startdate") Date startDate,
+                                   @Param("enddate") Date endDate,
+                                   @Param("windturbineid") String windturbineid);
+
+    List<AlarmStat> statAlarmCountByName(@Param("stationid")String stationId,
+                                   @Param("startdate") Date startDate,
+                                   @Param("enddate") Date endDate,
+                                   @Param("name") String name);
+
+    @MapKey("key")
+    List<CodeValue> selectAlertRuleNames();
+
+
+    List<AlarmStat1> statAlarmCount2(@Param("stationid")String stationId,
+                                     @Param("currentDate") Date currentDate);
+
+}

+ 68 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/AlarmHisotryMapper.java

@@ -0,0 +1,68 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gyee.wisdom.alarm.sharding.entity.AlarmHistory;
+import com.gyee.wisdom.alarm.sharding.entity.FaultWarning;
+import com.gyee.wisdom.alarm.sharding.model.AlarmHistoryInfo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Date;
+import java.util.List;
+
+
+@Mapper
+public interface AlarmHisotryMapper extends BaseMapper<AlarmHistory> {
+
+    void singleInsert(@Param("tbName") String tableName, @Param("item") AlarmHistory alarmHistory);
+
+    void batchInsert(@Param("tbName") String tableName, @Param("list") List<AlarmHistory> alarmHistories);
+
+    IPage<AlarmHistoryInfo> pageQueryAll(Page page,
+                                         @Param("tbName") String tableName,
+                                         @Param("stid")String stationId,
+                                         @Param("wtid") String windturbineId,
+                                         @Param("category1") String category1,
+                                         @Param("category2") String category2,
+                                         @Param("rank") String rank,
+                                         @Param("modelid") String modelid,
+                                         @Param("snapid") Long snapid,
+                                         @Param("messagetype") Integer messagetype,
+                                         @Param("keyword") String keyword,
+                                         @Param("starttime") Date startTime,
+                                         @Param("endtime") Date endTime);
+
+    IPage<AlarmHistoryInfo> pageQueryAll2(Page page,
+                                         @Param("yearmonth") String yearmonth,
+                                         @Param("stid")String stationId,
+                                         @Param("wtid") String windturbineId,
+                                         @Param("category1") String category1,
+                                         @Param("category2") String category2,
+                                         @Param("rank") String rank,
+                                         @Param("modelid") String modelid,
+                                         @Param("snapid") Long snapid,
+                                         @Param("messagetype") Integer messagetype,
+                                         @Param("keyword") String keyword,
+                                         @Param("starttime") Date startTime,
+                                         @Param("endtime") Date endTime);
+
+    int selectSnapCount(@Param("tbName") String tableName,
+                        @Param("snapid") Long snapid,
+                        @Param("starttime") Date startTime,
+                        @Param("endtime") Date endTime);
+
+
+
+    List<FaultWarning> selectHistoryAlarmSnapAndWarning(
+            @Param("tbName") String tableName,
+            @Param("starttime") Date startTime,
+            @Param("endtime") Date endTime);
+    //定时创建历史报警表
+    void timedCreatTable(@Param("stationname")String stationname,@Param("yearmonth")String yearmonth,@Param("tablespace") String ts);
+    void timedAlterTable(@Param("stationname")String stationname,@Param("yearmonth")String yearmonth,@Param("tablespace") String ts);
+    void timedCreatAlerttimeIndex(@Param("stationname")String stationname,@Param("yearmonth")String yearmonth,@Param("tablespace") String ts);
+    void timedCreatSnapidIndex(@Param("stationname")String stationname,@Param("yearmonth")String yearmonth,@Param("tablespace") String ts);
+    int isHasTable(@Param("stationname")String stationname,@Param("yearmonth")String yearmonth);
+}

+ 63 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/AlarmSnapMapper.java

@@ -0,0 +1,63 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gyee.wisdom.alarm.sharding.entity.AlarmHistory;
+import com.gyee.wisdom.alarm.sharding.entity.AlarmSnap;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.Date;
+import java.util.List;
+
+
+@Mapper
+public interface AlarmSnapMapper extends BaseMapper<AlarmSnap> {
+
+
+    List<AlarmSnap> queryAll(@Param("stid")String stationId,
+                             @Param("wtid") String windturbineId,
+                             @Param("category1") String category1,
+                             @Param("category2") String category2,
+                             @Param("rank") String rank,
+                             @Param("modelid") String modelid,
+                             @Param("isopened") Integer isopened,
+                             @Param("keyword") String keyword,
+                             @Param("starttime") Date startTime,
+                             @Param("endtime") Date endTime) throws Exception;
+
+    IPage<AlarmSnap> pageQueryAll(Page page,
+                                 @Param("stid")String stationId,
+                                 @Param("wtid") String windturbineId,
+                                 @Param("category1") String category1,
+                                 @Param("category2") String category2,
+                                 @Param("rank") String rank,
+                                 @Param("modelid") String modelid,
+                                 @Param("isopened") Integer isopened,
+                                 @Param("keyword") String keyword,
+                                 @Param("starttime") Date startTime,
+                                 @Param("endtime") Date endTime)throws Exception;
+
+
+    int batchInsert(List<AlarmSnap> list);
+
+    void batchUpdate(List<AlarmSnap> list);
+
+    AlarmSnap findByWindturbineIdAndAlertValue(@Param("windturbineid")String windturbineid,
+                                               @Param("alertvalue")int alertvalue);
+
+    AlarmSnap findByStationIdAndAlertValue(@Param("stationid")String stationId,
+                                           @Param("alertvalue")int alertvalue);
+
+    AlarmSnap findByTestingpointkey(@Param("testingpointkey")String testingpointkey);
+
+    List<AlarmSnap> getTopNumAlarm(@Param("category1") String category1,
+                                   @Param("topnum")int topnum);
+
+    List<AlarmSnap>  getRecentAlarm(@Param("category1") String category1,
+                                    @Param("lastupdatetime") Date lastUpdateTime);
+
+}
+

+ 26 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/AlarmUserMapper.java

@@ -0,0 +1,26 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.wisdom.alarm.sharding.entity.AlarmSnap;
+import com.gyee.wisdom.alarm.sharding.entity.AlarmUser;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author:Wanghs
+ * @date:2020-04-24
+ */
+@Mapper
+public interface AlarmUserMapper   extends BaseMapper<AlarmUser> {
+
+    List<AlarmUser> login(@Param("userName")String userName,@Param("passWord") String passWord);
+
+    List<AlarmUser> getUserByUserName(@Param("userName") String userName);
+
+     List<AlarmUser> getAll();
+
+    int deleteByIds(@Param("id") String id);
+
+}

+ 18 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/AlertKnowledgeMapper.java

@@ -0,0 +1,18 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.wisdom.alarm.sharding.entity.AlertKnowledge;
+import com.gyee.wisdom.alarm.sharding.entity.FeatureStat;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2020-07-13
+ */
+@Mapper
+public interface AlertKnowledgeMapper extends BaseMapper<AlertKnowledge> {
+    List<AlertKnowledge> searchAll();
+}

+ 39 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/Alertrule2Mapper.java

@@ -0,0 +1,39 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gyee.wisdom.alarm.sharding.entity.Alertrule2;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface Alertrule2Mapper extends BaseMapper<Alertrule2> {
+
+    IPage<Alertrule2> pageQueryAll(Page page,
+                                   @Param("name") String name,
+                                   @Param("station") String station,
+                                   @Param("modelId")String modelId,
+                                   @Param("rank")String rank);
+
+    Integer getMaxEdnaValue();
+
+    List<Alertrule2> getAllByStationIdAndModelId(@Param("idString") String idString);
+
+    List<Alertrule2> getById(@Param("idString") String idString);
+
+    List<Alertrule2> queryTree();
+
+    List<Map<String, Alertrule2>> quertByrelatedParts(String relatedParts);
+
+    List<Alertrule2> queryMap();
+
+    int updateByAlertrule2Id(Alertrule2 alertrule2);
+
+    Alertrule2 selectByAlertrule2Id(String id);
+
+    int insertAlertrule2(Alertrule2 alertrule2);
+}

+ 16 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/DatadictionaryMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.wisdom.alarm.sharding.entity.Datadictionary;
+import com.gyee.wisdom.alarm.sharding.entity.Windturbine;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+
+@Mapper
+public interface DatadictionaryMapper extends BaseMapper<Datadictionary> {
+
+    Datadictionary selectBycode(String relatedParts);
+}

+ 33 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/DeviceFaultModeMapper.java

@@ -0,0 +1,33 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gyee.wisdom.alarm.sharding.entity.DeviceFaultMode;
+import com.gyee.wisdom.alarm.sharding.entity.FaultInfo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Date;
+import java.util.List;
+
+
+@Mapper
+public interface DeviceFaultModeMapper extends BaseMapper<DeviceFaultMode> {
+
+    DeviceFaultMode getDeviceFaultModeByCode(@Param("code")String code);
+
+
+    List<DeviceFaultMode> getDeviceFaultModeByDeviceId(@Param("deviceId")String deviceId);
+
+
+    List<DeviceFaultMode> getDeviceFaultModeByStructureCode(@Param("deviceId")String deviceId,
+                                                      @Param("structureCode")String structureCode);
+
+    int deleteDeviceFaultMode(@Param("id")Long id);
+
+
+    DeviceFaultMode getDeviceFaultModeTree(@Param("deviceId")String deviceId,
+                                           @Param("nodeCode")String nodeCode);
+
+}

+ 17 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/DeviceMapper.java

@@ -0,0 +1,17 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.wisdom.alarm.sharding.entity.Device;
+import com.gyee.wisdom.alarm.sharding.entity.Scadabj;
+import com.gyee.wisdom.alarm.sharding.entity.Windturbine;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+
+@Mapper
+public interface DeviceMapper extends BaseMapper<Device> {
+    List<Device> getAll();
+
+}

+ 35 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/DeviceMetricsMapper.java

@@ -0,0 +1,35 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gyee.wisdom.alarm.sharding.entity.DeviceMetrics;
+import com.gyee.wisdom.alarm.sharding.entity.DeviceModel;
+import com.gyee.wisdom.alarm.sharding.entity.DeviceStructure;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+
+@Mapper
+public interface DeviceMetricsMapper extends BaseMapper<DeviceMetrics> {
+
+    DeviceMetrics getDeviceMetricsByCode(@Param("deviceId")String deviceId,
+                                             @Param("metricCode")String metricCode);
+
+
+    List<DeviceMetrics> getDeviceMetricsByDeviceId(@Param("deviceId")String deviceId);
+
+    List<DeviceMetrics> getDeviceMetricsByStructureCode(@Param("deviceId")String deviceId,
+                                                      @Param("structureCode")String nodeCode);
+
+
+    DeviceMetrics selectByMetricsId(@Param("id")long id);
+
+    int updateByMetricsId(DeviceMetrics metrics);
+
+    int insertByMetrics(DeviceMetrics metrics);
+
+    IPage<DeviceMetrics> pageQueryAll(Page page, String deviceId, String structureCode);
+}

+ 22 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/DeviceModelMapper.java

@@ -0,0 +1,22 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.wisdom.alarm.sharding.entity.DeviceMetrics;
+import com.gyee.wisdom.alarm.sharding.entity.DeviceModel;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+
+@Mapper
+public interface DeviceModelMapper extends BaseMapper<DeviceModel> {
+
+
+    List<DeviceModel> getDeviceModelsById(@Param("id")String id);
+
+    DeviceModel getDeviceModelByCode(@Param("deviceid")String deviceid,
+                                         @Param("code")String code);
+
+    List<DeviceModel> getAll();
+}

+ 25 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/DeviceModelMetricsMapper.java

@@ -0,0 +1,25 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.wisdom.alarm.sharding.entity.DeviceModel;
+import com.gyee.wisdom.alarm.sharding.entity.DeviceModelMetrics;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+
+@Mapper
+public interface DeviceModelMetricsMapper extends BaseMapper<DeviceModelMetrics> {
+
+
+    List<DeviceModelMetrics> getDeviceModelMetricsById(@Param("metriccode")String metriccode);
+
+    List<DeviceModelMetrics> getAll();
+
+    DeviceModelMetrics selectModelMetricsById(@Param("id")long id);
+
+    int updateModelMetricsById(DeviceModelMetrics deviceModelMetrics1);
+
+    int insertModelMetrics(DeviceModelMetrics deviceModelMetrics1);
+}

+ 28 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/DeviceStructureMapper.java

@@ -0,0 +1,28 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gyee.wisdom.alarm.sharding.entity.Device;
+import com.gyee.wisdom.alarm.sharding.entity.DeviceStructure;
+import com.gyee.wisdom.alarm.sharding.entity.Scadabj;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+
+@Mapper
+public interface DeviceStructureMapper extends BaseMapper<DeviceStructure> {
+
+    DeviceStructure getDeviceStructureByCode(@Param("deviceId")String deviceId,
+                                             @Param("nodeCode")String nodeCode);
+
+    List<DeviceStructure> getAllDeviceStructure();
+
+    List<DeviceStructure> getDeviceStructureByDeviceId(@Param("deviceId")String deviceId);
+
+    List<DeviceStructure> getDeviceStructureChildNode(@Param("deviceId")String deviceId,
+                                                      @Param("nodeCode")String nodeCode);
+
+}

+ 16 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/ElectricalTestingPointAIMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.gyee.wisdom.alarm.sharding.entity.ElectricalTestingPointAI;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author:Wanghs
+ * @date:2019-12-26
+ */
+@Mapper
+public interface ElectricalTestingPointAIMapper {
+    List<ElectricalTestingPointAI> selectPointByStation(@Param("stationId") String stationId);
+}

+ 16 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/ElectricalTestingPointDIMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.gyee.wisdom.alarm.sharding.entity.ElectricalTestingPointDI;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author:Wanghs
+ * @date:2019-12-26
+ */
+@Mapper
+public interface ElectricalTestingPointDIMapper {
+    List<ElectricalTestingPointDI> selectPointByStation(@Param("stationId") String stationId);
+}

+ 12 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/EquipmentmodelMapper.java

@@ -0,0 +1,12 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.wisdom.alarm.sharding.entity.Equipmentmodel;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface EquipmentmodelMapper extends BaseMapper<Equipmentmodel> {
+    List<Equipmentmodel> getAllEquipmentmodel();
+}

+ 37 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/FaultHisotryMapper.java

@@ -0,0 +1,37 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.wisdom.alarm.sharding.entity.FaultHistory;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+
+
+@Repository
+@Mapper
+public interface FaultHisotryMapper extends BaseMapper<FaultHistory> {
+
+    void batchInsert(List<FaultHistory> faultHistories);
+
+
+    FaultHistory queryFaultHistoryById(@Param("historyid") Long histroyId) throws Exception;
+
+
+    void faultClear(@Param("startTime") Date startTime, @Param("endTime") Date endTime) throws Exception;
+
+
+    void batchConfirm(@Param("faultSnapId") Long faultSnapId,
+                      @Param("confirmType") int confirmType,
+                      @Param("userName") String userName,
+                      @Param("alarmSnpaId") Long alarmSnpaId
+    ) throws Exception;
+
+
+
+    int updateHistoryById (FaultHistory faultHistorie) throws Exception;
+
+}

+ 47 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/FaultInfoMapper.java

@@ -0,0 +1,47 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gyee.wisdom.alarm.sharding.entity.FaultInfo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.Date;
+import java.util.List;
+
+@Repository
+@Mapper
+public interface FaultInfoMapper extends BaseMapper<FaultInfo> {
+
+    List<FaultInfo> queryFaultInfo(@Param("stid") String stationId,
+                                    @Param("keyword") String keyword,
+                                    @Param("starttime") Date startTime,
+                                    @Param("endtime") Date endTime,
+                                   @Param("messageType") Integer messageType,
+                                   @Param("likeString") String likeString
+
+    ) throws Exception;
+
+
+    List<FaultInfo>  getRecentFault(@Param("faulttime") Date faultTime);
+
+
+    List<FaultInfo>  getTopNumFault(@Param("topnum") int topNum) throws Exception;
+
+    IPage<FaultInfo> queryFaultInfo1(Page page,
+                                    @Param("stid")String stationId,
+                                    @Param("keyword") String keyword,
+                                    @Param("category1") String cateGory1,
+                                    @Param("starttime") Date startTime,
+                                    @Param("endtime") Date endTime,
+                                    @Param("isopened") Integer isOpened
+    )throws Exception;
+
+
+    /**
+     * 根据ID获取报警信息
+     */
+    List<FaultInfo> getFaultInfoByIds(String[] ids);
+}

+ 33 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/FaultSnapMapper.java

@@ -0,0 +1,33 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.wisdom.alarm.sharding.entity.AlarmSnap;
+import com.gyee.wisdom.alarm.sharding.entity.AlarmStat1;
+import com.gyee.wisdom.alarm.sharding.entity.FaultSnap;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.Date;
+import java.util.List;
+
+@Repository
+@Mapper
+public interface FaultSnapMapper extends BaseMapper<FaultSnap> {
+
+    FaultSnap findByAlarmSnapId(@Param("alarmSnapId") long alarmSnapId);
+
+    int batchInsert(List<FaultSnap> list);
+
+    void batchUpdate(List<FaultSnap> list);
+
+
+    List<FaultSnap> queryMultiFaultSnap(@Param("ids") String[] snapIds) throws Exception;
+
+    FaultSnap queryByTagId(@Param("tagId") String tagId);
+
+    List<FaultSnap> queryByTimeAndStation(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("stationId") String stationId);
+
+    List<FaultSnap> getTopNumFault(int topNum);
+}
+

+ 23 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/FaultStatisticWindturbineMapper.java

@@ -0,0 +1,23 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.wisdom.alarm.sharding.entity.FaultStatisticWindturbine;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+@Mapper
+public interface FaultStatisticWindturbineMapper extends BaseMapper<FaultStatisticWindturbine> {
+
+
+    List<FaultStatisticWindturbine> selectFaultStatisticWindturbineByyearandmonth(@Param("year") String year,
+                                                                                  @Param("month")String month,
+                                                                                  @Param("warningtype") String warningtype,
+                                                                                  @Param("windturbineId") String windturbineId,
+                                                                                  @Param("stationid") String stationid);
+
+}

+ 27 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/FeatureStatMapper.java

@@ -0,0 +1,27 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.wisdom.alarm.sharding.entity.FeatureStat;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author:Wanghs
+ * @date:2019-11-19
+ */
+@Mapper
+public interface FeatureStatMapper extends BaseMapper<FeatureStat> {
+
+
+    List<FeatureStat> searchByCondition(@Param("stationId")String stationId,
+                                        @Param("starttime") Date startTime,
+                                        @Param("endtime") Date endTime);
+
+    List<FeatureStat> searchByCondition2(@Param("stationId")String stationId,
+                                        @Param("currentDate") Date currentDate);
+
+    List<FeatureStat> searchAll();
+}

+ 17 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/MainBrownoutsMapper.java

@@ -0,0 +1,17 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.wisdom.alarm.sharding.entity.MainBrownouts2;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.Date;
+import java.util.Map;
+
+@Repository
+@Mapper
+public interface MainBrownoutsMapper extends BaseMapper<MainBrownouts2> {
+
+    Map<String, String> queryMainBrownouts2Count(@Param("currentDate") Date currentDate);
+}

+ 24 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/ScadabjMapper.java

@@ -0,0 +1,24 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gyee.wisdom.alarm.sharding.entity.Scadabj;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface ScadabjMapper extends BaseMapper<Scadabj> {
+
+    IPage<Scadabj> pageQueryAll(Page page,
+                                @Param("pointKey")String pointKey,
+                                @Param("stationId")String stationId,
+                                @Param("enable") String enable,
+                                @Param("description")String description);
+
+    List<Scadabj> getAll();
+
+
+}

+ 14 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/ScadafaultMapper.java

@@ -0,0 +1,14 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gyee.wisdom.alarm.sharding.entity.Scadabj;
+import com.gyee.wisdom.alarm.sharding.entity.Scadafault;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface ScadafaultMapper extends BaseMapper<Scadafault> {
+
+    IPage<Scadafault> pageQueryAll(Page page);
+}

+ 26 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/ShutdownEventMapper.java

@@ -0,0 +1,26 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.wisdom.alarm.sharding.entity.ShutdownEvent;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+
+@Repository
+@Mapper
+public interface ShutdownEventMapper extends BaseMapper<ShutdownEvent> {
+
+
+    List<ShutdownEvent> queryShutdownEventList(@Param("stId") String stId, @Param("startdate") Date startdate, @Param("edtend") Date edtend);
+
+    List<ShutdownEvent> queryShutdownEventCurrentDate(String stId, Date currentDate);
+
+    Map<String, String> queryTodayCount(Date currentDate);
+
+
+}

+ 24 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/StopTypeMapper.java

@@ -0,0 +1,24 @@
+package com.gyee.wisdom.alarm.sharding.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.wisdom.alarm.sharding.entity.StopType;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import java.util.List;
+import java.util.Map;
+
+@Repository
+@Mapper
+public interface StopTypeMapper extends BaseMapper<StopType> {
+
+    List<StopType> queryStopTypeList(@Param("parentid")String parentid);
+
+    StopType queryStopTypeById(@Param("id")String id);
+
+    List<StopType> queryStopTypeRoot();
+
+    List<Map> queryStopTypeParent(@Param("parentid")String parentid);
+
+}

+ 0 - 0
web/alarm-hb/src/main/java/com/gyee/wisdom/alarm/sharding/mapper/TestingPointAIMapper.java


Some files were not shown because too many files changed in this diff