Commit be7f4816 by 杨林龙

开发警情中心消费业务

1 parent 172fb343
......@@ -2,6 +2,9 @@ package cn.com.glsx.kafka.init;
import cn.com.glsx.kafka.service.EshieldAlarmService;
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.boot.CommandLineRunner;
import org.springframework.core.Ordered;
......@@ -16,6 +19,7 @@ import java.util.List;
*
* @author yangll
*/
@Slf4j
@Component
@Order(Ordered.HIGHEST_PRECEDENCE + 1)
public class DataInitializer implements CommandLineRunner {
......@@ -36,8 +40,11 @@ public class DataInitializer implements CommandLineRunner {
public void initAlarmType() {
List<AlarmWarnAlarmTypeDTO> alarmTypeList = eshieldAlarmService.getAllAlarmType();
for (AlarmWarnAlarmTypeDTO eat : alarmTypeList) {
cacheAlarmType.put(eat.getTypeDesc(), eat.getAlarmType());
if (CollectionUtil.isNotEmpty(alarmTypeList)) {
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!