Browse Source

Merge branch 'master' of http://124.70.43.205:3000/xieshengjie/sis

wangb 2 years ago
parent
commit
198f416781

+ 6 - 5
realtime/failurestatistics-server-cph/src/main/java/com/gyee/failurestatistics/mapper/auto/FailurestatisticsmainMapper.java

@@ -41,7 +41,8 @@ public interface FailurestatisticsmainMapper extends BaseMapper<Failurestatistic
 
         @Select(" select  s.windpowerstationid wpId,s.windturbineid wtId,max(s.num) eventnum " +
             "from (select t.windpowerstationid,t.windturbineid,w.id,w.chinesetext,count(*) num " +
-            "from shutdownevent t inner join Warning2 w on t.warningid = w.id  where  t.stopTime>=#{beginDate} " +
+            "from shutdownevent t ,warning2 w,windturbine b WHERE " +
+                " t.warningid=w.ednavalue and t.windturbineid=b.id  and b.modelid=w.modelid  and  t.stopTime>=#{beginDate} " +
             "and t.stopTime<=#{endDate}  group by t.windpowerstationid,w.id,w.chinesetext,t.windturbineid order by t.windturbineid,num desc) s " +
             " group by s.windpowerstationid,s.windturbineid order by  s.windpowerstationid,eventnum desc,s.windturbineid ")
 //    @Select("select  s.windpowerstationid wpId,s.windturbineid wtId,max(s.num) eventnum from" +
@@ -57,8 +58,8 @@ public interface FailurestatisticsmainMapper extends BaseMapper<Failurestatistic
     public List<EventVo> getCountOrderNum(@Param(value = "beginDate")Date beginDate, @Param(value = "endDate")Date endDate);
 
 
