| | |
| | | import java.util.Arrays; |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | |
| | | /** |
| | |
| | | protected FuzzyResult sysResult; |
| | | |
| | | protected ScoreResult scoreResult; |
| | | |
| | | Map<Integer, Long> problemHazardCounts; |
| | | |
| | | Map<Integer, Long> problemCheckCounts; |
| | | |
| | | // 评估结果 |
| | | @Override |
| | |
| | | for(var record : nodeRecords){ |
| | | var subItem = buildRecordDetail(record); |
| | | subItem.put("项目级别", errorNodeName(record)); |
| | | subItem.put("同类隐患出现频次", getProblemHazardCount(record)); |
| | | subItem.put("检查频次", getProblemCheckCount(record)); |
| | | errors.add(subItem); |
| | | } |
| | | return errors; |
| | | } |
| | | |
| | | private long getProblemHazardCount(ErrorRecord record) { |
| | | var problemId = record != null && record.getProblem() != null ? record.getProblem().getId() : null; |
| | | if (problemId == null || problemHazardCounts == null) { |
| | | return 0L; |
| | | } |
| | | return problemHazardCounts.getOrDefault(problemId, 0L); |
| | | } |
| | | |
| | | private long getProblemCheckCount(ErrorRecord record) { |
| | | var problemId = record != null && record.getProblem() != null ? record.getProblem().getId() : null; |
| | | if (problemId == null || problemCheckCounts == null) { |
| | | return 0L; |
| | | } |
| | | return problemCheckCounts.getOrDefault(problemId, 0L); |
| | | } |
| | | |
| | | /** |
| | | * 构建错误节点名称 |
| | | * @param record 记录 |