From 81a2c17ad61ad37d5fc81e5231d1f8f0c99bf9e5 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Wed, 23 Oct 2024 15:53:57 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=94=A8=E4=BE=8B=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1047174 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001047174 --- .../service/FunctionalCaseAttachmentService.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseAttachmentService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseAttachmentService.java index 92cf8767f8..f4aa51931b 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseAttachmentService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseAttachmentService.java @@ -167,7 +167,7 @@ public class FunctionalCaseAttachmentService { })); attachmentDTOs.addAll(filesDTOs); attachmentDTOs.sort(Comparator.comparing(FunctionalCaseAttachmentDTO::getCreateTime).reversed()); - + List returnAttachmentDTO = new ArrayList<>(); if (CollectionUtils.isNotEmpty(attachmentDTOs)) { List userList = attachmentDTOs.stream().map(FunctionalCaseAttachmentDTO::getCreateUser).toList(); UserExample userExample = new UserExample(); @@ -175,11 +175,14 @@ public class FunctionalCaseAttachmentService { List users = userMapper.selectByExample(userExample); Map collect = users.stream().collect(Collectors.toMap(User::getId, User::getName)); attachmentDTOs.forEach(item -> { - String userName = collect.get(item.getCreateUser()); - item.setCreateUserName(userName); + if (!item.isDeleted()) { + String userName = collect.get(item.getCreateUser()); + item.setCreateUserName(userName); + returnAttachmentDTO.add(item); + } }); } - functionalCaseDetailDTO.setAttachments(attachmentDTOs); + functionalCaseDetailDTO.setAttachments(returnAttachmentDTO); }