| | |
| | | riskLevel = "A类"; |
| | | } |
| | | } |
| | | |
| | | List<Task> tasks = taskMap.get(deviceListVo.getId()); |
| | | List<Task> tasks = taskList.stream().filter(e -> e.getProjectId().equals(deviceListVo.getId())).toList(); |
| | | // List<Task> tasks = taskMap.get(deviceListVo.getId()); |
| | | if (tasks != null && !tasks.isEmpty()) { |
| | | List<Integer> taskIds = tasks.stream().map(Task::getId).toList(); |
| | | List<Record> recordList = records.stream().filter(e -> taskIds.contains(e.getCheckTaskId())).toList(); |
| | | Record record = recordList.stream().max(Comparator.comparing(Record::getCreateTime)).orElse(null); |
| | | if (record != null) { |
| | | Task task = taskRecordMap.get(record.getCheckTaskId()); |
| | | if (task != null) { |
| | | deviceListVo.setCheckTime(task.getCreateTime()); |
| | | } |
| | | |
| | | Task task1 = tasks.stream().filter(e -> e.getDate().getYear() == LocalDateTime.now().getYear() && e.getDate().getMonth().getValue() == LocalDateTime.now().getMonth().getValue()).findFirst().orElse(null); |
| | | |
| | | // List<Record> recordList = records.stream().filter(e -> taskIds.contains(e.getCheckTaskId())).toList(); |
| | | // Record record = recordList.stream().max(Comparator.comparing(Record::getCreateTime)).orElse(null); |
| | | if (task1 != null) { |
| | | deviceListVo.setCheckTime(task1.getDate().atStartOfDay()); |
| | | deviceListVo.setCheckResult("已检查"); |
| | | } else { |
| | | deviceListVo.setCheckTime(null); |