fix(消息通知): 修复删除缺陷没有通知的问题

--bug=1018817 --user=刘瑞斌 【项目设置】缺陷消息通知:删除事件的消息都收不到通知(站内信、邮件、机器人) https://www.tapd.cn/55049933/s/1276361
This commit is contained in:
CaptainB 2022-10-25 14:52:27 +08:00 committed by 刘瑞斌
parent b34967da94
commit c122d5ccbd
2 changed files with 4 additions and 1 deletions

View File

@ -116,7 +116,7 @@ public class IssuesController {
@GetMapping("/delete/{id}") @GetMapping("/delete/{id}")
@MsAuditLog(module = OperLogModule.TRACK_BUG, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = IssuesService.class) @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) { public void delete(@PathVariable String id) {
issuesService.delete(id); issuesService.delete(id);
} }

View File

@ -308,6 +308,9 @@ public class IssuesService {
public IssuesWithBLOBs getIssue(String id) { public IssuesWithBLOBs getIssue(String id) {
IssuesDao issuesWithBLOBs = extIssuesMapper.selectByPrimaryKey(id); IssuesDao issuesWithBLOBs = extIssuesMapper.selectByPrimaryKey(id);
if (issuesWithBLOBs == null) {
return null;
}
IssuesRequest issuesRequest = new IssuesRequest(); IssuesRequest issuesRequest = new IssuesRequest();
Project project = baseProjectService.getProjectById(issuesWithBLOBs.getProjectId()); Project project = baseProjectService.getProjectById(issuesWithBLOBs.getProjectId());
issuesRequest.setWorkspaceId(project.getWorkspaceId()); issuesRequest.setWorkspaceId(project.getWorkspaceId());