fix(缺项管理): 同步缺陷发送通知报错问题

This commit is contained in:
song-cc-rock 2024-02-04 11:19:16 +08:00 committed by 刘瑞斌
parent 380956f96d
commit 5e1b480510
2 changed files with 3 additions and 2 deletions

View File

@ -519,7 +519,7 @@ public class BugService {
// 异常或正常结束都得删除当前项目执行同步的Key // 异常或正常结束都得删除当前项目执行同步的Key
bugSyncExtraService.deleteSyncKey(project.getId()); bugSyncExtraService.deleteSyncKey(project.getId());
// 发送同步通知 // 发送同步通知
bugSyncNoticeService.sendNotice(remainBugs.size(), currentUser); bugSyncNoticeService.sendNotice(remainBugs.size(), currentUser, project.getId());
} }
} }

View File

@ -23,7 +23,7 @@ public class BugSyncNoticeService {
@Resource @Resource
private NoticeSendService noticeSendService; private NoticeSendService noticeSendService;
public void sendNotice(int total, String currentUser) { public void sendNotice(int total, String currentUser, String projectId) {
User user = userMapper.selectByPrimaryKey(currentUser); User user = userMapper.selectByPrimaryKey(currentUser);
Map<String, String> defaultTemplateMap = MessageTemplateUtils.getDefaultTemplateMap(); Map<String, String> defaultTemplateMap = MessageTemplateUtils.getDefaultTemplateMap();
String template = defaultTemplateMap.get(NoticeConstants.TemplateText.BUG_SYNC_TASK_EXECUTE_COMPLETED); String template = defaultTemplateMap.get(NoticeConstants.TemplateText.BUG_SYNC_TASK_EXECUTE_COMPLETED);
@ -33,6 +33,7 @@ public class BugSyncNoticeService {
Map paramMap = new HashMap<>(); Map paramMap = new HashMap<>();
paramMap.put(NoticeConstants.RelatedUser.OPERATOR, user.getName()); paramMap.put(NoticeConstants.RelatedUser.OPERATOR, user.getName());
paramMap.put("total", total); paramMap.put("total", total);
paramMap.put("projectId", projectId);
NoticeModel noticeModel = NoticeModel.builder().operator(currentUser) NoticeModel noticeModel = NoticeModel.builder().operator(currentUser)
.context(template).subject(subject).paramMap(paramMap).event(NoticeConstants.Event.SYNC_COMPLETED).build(); .context(template).subject(subject).paramMap(paramMap).event(NoticeConstants.Event.SYNC_COMPLETED).build();
noticeSendService.send(NoticeConstants.TaskType.BUG_SYNC_TASK, noticeModel); noticeSendService.send(NoticeConstants.TaskType.BUG_SYNC_TASK, noticeModel);