diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/AbstractNoticeSender.java b/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/AbstractNoticeSender.java index 6960e25c30..2d26402e43 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/AbstractNoticeSender.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/notice/sender/AbstractNoticeSender.java @@ -155,8 +155,15 @@ public abstract class AbstractNoticeSender implements NoticeSender { } case NoticeConstants.RelatedUser.FOLLOW_PEOPLE -> { try { - List follows = handleFollows(messageDetail, noticeModel); - toUsers.addAll(follows); + List followUser = (List) paramMap.get("followUsers"); + if (CollectionUtils.isNotEmpty(followUser)) { + followUser.forEach(item ->{ + toUsers.add(new Receiver(item, NotificationConstants.Type.SYSTEM_NOTICE.name())); + }); + } else { + List follows = handleFollows(messageDetail, noticeModel); + toUsers.addAll(follows); + } } catch (Exception e) { LogUtils.error("查询关注人失败:{}", e); } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanDTO.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanDTO.java index 95945df8ee..cbd7e54385 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanDTO.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/dto/TestPlanDTO.java @@ -4,6 +4,8 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.List; + /** * @author wx @@ -55,4 +57,6 @@ public class TestPlanDTO { @Schema(description = "message.domain.test_plan_description") private String description; + private List followUsers; + } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanSendNoticeService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanSendNoticeService.java index 22b5f517f3..f1843bbbea 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanSendNoticeService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanSendNoticeService.java @@ -2,13 +2,12 @@ package io.metersphere.plan.service; import io.metersphere.functional.domain.FunctionalCase; import io.metersphere.functional.mapper.FunctionalCaseMapper; -import io.metersphere.plan.domain.TestPlan; -import io.metersphere.plan.domain.TestPlanConfig; -import io.metersphere.plan.domain.TestPlanExample; +import io.metersphere.plan.domain.*; import io.metersphere.plan.dto.TestPlanDTO; import io.metersphere.plan.dto.request.TestPlanCreateRequest; import io.metersphere.plan.dto.request.TestPlanUpdateRequest; import io.metersphere.plan.mapper.TestPlanConfigMapper; +import io.metersphere.plan.mapper.TestPlanFollowerMapper; import io.metersphere.plan.mapper.TestPlanMapper; import io.metersphere.sdk.constants.ReportStatus; import io.metersphere.sdk.constants.TestPlanConstants; @@ -49,6 +48,8 @@ public class TestPlanSendNoticeService { private CommonNoticeSendService commonNoticeSendService; @Resource private TestPlanConfigMapper testPlanConfigMapper; + @Resource + private TestPlanFollowerMapper testPlanFollowerMapper; public void sendNoticeCase(List relatedUsers, String userId, String caseId, String task, String event, String testPlanId) { FunctionalCase functionalCase = functionalCaseMapper.selectByPrimaryKey(caseId); @@ -155,10 +156,15 @@ public class TestPlanSendNoticeService { public TestPlanDTO sendDeleteNotice(String id) { TestPlan testPlan = testPlanMapper.selectByPrimaryKey(id); TestPlanConfig testPlanConfig = testPlanConfigMapper.selectByPrimaryKey(id); + TestPlanFollowerExample example = new TestPlanFollowerExample(); + example.createCriteria().andTestPlanIdEqualTo(id); + List testPlanFollowers = testPlanFollowerMapper.selectByExample(example); + List followUsers = testPlanFollowers.stream().map(TestPlanFollower::getUserId).toList(); TestPlanDTO dto = new TestPlanDTO(); if (testPlan != null) { BeanUtils.copyBean(dto, testPlan); BeanUtils.copyBean(dto, testPlanConfig); + dto.setFollowUsers(followUsers); return dto; } return null;