Przeglądaj źródła

判断离线时间30分钟

malijun 1 rok temu
rodzic
commit
34206ded62

+ 6 - 0
electricity/meter/build.gradle

@@ -23,6 +23,9 @@ dependencyManagement {
     }
 }
 
+springBoot {
+    buildInfo()
+}
 dependencies {
     implementation project(":common:utils")
     implementation project(":common:data")
@@ -54,6 +57,9 @@ dependencies {
     implementation("org.apache.poi:poi:5.2.3")
     implementation ("org.apache.poi:poi-ooxml:5.2.3")
 
+    //注解处理器
+    annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
+
 
 
 

+ 2 - 0
electricity/meter/src/main/java/com/gyee/gaia/meter/config/AppConfig.java

@@ -2,11 +2,13 @@ package com.gyee.gaia.meter.config;
 
 import lombok.Data;
 import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
 import org.springframework.stereotype.Component;
 
 
 @Data
 @Component
+@Configuration
 @ConfigurationProperties("meter")
 public class AppConfig {
 

+ 1 - 1
realtime/wind/src/main/java/com/gyee/gaia/realtime/wind/job/CauseJobHandler.java

@@ -112,7 +112,7 @@ public class CauseJobHandler implements ApplicationRunner {
                     //风速
                     ArrayDeque<PointData> pointData = pdaqMap.get(pointCode);
                     v = pointData.stream().mapToDouble(PointData::getDoubleValue).average().orElse(0);
-                    if (System.currentTimeMillis()-pointData.getFirst().getTs()>5*60*1000) {
+                    if (System.currentTimeMillis()-pointData.getFirst().getTs()>30*60*1000) {
                         //如果离线或者别的原因获取不到风速,从全场实时平均风速获取
                         Map<String, PointData> latest = adapterApi.getLatest(CacheContext.stationRealMeanSpeedMap.get(CacheContext.equipMap.get(entry.getKey()).getWindpowerstationId()));
                         Iterator<PointData> iterator = latest.values().iterator();