-        @Select(" select t.windturbineid wtId,w.id warnId,w.chinesetext warnName,count(*) eventnum from shutdownevent t inner join Warning2 w " +
-            "on t.warningid = w.id where t.stopTime>=#{beginDate} and t.stopTime<=#{endDate}  group by w.id,w.chinesetext,t.windturbineid " +
+        @Select(" select t.windturbineid wtId,w.id warnId,w.chinesetext warnName,count(*) eventnum from shutdownevent t ,warning2 w,windturbine b WHERE " +
+                "  t.warningid=w.ednavalue and t.windturbineid=b.id  and b.modelid=w.modelid and t.stopTime>=#{beginDate} and t.stopTime<=#{endDate}  group by w.id,w.chinesetext,t.windturbineid " +
             "order by t.windturbineid,eventnum desc ")
 //    @Select(" select t.windturbineid wtId,s.id warnId,s.alerttext warnName,count(*) eventnum from shutdownevent t inner " +
 //            "join(select n.alerttext,w.faulttime,n.windturbineid,n.stationid id from faulthistory w " +
@@ -69,8 +70,8 @@ public interface FailurestatisticsmainMapper extends BaseMapper<Failurestatistic
 //            " order by t.windturbineid,eventnum desc ")
     public List<EventVo> getCountMap(@Param(value = "beginDate")Date beginDate, @Param(value = "endDate")Date endDate);
 
-        @Select(" select t.id,t.windTurbineId,t.warningId,w.chinesetext warnDesc,t.stopTime,t.startTime,t.stopHours,t.lossPower from shutdownevent t " +
-            "inner join Warning2 w on t.warningid = w.id  where t.stopTime>=#{beginDate} and t.stopTime<=#{endDate}  order by t.windturbineid,t.starttime desc  ")
+        @Select(" select t.id,t.windTurbineId,t.warningId,w.chinesetext warnDesc,t.stopTime,t.startTime,t.stopHours,t.lossPower from shutdownevent t ,warning2 w,windturbine b WHERE " +
+                "  t.warningid=w.ednavalue and t.windturbineid=b.id  and b.modelid=w.modelid and t.stopTime>=#{beginDate} and t.stopTime<=#{endDate}  order by t.windturbineid,t.starttime desc  ")
 //    @Select("select t.id,t.windTurbineId,s.warningId,s.alerttext warnDesc,t.stopTime,t.startTime,t.stopHours,t.lossPower" +
 //            " from shutdownevent t inner join (select n.alerttext,w.faulttime,n.windturbineid,n.stationid warningId  from faulthistory w " +
 //            "  inner join faultsnap n on n.id=w.snapid  where w.faulttime >=#{beginDate} " +

+ 1 - 1
realtime/failurestatistics-server-cph/src/main/resources/application.yml

@@ -1,4 +1,4 @@
 spring:
   profiles:
-    active: hf
+    active: hb
 #    active: jn

+ 4 - 1
realtime/failurestatistics-server-cph/src/test/java/FailuresTest.java

@@ -1,9 +1,12 @@
+import com.gyee.common.util.DateUtils;
 import com.gyee.failurestatistics.FailurestatisticsMain;
 import com.gyee.failurestatistics.service.FailurestatisticsService;
 import com.gyee.failurestatistics.util.SpringUtils;
 import lombok.SneakyThrows;
 import org.springframework.boot.SpringApplication;
 
+import java.util.Date;
+
 public class FailuresTest {
 
     @SneakyThrows
@@ -15,7 +18,7 @@ public class FailuresTest {
 //
         FailurestatisticsService failurestatisticsService= SpringUtils.getBean("failurestatisticsService");
 
-
+        failurestatisticsService.deleteFailurestatisticsmain(DateUtils.truncate(new Date()));
         failurestatisticsService.saveFailurestatisticsmain();
 
 

+ 16 - 0
web/alarm-hb/src/main/resources/application-hf.properties

@@ -0,0 +1,16 @@
+
+
+#\u670D\u52A1\u540D\u79F0
+spring.application.name=alarm-hb-provider
+spring.cloud.nacos.discovery.server-addr=10.0.118.73:8848
+
+
+#nacos\u7684\u7528\u6237\u540D\u548C\u5BC6\u7801
+spring.cloud.nacos.username=nacos
+spring.cloud.nacos.password=nacos
+
+#spring boot actuator \u76D1\u63A7\u548C\u5065\u5EB7\u68C0\u67E5\u529F\u80FD
+management.endpoints.jmx.exposure.include=*
+management.endpoints.web.exposure.include=*
+management.endpoint.health.show-details=always
+

+ 10 - 10
web/alarm-hb/src/main/resources/application-hf.yml

@@ -5,16 +5,16 @@ spring:
   profiles:
     active: dev
   application:
-    name: alarm-hb-provider
-    cloud:
-      nacos:
-        discovery:
-          server-addr: 10.0.118.76:8848
-          #指定yaml格式的配置
-          file-extension: yaml
-          cluster-name: master
-        username: nacos
-        password: nacos
+#    name: alarm-hb-provider
+#    cloud:
+#      nacos:
+#        discovery:
+#          server-addr: 10.0.118.73:8848
+#          #指定yaml格式的配置
+#          file-extension: yaml
+#          cluster-name: master
+#        username: nacos
+#        password: nacos
     #引入其他配置文件,例如ftpHX 未配置文件application-ftpHX.yml
     #include: ftpHX,ftpCloud
   datasource:

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

@@ -216,7 +216,10 @@ public class InitialRunner implements CommandLineRunner {
 
         WindpowerstationExample windpowerstationExample = new WindpowerstationExample();
         windpowerstationExample.setOrderByClause("ordernum ASC");
-//        windpowerstationExample.createCriteria().andIdNotLike("%SY_FDC%");
+
+        windpowerstationExample.createCriteria().andIdEqualTo("FS_FDC");
+
+
         wpallls = windpowerstationService.selectByExample(windpowerstationExample);
         if (!wpallls.isEmpty()) {
             for (Windpowerstation wp : wpallls) {
@@ -233,6 +236,8 @@ public class InitialRunner implements CommandLineRunner {
 
         ProjectExample projectExample = new ProjectExample();
         projectExample.setOrderByClause("ordernum ASC");
+
+        projectExample.createCriteria().andWindpowerstationidEqualTo("FS_FDC");
 //        projectExample.createCriteria().andWindpowerstationidNotLike("%SY_FDC%");
         pjallls = projectService.selectByExample(projectExample);
 
@@ -257,6 +262,9 @@ public class InitialRunner implements CommandLineRunner {
         LineExample lineExample = new LineExample();
         lineExample.setOrderByClause("ordernum ASC");
         lineExample.createCriteria().getAllCriteria();
+
+        lineExample.createCriteria().andIdLike("%FS0%");
+
         lineallls = lineService.selectByExample(lineExample);
 
         if (!lineallls.isEmpty()) {
@@ -282,7 +290,7 @@ public class InitialRunner implements CommandLineRunner {
 
         WindturbineExample windturbineExample = new WindturbineExample();
         windturbineExample.setOrderByClause("ID ASC");
-
+        windturbineExample.createCriteria().andWindpowerstationidEqualTo("FS_FDC");
         wtallls = windturbineService.selectByExample(windturbineExample);
 
         if (!wtallls.isEmpty()) {

+ 1 - 1
web/health-hb/src/main/java/com/gyee/frame/service/ShutdowneventService.java

@@ -213,7 +213,7 @@ public class ShutdowneventService implements BaseService<Shutdownevent, Shutdown
 //
 //		return sdelist;
         Calendar c = Calendar.getInstance();
-        c.set(Calendar.DAY_OF_MONTH, 1);
+
         c.set(Calendar.HOUR_OF_DAY, 0);
         c.set(Calendar.MINUTE, 0);
         c.set(Calendar.SECOND, 0);

+ 12 - 12
web/health-hb/src/main/java/com/gyee/frame/service/health/HealthMainService.java

@@ -374,18 +374,18 @@ public class HealthMainService {
 //                    wpmap.put("tqyb", 1.0);
 //                }
 
-                Map<String,Object> weathermap=weatherService.getWeatherRealInfo(wp.getId());
-                if(null!=weathermap && !weathermap.isEmpty())
-                {
-                    if(weathermap.containsKey("tqtp"))
-                    {
-                        wpmap.put("tqyb", Double.valueOf(String.valueOf(weathermap.get("tqtp"))));
-                    }
-                    if(weathermap.containsKey("fs"))
-                    {
-                        wpmap.put("ycfs", weathermap.get("fs"));
-                    }
-                }
+//                Map<String,Object> weathermap=weatherService.getWeatherRealInfo(wp.getId());
+//                if(null!=weathermap && !weathermap.isEmpty())
+//                {
+//                    if(weathermap.containsKey("tqtp"))
+//                    {
+//                        wpmap.put("tqyb", Double.valueOf(String.valueOf(weathermap.get("tqtp"))));
+//                    }
+//                    if(weathermap.containsKey("fs"))
+//                    {
+//                        wpmap.put("ycfs", weathermap.get("fs"));
+//                    }
+//                }
                 // 获得实时风速测点编号
 
                 Windpowerstationpointnew point = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(wp.getId(), Constant.TPOINT_WP_SSFS);

+ 8 - 0
web/health-hb/src/main/resources/META-INF/additional-spring-configuration-metadata.json

@@ -0,0 +1,8 @@
+{
+  "properties": [
+    {
+      "name": "spring.application.cloud.nacos.discovery.server-addr",
+      "type": "java.lang.String",
+      "description": "Description for spring.application.cloud.nacos.discovery.server-addr."
+  }
+] }

+ 17 - 0
web/health-hb/src/main/resources/application-hf.properties

@@ -0,0 +1,17 @@
+#\u5185\u5D4C\u7684web\u670D\u52A1\u5668\u7AEF\u53E3
+server.port=8172
+
+#\u670D\u52A1\u540D\u79F0
+spring.application.name=health-hb-provider
+spring.cloud.nacos.discovery.server-addr=10.0.118.73:8848
+
+
+#nacos\u7684\u7528\u6237\u540D\u548C\u5BC6\u7801
+spring.cloud.nacos.username=nacos
+spring.cloud.nacos.password=nacos
+
+#spring boot actuator \u76D1\u63A7\u548C\u5065\u5EB7\u68C0\u67E5\u529F\u80FD
+management.endpoints.jmx.exposure.include=*
+management.endpoints.web.exposure.include=*
+management.endpoint.health.show-details=always
+

+ 22 - 11
web/health-hb/src/main/resources/application-hf.yml

@@ -61,16 +61,17 @@ server :
 #dev环境  mysql7.0
 spring :
   application:
-    name: monitor-hb-provider
-    cloud:
-      nacos:
-        discovery:
-          server-addr: 192.168.56.1:8848
-          #指定yaml格式的配置
-          file-extension: yaml
-          cluster-name: master
-        username: nacos
-        password: nacos
+#    name: health-hb-provider
+#    cloud:
+#      inetutils:
+#        preferred-networks: 10.0.118.73
+#      nacos:
+#        discovery:
+#          server-addr: 10.0.118.73:8848
+#          #指定yaml格式的配置
+#          file-extension: yaml
+#        username: nacos
+#        password: nacos
     #引入其他配置文件,例如ftpHX 未配置文件application-ftpHX.yml
     #include: ftpHX,ftpCloud
   servlet:
@@ -162,7 +163,17 @@ spring :
             multi-statement-allow: true
 
 #mysql 8.0
-
+management:
+  endpoints:
+    jmx:
+      exposure:
+        include: "*"
+    web:
+      exposure:
+        include: "*"
+  endpoint:
+    health:
+      show-details: always
 #spring:
 #  datasource:
 #    type: com.alibaba.druid.pool.DruidDataSource

+ 23 - 23
web/health-hb/src/main/resources/application-hwy.yml

@@ -58,16 +58,16 @@ server :
 #dev环境  mysql7.0
 spring :
   application:
-    name: monitor-hb-provider
-    cloud:
-      nacos:
-        discovery:
-          server-addr: 123.60.213.70:8848
-          #指定yaml格式的配置
-          file-extension: yaml
-          cluster-name: master
-        username: nacos
-        password: nacos
+#    name: health-hb-provider
+#    cloud:
+#      nacos:
+#        discovery:
+#          server-addr: 123.60.213.70:8848
+#          #指定yaml格式的配置
+#          file-extension: yaml
+#          cluster-name: master
+#        username: nacos
+#        password: nacos
     #引入其他配置文件,例如ftpHX 未配置文件application-ftpHX.yml
     #include: ftpHX,ftpCloud
   servlet:
@@ -91,7 +91,7 @@ spring :
 
   redis:
     database: 1
-    host: 10.0.118.73
+    host: 123.60.213.70
     password:
     pool:
       maxTotal: 20
@@ -108,13 +108,13 @@ spring :
     druid:
       #主库数据源
       master:
-#        url: jdbc:oracle:thin:@123.60.213.70:1521:gdnxfd
-#        username: nxfdprod
-#        password: gdnxfd123
-        driver-class-name: oracle.jdbc.driver.OracleDriver
-        url: jdbc:oracle:thin:@10.0.118.71:1521:gdsj
-        username: gdprod
-        password: gd123
+        url: jdbc:oracle:thin:@123.60.213.70:1521:gdnxfd
+        username: nxfdprod
+        password: gdnxfd123
+#        driver-class-name: oracle.jdbc.driver.OracleDriver
+#        url: jdbc:oracle:thin:@10.0.118.71:1521:gdsj
+#        username: gdprod
+#        password: gd123
 
       #备数据源 #关闭
       slave:
@@ -124,12 +124,12 @@ spring :
         password: root
         #两票数据源
       ticket:
-#        url: jdbc:sqlserver://123.60.213.70:1434;DatabaseName=fdeamnew
-#        username: sa
-#        password: Gyee@321#!
-        url: jdbc:sqlserver://10.0.118.71:1433;DatabaseName=fdeamnew
+        url: jdbc:sqlserver://123.60.213.70:1434;DatabaseName=fdeamnew
         username: sa
-        password: Gd!123456
+        password: Gyee@321#!
+#        url: jdbc:sqlserver://10.0.118.71:1433;DatabaseName=fdeamnew
+#        username: sa
+#        password: Gd!123456
         driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
         #配置初始化连接数大小
       initial-size: 10

+ 1 - 1
web/health-hb/src/main/resources/logback.xml

@@ -8,7 +8,7 @@
     <contextName>logback</contextName>
 
     <!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义后,可以使“${}”来使用变量。 -->
-    <property name="log.path" value="d:/gyee/monitor/logs/" />
+    <property name="log.path" value="d:/gyee/health-hb/logs/" />
 
     <!--0. 日志格式和颜色渲染 -->
     <!-- 彩色日志依赖的渲染类 -->

+ 4 - 4
web/health-hb/src/main/resources/mybatis/auto/ShutdowneventMapper.xml

@@ -517,10 +517,10 @@
   </select>
 
     <select id="queryEvents"  resultType="com.gyee.frame.model.custom.ShutdowneventVo">
-        select t.id,t.windPowerStationId,t.windTurbineId,t.warningid,s.chinesetext warnDesc,t.stopTime,t.startTime,t.stopHours,t.lossPower,t.statusCode
-        from shutdownevent t left join warning2 s on
-        t.warningid=s.id
-          where t.stopTime>=#{beginDate}
+        select t.id,t.windPowerStationId,t.windTurbineId,t.warningId,w.chinesetext warnDesc,t.stopTime,t.startTime,t.stopHours,t.lossPower,t.statusCode
+        from shutdownevent t ,warning2 w,windturbine b WHERE
+        t.warningid=w.ednavalue and t.windturbineid=b.id  and b.modelid=w.modelid
+          and t.stopTime>=#{beginDate}
            and t.stopTime&lt;=#{endDate}
            and t.statusCode=2
         <if test="type != null">