Commit ee6dc2b6 authored by caotao's avatar caotao

1.增加状态常量。

2.增加本地是否触发健康指数计算的开关,默认关闭。
parent 53bda818
...@@ -9,6 +9,7 @@ import org.slf4j.Logger; ...@@ -9,6 +9,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
...@@ -56,7 +57,9 @@ import java.net.InetAddress; ...@@ -56,7 +57,9 @@ import java.net.InetAddress;
public class AmosJxiopAnalyseApplication { public class AmosJxiopAnalyseApplication {
@Autowired @Autowired
private EmqKeeper emqKeeper; private EmqKeeper emqKeeper;
//本地是否执行健康指数算法开关
@Value("${openHealth:true}")
Boolean openHealth;
@Autowired @Autowired
private SyncESDataToTdengineMqttListener syncESDataToTdengineMqttListener; private SyncESDataToTdengineMqttListener syncESDataToTdengineMqttListener;
...@@ -76,7 +79,9 @@ public class AmosJxiopAnalyseApplication { ...@@ -76,7 +79,9 @@ public class AmosJxiopAnalyseApplication {
@Bean @Bean
public void initMqtt() throws Exception { public void initMqtt() throws Exception {
if (!openHealth) {
//订阅固化周期性数据成功的消息 //订阅固化周期性数据成功的消息
emqKeeper.subscript("sync_esdata_to_tdengine_notice", 1,syncESDataToTdengineMqttListener ); emqKeeper.subscript("sync_esdata_to_tdengine_notice", 1, syncESDataToTdengineMqttListener);
}
} }
} }
...@@ -99,4 +99,13 @@ public class CommonConstans { ...@@ -99,4 +99,13 @@ public class CommonConstans {
public static final String Twodecimalplaces= "%.2f"; public static final String Twodecimalplaces= "%.2f";
public static final String Fourdecimalplaces = "%.4f"; public static final String Fourdecimalplaces = "%.4f";
public static final String QueryStringFrontMoudleNotKeyWord = "frontModule"; public static final String QueryStringFrontMoudleNotKeyWord = "frontModule";
public static final HashMap<String, String> waringPeriodS = new HashMap<String, String>() {
{
put("按时刻", "按10分钟周期");
put("按小时", "按1小时周期");
put("按天", "按1天周期");
}
};
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment