fix(消息通知): 修复创建的时候获取不到创建数据的部分数据问题

--bug=1040953 --user=郭雨琦
https://www.tapd.cn/55049933/bugtrace/bugs/view?bug_id=1155049933001040953
This commit is contained in:
guoyuqi 2024-05-24 15:05:11 +08:00 committed by 刘瑞斌
parent 472b1cf757
commit 92b806599d
1 changed files with 14 additions and 0 deletions

View File

@ -45,6 +45,11 @@ public class SendNoticeAspect {
private final static String ID = "id"; private final static String ID = "id";
private final static String PROJECT_ID = "projectId"; private final static String PROJECT_ID = "projectId";
private final static String CREATE_USER = "createUser"; private final static String CREATE_USER = "createUser";
private final static String CREATE_TIME = "createTime";
private final static String UPDATE_TIME = "updateTime";
private final static String UPDATE_USER = "updateUser";
@Pointcut("@annotation(io.metersphere.system.notice.annotation.SendNotice)") @Pointcut("@annotation(io.metersphere.system.notice.annotation.SendNotice)")
public void pointcut() { public void pointcut() {
@ -168,6 +173,15 @@ public class SendNoticeAspect {
if (object.containsKey(CREATE_USER) && resource.get(CREATE_USER) == null) { if (object.containsKey(CREATE_USER) && resource.get(CREATE_USER) == null) {
resource.put(CREATE_USER, object.get(CREATE_USER)); resource.put(CREATE_USER, object.get(CREATE_USER));
} }
if (object.containsKey(CREATE_TIME) && resource.get(CREATE_TIME) == null) {
resource.put(CREATE_TIME, object.get(CREATE_TIME));
}
if (object.containsKey(UPDATE_TIME) && resource.get(UPDATE_TIME) == null) {
resource.put(UPDATE_TIME, object.get(UPDATE_TIME));
}
if (object.containsKey(UPDATE_USER) && resource.get(UPDATE_USER) == null) {
resource.put(UPDATE_USER, object.get(UPDATE_USER));
}
} }
} }
commonNoticeSendService.sendNotice(taskType, event, resources, sessionUser, currentProjectId); commonNoticeSendService.sendNotice(taskType, event, resources, sessionUser, currentProjectId);