|
|
|
@ -10,6 +10,8 @@ import java.util.Map; |
|
|
|
import com.alops.system.domain.AlertMessage; |
|
|
|
import com.alops.system.domain.AlertMessage; |
|
|
|
import com.alops.system.domain.dto.AlertDto; |
|
|
|
import com.alops.system.domain.dto.AlertDto; |
|
|
|
import com.alops.system.domain.dto.AlertStatisticDto; |
|
|
|
import com.alops.system.domain.dto.AlertStatisticDto; |
|
|
|
|
|
|
|
import com.alops.system.domain.dto.LevelCountDto; |
|
|
|
|
|
|
|
import com.alops.system.domain.dto.TypeCountDto; |
|
|
|
import com.alops.system.domain.vo.homeEquAlertMessage; |
|
|
|
import com.alops.system.domain.vo.homeEquAlertMessage; |
|
|
|
import com.alops.system.mapper.AlertMessageMapper; |
|
|
|
import com.alops.system.mapper.AlertMessageMapper; |
|
|
|
import com.alops.system.service.IAlertMessageService; |
|
|
|
import com.alops.system.service.IAlertMessageService; |
|
|
|
@ -73,18 +75,18 @@ public class AlertMessageServiceImpl implements IAlertMessageService |
|
|
|
AlertStatisticDto dto = new AlertStatisticDto(); |
|
|
|
AlertStatisticDto dto = new AlertStatisticDto(); |
|
|
|
|
|
|
|
|
|
|
|
// 按设备类型统计
|
|
|
|
// 按设备类型统计
|
|
|
|
Map<String, Integer> typeMap = new HashMap<>(); |
|
|
|
|
|
|
|
for (Map<String, Object> row : alertMessageMapper.countByType()) { |
|
|
|
for (Map<String, Object> row : alertMessageMapper.countByType()) { |
|
|
|
typeMap.put((String) row.get("equ_type"), ((Long) row.get("cnt")).intValue()); |
|
|
|
String name = (String) row.get("equ_type"); |
|
|
|
|
|
|
|
Integer count = ((Long) row.get("cnt")).intValue(); |
|
|
|
|
|
|
|
dto.getTypeCount().add(new TypeCountDto(name, count)); |
|
|
|
} |
|
|
|
} |
|
|
|
dto.setTypeCount(typeMap); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 按等级统计
|
|
|
|
// 按等级统计
|
|
|
|
Map<Integer, Integer> levelMap = new HashMap<>(); |
|
|
|
|
|
|
|
for (Map<String, Object> row : alertMessageMapper.countByLevel()) { |
|
|
|
for (Map<String, Object> row : alertMessageMapper.countByLevel()) { |
|
|
|
levelMap.put(((Integer) row.get("level")), ((Long) row.get("cnt")).intValue()); |
|
|
|
String level = String.valueOf(row.get("level")); |
|
|
|
|
|
|
|
Integer count = ((Long) row.get("cnt")).intValue(); |
|
|
|
|
|
|
|
dto.getLevelCount().add(new LevelCountDto(level, count)); |
|
|
|
} |
|
|
|
} |
|
|
|
dto.setLevelCount(levelMap); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 年 / 月
|
|
|
|
// 年 / 月
|
|
|
|
LocalDate now = LocalDate.now(); |
|
|
|
LocalDate now = LocalDate.now(); |
|
|
|
@ -97,7 +99,8 @@ public class AlertMessageServiceImpl implements IAlertMessageService |
|
|
|
return dto; |
|
|
|
return dto; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 新增故障统计 |
|
|
|
* 新增故障统计 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param alertMessage 故障统计 |
|
|
|
* @param alertMessage 故障统计 |
|
|
|
|