Commit be7f4816 by 杨林龙

开发警情中心消费业务

1 parent 172fb343
...@@ -2,6 +2,9 @@ package cn.com.glsx.kafka.init; ...@@ -2,6 +2,9 @@ package cn.com.glsx.kafka.init;
import cn.com.glsx.kafka.service.EshieldAlarmService; import cn.com.glsx.kafka.service.EshieldAlarmService;
import cn.com.glsx.stdinterface.dto.AlarmWarnAlarmTypeDTO; import cn.com.glsx.stdinterface.dto.AlarmWarnAlarmTypeDTO;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner; import org.springframework.boot.CommandLineRunner;
import org.springframework.core.Ordered; import org.springframework.core.Ordered;
...@@ -16,6 +19,7 @@ import java.util.List; ...@@ -16,6 +19,7 @@ import java.util.List;
* *
* @author yangll * @author yangll
*/ */
@Slf4j
@Component @Component
@Order(Ordered.HIGHEST_PRECEDENCE + 1) @Order(Ordered.HIGHEST_PRECEDENCE + 1)
public class DataInitializer implements CommandLineRunner { public class DataInitializer implements CommandLineRunner {
...@@ -36,8 +40,11 @@ public class DataInitializer implements CommandLineRunner { ...@@ -36,8 +40,11 @@ public class DataInitializer implements CommandLineRunner {
public void initAlarmType() { public void initAlarmType() {
List<AlarmWarnAlarmTypeDTO> alarmTypeList = eshieldAlarmService.getAllAlarmType(); List<AlarmWarnAlarmTypeDTO> alarmTypeList = eshieldAlarmService.getAllAlarmType();
for (AlarmWarnAlarmTypeDTO eat : alarmTypeList) { if (CollectionUtil.isNotEmpty(alarmTypeList)) {
cacheAlarmType.put(eat.getTypeDesc(), eat.getAlarmType()); log.info("alarmTypeList===" + JSONUtil.toJsonStr(alarmTypeList));
for (AlarmWarnAlarmTypeDTO eat : alarmTypeList) {
cacheAlarmType.put(eat.getTypeDesc(), eat.getAlarmType());
}
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!