Commit a1cbca03 authored by 张森's avatar 张森

默认值添加

parent 4e249086
...@@ -54,7 +54,7 @@ public class KafkaConsumerService implements ApplicationRunner { ...@@ -54,7 +54,7 @@ public class KafkaConsumerService implements ApplicationRunner {
* execl文件路径,读取excel * execl文件路径,读取excel
*/ */
// @Value("${filter.excel.path:F:\\filterExcel11.xlsx}") // @Value("${filter.excel.path:F:\\filterExcel11.xlsx}")
@Value("${filter.excel.path}") @Value("${filter.excel.path:}")
private String filePath; private String filePath;
/** /**
...@@ -136,6 +136,7 @@ public class KafkaConsumerService implements ApplicationRunner { ...@@ -136,6 +136,7 @@ public class KafkaConsumerService implements ApplicationRunner {
@Override @Override
public void run(ApplicationArguments args) { public void run(ApplicationArguments args) {
codeListInfo = readExcelFile(filePath); codeListInfo = readExcelFile(filePath);
log.info("excel文件数据:{}", JSON.toJSONString(codeListInfo));
} }
/** /**
...@@ -144,9 +145,9 @@ public class KafkaConsumerService implements ApplicationRunner { ...@@ -144,9 +145,9 @@ public class KafkaConsumerService implements ApplicationRunner {
*/ */
private Boolean isSendEmq(com.alibaba.fastjson.JSONObject res) { private Boolean isSendEmq(com.alibaba.fastjson.JSONObject res) {
String key = ""; String key = "";
if (!StringUtils.isEmpty(res.get("kafkaTopic")) && topic1.equals(res.get("kafkaTopic").toString())) { if (!StringUtils.isEmpty(res.get("mqTopic")) && topic1.equals(res.get("mqTopic").toString())) {
key = res.getJSONObject("data").get("key").toString(); key = res.getJSONObject("data").get("key").toString();
} else if (!StringUtils.isEmpty(res.get("kafkaTopic")) && topic2.equals(res.get("kafkaTopic").toString())) { } else if (!StringUtils.isEmpty(res.get("mqTopic")) && topic2.equals(res.get("mqTopic").toString())) {
key = res.getJSONObject("data").getJSONArray("warns").getJSONObject(0).get("pointId").toString(); key = res.getJSONObject("data").getJSONArray("warns").getJSONObject(0).get("pointId").toString();
} }
return !StringUtils.isEmpty(key) && codeListInfo.contains(key); return !StringUtils.isEmpty(key) && codeListInfo.contains(key);
......
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