| | |
| | | @Override |
| | | public IPage<InspectionTaskDto> selectInspectionTaskList(Page<InspectionTask> page, InspectionTaskDto inspectionTaskDto) { |
| | | LambdaQueryWrapper<InspectionTask> queryWrapper = new LambdaQueryWrapper<>(); |
| | | if(inspectionTaskDto != null){ |
| | | if(StringUtils.isNotEmpty(inspectionTaskDto.getSearchAll())){ |
| | | queryWrapper.like(InspectionTask::getTaskName, inspectionTaskDto.getSearchAll()); |
| | | } |
| | | } |
| | | queryWrapper.orderByDesc(InspectionTask::getCreateTime); |
| | | IPage<InspectionTask> entityPage = inspectionTaskMapper.selectPage(page, queryWrapper); |
| | | |
| | |
| | | if(commonFiles == null){ |
| | | commonFiles = new ArrayList<>(); |
| | | } |
| | | List<CommonFile> finalCommonFiles = commonFiles; |
| | | List<CommonFile> finalCommonFiles1 = commonFiles; |
| | | List<InspectionTaskDto> dtoList = entityPage.getRecords().stream().map(inspectionTask -> { |
| | | InspectionTaskDto dto = new InspectionTaskDto(); |
| | | BeanUtils.copyProperties(inspectionTask, dto); // 复制主对象属性 |
| | |
| | | } |
| | | |
| | | dto.setDateStr(inspectionTask.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); |
| | | |
| | | List<CommonFile> finalCommonFiles = finalCommonFiles1.stream().filter(commonFile -> commonFile.getCommonId().equals(inspectionTask.getId())).collect(Collectors.toList()); |
| | | dto.setCommonFileList(finalCommonFiles.stream().filter(commonFile -> commonFile.getType().equals(FileNameType.INSPECTION.getValue())).collect(Collectors.toList())); |
| | | dto.setCommonFileListAfter(finalCommonFiles.stream().filter(commonFile -> commonFile.getType().equals(FileNameType.INSPECTION_PRODUCTION_AFTER.getValue())).collect(Collectors.toList())); |
| | | dto.setCommonFileListBefore(finalCommonFiles.stream().filter(commonFile -> commonFile.getType().equals(FileNameType.INSPECTION_PRODUCTION_BEFORE.getValue())).collect(Collectors.toList())); |
| | | |
| | | if(CollectionUtils.isNotEmpty(dto.getCommonFileList()) || CollectionUtils.isNotEmpty(dto.getCommonFileListAfter()) || CollectionUtils.isNotEmpty(dto.getCommonFileListBefore())){ |
| | | dto.setStatus("已巡检"); |
| | | }else{ |
| | | dto.setStatus("未巡检"); |
| | | } |
| | | return dto; |
| | | }).collect(Collectors.toList()); |
| | | |