Commit d579e2c6 authored by 赵啸非's avatar 赵啸非

添加告警统计信息

parent fb60eb0b
package com.mortals.xhx.module.device.model.vo; package com.mortals.xhx.module.device.model.vo;
import com.mortals.framework.model.BaseEntityLong; import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.device.model.DeviceStatEntity;
import lombok.Data; import lombok.Data;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -16,6 +14,35 @@ import java.util.List; ...@@ -16,6 +14,35 @@ import java.util.List;
@Data @Data
public class DeviceStatVo extends BaseEntityLong { public class DeviceStatVo extends BaseEntityLong {
/** 开始 年 */
private Integer yearStart;
/** 结束 年 */
private Integer yearEnd;
/** 年列表 */
private List <Integer> yearList;
/** 开始 月 */
private Integer monthStart;
/** 结束 月 */
private Integer monthEnd;
/** 月列表 */
private List <Integer> monthList;
/** 开始 日 */
private Integer dayStart;
/** 结束 日 */
private Integer dayEnd;
/** 开始 创建时间 */
private String createTimeStart;
/** 结束 创建时间 */
private String createTimeEnd;
} }
\ No newline at end of file
...@@ -128,6 +128,7 @@ public class DeviceAlarmInfoServiceImpl extends AbstractCRUDServiceImpl<DeviceAl ...@@ -128,6 +128,7 @@ public class DeviceAlarmInfoServiceImpl extends AbstractCRUDServiceImpl<DeviceAl
//最近的告警信息 选择前20条 //最近的告警信息 选择前20条
List<HashMap<String, Object>> deviceAlarmMapInfoList = deviceAlarmInfoList.stream().limit(20).map(item -> { List<HashMap<String, Object>> deviceAlarmMapInfoList = deviceAlarmInfoList.stream().limit(20).map(item -> {
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
map.put("id", item.getId());
map.put("deviceName", item.getDeviceName()); map.put("deviceName", item.getDeviceName());
map.put("count", deviceAlarmCountMap.getOrDefault(item.getAlarmDevice(), 1L)); map.put("count", deviceAlarmCountMap.getOrDefault(item.getAlarmDevice(), 1L));
map.put("alarmTime", DateUtil.format(item.getAlarmTime(), DatePattern.NORM_TIME_PATTERN)); map.put("alarmTime", DateUtil.format(item.getAlarmTime(), DatePattern.NORM_TIME_PATTERN));
......
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