From c122d5ccbde1a9c281ccf24c1ed8d3f638a6dc92 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Tue, 25 Oct 2022 14:52:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4=E7=BC=BA=E9=99=B7=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E9=80=9A=E7=9F=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1018817 --user=刘瑞斌 【项目设置】缺陷消息通知:删除事件的消息都收不到通知(站内信、邮件、机器人) https://www.tapd.cn/55049933/s/1276361 --- .../main/java/io/metersphere/controller/IssuesController.java | 2 +- .../src/main/java/io/metersphere/service/IssuesService.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/test-track/backend/src/main/java/io/metersphere/controller/IssuesController.java b/test-track/backend/src/main/java/io/metersphere/controller/IssuesController.java index 0df79dfbe6..734f08075f 100644 --- a/test-track/backend/src/main/java/io/metersphere/controller/IssuesController.java +++ b/test-track/backend/src/main/java/io/metersphere/controller/IssuesController.java @@ -116,7 +116,7 @@ public class IssuesController { @GetMapping("/delete/{id}") @MsAuditLog(module = OperLogModule.TRACK_BUG, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = IssuesService.class) - @SendNotice(taskType = NoticeConstants.TaskType.DEFECT_TASK, target = "#targetClass.get(#id)", targetClass = IssuesService.class, event = NoticeConstants.Event.DELETE, subject = "缺陷通知") + @SendNotice(taskType = NoticeConstants.TaskType.DEFECT_TASK, target = "#targetClass.getIssue(#id)", targetClass = IssuesService.class, event = NoticeConstants.Event.DELETE, subject = "缺陷通知") public void delete(@PathVariable String id) { issuesService.delete(id); } diff --git a/test-track/backend/src/main/java/io/metersphere/service/IssuesService.java b/test-track/backend/src/main/java/io/metersphere/service/IssuesService.java index 7a339f7d13..9bfad0ecee 100644 --- a/test-track/backend/src/main/java/io/metersphere/service/IssuesService.java +++ b/test-track/backend/src/main/java/io/metersphere/service/IssuesService.java @@ -308,6 +308,9 @@ public class IssuesService { public IssuesWithBLOBs getIssue(String id) { IssuesDao issuesWithBLOBs = extIssuesMapper.selectByPrimaryKey(id); + if (issuesWithBLOBs == null) { + return null; + } IssuesRequest issuesRequest = new IssuesRequest(); Project project = baseProjectService.getProjectById(issuesWithBLOBs.getProjectId()); issuesRequest.setWorkspaceId(project.getWorkspaceId());