diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java index 91387f4..5b8c70c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java @@ -292,8 +292,11 @@ public class ProjectFileManage { // 创建ZipOutputStream ZipOutputStream zos = new ZipOutputStream(response.getOutputStream()); if (CollUtil.isNotEmpty(fileIdList)) { + // 对文件ID进行去重 + HashSet hashSet = new HashSet<>(); + List fidList = fileIdList.stream().filter(hashSet::add).collect(Collectors.toList()); // 获取文件输入流 - for (Long fileId : fileIdList) { + for (Long fileId : fidList) { File file = fileService.getById(fileId); // 文件不存在,跳过 if (Objects.isNull(file)) {