Commit 2e821726 authored by zhangsen's avatar zhangsen

bug

parent a58fd3f3
......@@ -28,4 +28,6 @@ public class IndexDto {
private String unit; // 单位
private String F;//风机编号 -- 适应大屏
private String state; // 指标名称【风机状态名称】
private String countString;
private String color;
}
......@@ -257,11 +257,21 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
List<IndexDto> influxDBList = influxDButils.getListData(sql, IndexDto.class);
Map<String, Long> collect = influxDBList.stream().collect(Collectors.groupingBy(IndexDto::getEquipmentIndexName, Collectors.counting()));
List<String> list = Arrays.asList("正常运行", "告警运行", "正常停机", "故障停机", "限功率", "待机状态", "维护状态", "通讯中断");
HashMap<String, String> colorMap = new HashMap<>();
colorMap.put("正常运行", "#00aa00");
colorMap.put("告警运行", "#ffc400");
colorMap.put("正常停机", "#0055ff");
colorMap.put("故障停机", "#00aaff");
colorMap.put("限功率", "#a3f5aa");
colorMap.put("待机状态", "#ff0000");
colorMap.put("维护状态", "#ff00ff");
colorMap.put("通讯中断", "#7d8e95");
List<IndexDto> resultList = new ArrayList<>();
list.forEach(item -> {
IndexDto indexDto = new IndexDto();
indexDto.setCount(Math.toIntExact(collect.getOrDefault(item, 0L)));
indexDto.setCountString(collect.containsKey(item) ? String.valueOf(collect.get(item)) : "0");
indexDto.setEquipmentIndexName(item);
indexDto.setColor(colorMap.get(item));
resultList.add(indexDto);
});
return resultList;
......
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