|
|
@@ -55,6 +55,8 @@ public class SecurityStatisticsServiceImpl implements ISecurityStatisticsService
|
|
55
|
55
|
public List<HashMap<String, Object>> selectWarningStatistics(Long stationId) {
|
|
56
|
56
|
List<HashMap<String, Object>> statistics =new ArrayList<>();
|
|
57
|
57
|
List<HashMap<String, Object>> warningStatistics = alertMapper.selectWarningStatistics(stationId);
|
|
|
58
|
+ //查询本月每个类型的数量
|
|
|
59
|
+ List<HashMap<String, Object>> monthStatistics = alertMapper.selectMonthWarningStatistics(stationId);
|
|
58
|
60
|
List<SysDictData > alertTypes = DictUtils.getDictCache("warning_type");
|
|
59
|
61
|
if (alertTypes != null) {
|
|
60
|
62
|
for (SysDictData alertType : alertTypes) {
|
|
|
@@ -62,6 +64,14 @@ public class SecurityStatisticsServiceImpl implements ISecurityStatisticsService
|
|
62
|
64
|
map.put("alertType", alertType.getDictValue());
|
|
63
|
65
|
map.put("alertTypeName", alertType.getDictLabel());
|
|
64
|
66
|
map.put("count", 0);
|
|
|
67
|
+ map.put("monthCount", 0);
|
|
|
68
|
+ //查询本月每个类型的数量
|
|
|
69
|
+ for (HashMap<String, Object> monthStatistic : monthStatistics) {
|
|
|
70
|
+ if (monthStatistic.get("alertType").equals(alertType.getDictValue())) {
|
|
|
71
|
+ map.put("monthCount", monthStatistic.get("count"));
|
|
|
72
|
+ break;
|
|
|
73
|
+ }
|
|
|
74
|
+ }
|
|
65
|
75
|
for (HashMap<String, Object> warningStatistic : warningStatistics) {
|
|
66
|
76
|
if (warningStatistic.get("alertType").equals(alertType.getDictValue())) {
|
|
67
|
77
|
map.put("count", warningStatistic.get("count"));
|