|
@@ -402,7 +402,6 @@ public class MsgAlarmController extends BaseController {
|
|
|
List<Integer> numbs = new ArrayList<>();
|
|
|
Integer listSize;
|
|
|
List<AlarmStatisticMonthDto> list = null;
|
|
|
- List<AlarmStatisticDayDto> listDay = null;
|
|
|
if (ObjectUtils.isEmpty(alarmStatisticResVo.getCurrentMonth())) {
|
|
|
list = msgAlarmService.getCount(alarmStatisticResVo.getRailwayCode(), alarmStatisticResVo.getCurrentYear(),
|
|
|
alarmStatisticResVo.getCurrentMonth(), alarmStatisticResVo.getAlarmType(), userId);
|
|
@@ -416,7 +415,7 @@ public class MsgAlarmController extends BaseController {
|
|
|
} else {//1,3,5,7,8,10,12
|
|
|
listSize = 31;
|
|
|
}
|
|
|
- listDay = msgAlarmService.getDayCount(alarmStatisticResVo.getRailwayCode(), alarmStatisticResVo.getCurrentYear(),
|
|
|
+ list = msgAlarmService.getDayCount(alarmStatisticResVo.getRailwayCode(), alarmStatisticResVo.getCurrentYear(),
|
|
|
alarmStatisticResVo.getCurrentMonth(), alarmStatisticResVo.getAlarmType(), userId);
|
|
|
}
|
|
|
for (int i = 1; i <= listSize; i++) {
|
|
@@ -424,7 +423,6 @@ public class MsgAlarmController extends BaseController {
|
|
|
}
|
|
|
|
|
|
List<Integer> list1 = new ArrayList<>();
|
|
|
- if (ObjectUtils.isEmpty(alarmStatisticResVo.getCurrentMonth())) {
|
|
|
if (!CollectionUtils.isEmpty(list) && Objects.nonNull(list.get(0))) {
|
|
|
list.forEach(l -> {
|
|
|
list1.add(l.getMonthsta());
|
|
@@ -449,32 +447,6 @@ public class MsgAlarmController extends BaseController {
|
|
|
});
|
|
|
}
|
|
|
return AjaxResult.success(list);
|
|
|
- } else {
|
|
|
- if (!CollectionUtils.isEmpty(listDay) && Objects.nonNull(listDay.get(0))) {
|
|
|
- listDay.forEach(l -> {
|
|
|
- list1.add(l.getDaysta());
|
|
|
- });
|
|
|
- }
|
|
|
- AlarmStatisticDayDto dto;
|
|
|
- for (int i = 0; i < numbs.size(); i++) {
|
|
|
- if (!list1.contains(numbs.get(i))) {
|
|
|
- dto = new AlarmStatisticDayDto();
|
|
|
- dto.setDaysta(numbs.get(i));
|
|
|
- dto.setFrequency(0);
|
|
|
- listDay.add(dto);
|
|
|
- }
|
|
|
- }
|
|
|
- if (!CollectionUtils.isEmpty(listDay) && Objects.nonNull(listDay.get(0))) {
|
|
|
- Collections.sort(listDay, new Comparator<AlarmStatisticDayDto>() {
|
|
|
- @Override
|
|
|
- public int compare(AlarmStatisticDayDto o1, AlarmStatisticDayDto o2) {
|
|
|
-
|
|
|
- return o1.getDaysta().compareTo(o2.getDaysta());
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- return AjaxResult.success(listDay);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -545,18 +517,15 @@ public class MsgAlarmController extends BaseController {
|
|
|
}
|
|
|
|
|
|
List<AlarmStatisticMonthDto> list = null;
|
|
|
- List<AlarmStatisticDayDto> listDay = null;
|
|
|
if (ObjectUtils.isEmpty(alarmStatisticResVo.getCurrentMonth())) {
|
|
|
list = msgAlarmService.getCount(alarmStatisticResVo.getRailwayCode(), alarmStatisticResVo.getCurrentYear(),
|
|
|
alarmStatisticResVo.getCurrentMonth(), alarmStatisticResVo.getAlarmType(), userId);
|
|
|
- ExcelUtil<AlarmStatisticMonthDto> util = new ExcelUtil<>(AlarmStatisticMonthDto.class);
|
|
|
- util.exportExcel(response, list, "报警月统计数据");
|
|
|
} else {
|
|
|
- listDay = msgAlarmService.getDayCount(alarmStatisticResVo.getRailwayCode(), alarmStatisticResVo.getCurrentYear(),
|
|
|
+ list = msgAlarmService.getDayCount(alarmStatisticResVo.getRailwayCode(), alarmStatisticResVo.getCurrentYear(),
|
|
|
alarmStatisticResVo.getCurrentMonth(), alarmStatisticResVo.getAlarmType(), userId);
|
|
|
- ExcelUtil<AlarmStatisticDayDto> util = new ExcelUtil<>(AlarmStatisticDayDto.class);
|
|
|
- util.exportExcel(response, listDay, "报警月统计数据");
|
|
|
}
|
|
|
+ ExcelUtil<AlarmStatisticMonthDto> util = new ExcelUtil<>(AlarmStatisticMonthDto.class);
|
|
|
+ util.exportExcel(response, list, "报警月统计数据");
|
|
|
}
|
|
|
}
|
|
|
|