| | |
| | | |
| | | Map<String, Long> deviceProblemHazardCounts; |
| | | |
| | | Map<String, Long> deviceProblemCheckCounts; |
| | | Map<Integer, Long> deviceCheckCounts; |
| | | |
| | | /** |
| | | * 生成报告数据 |
| | |
| | | } |
| | | |
| | | private long getDeviceProblemCheckCount(ErrorRecord record) { |
| | | if (deviceProblemCheckCounts == null) { |
| | | Integer deviceId = record != null && record.getDevice() != null ? record.getDevice().getId() : null; |
| | | if (deviceId == null || deviceCheckCounts == null) { |
| | | return 0L; |
| | | } |
| | | return deviceProblemCheckCounts.getOrDefault(buildDeviceProblemKey(record), 0L); |
| | | return Math.max(deviceCheckCounts.getOrDefault(deviceId, 0L), 0L); |
| | | } |
| | | |
| | | private String buildDeviceProblemKey(ErrorRecord record) { |