fix(系统设置): 消息通知的日志操作对象显示问题

--bug=1018658 --user=李玉号 【系统设置】操作日志-“新建”消息通知的消息设置日志显示的是“更新”
https://www.tapd.cn/55049933/s/1283804
This commit is contained in:
shiziyuan9527 2022-10-31 16:32:40 +08:00 committed by lyh
parent d45f1f635c
commit 67f0e41a93
3 changed files with 19 additions and 2 deletions

View File

@ -2423,6 +2423,7 @@ const message = {
organization_member: "组织-成员", organization_member: "组织-成员",
organization_workspace: "组织-工作空间", organization_workspace: "组织-工作空间",
workspace_service_integration: "工作空间-服务集成", workspace_service_integration: "工作空间-服务集成",
project_message_settings: "项目-消息设置",
project_settings: "项目-消息设置", project_settings: "项目-消息设置",
workspace_member: "工作空间-成员", workspace_member: "工作空间-成员",
project_template_settings_field: "项目-模版设置-自定义字段", project_template_settings_field: "项目-模版设置-自定义字段",

View File

@ -35,7 +35,7 @@ public class NoticeController {
} }
@GetMapping("/delete/message/{identification}") @GetMapping("/delete/message/{identification}")
@MsAuditLog(module = OperLogModule.WORKSPACE_MESSAGE_SETTINGS, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#identification)", msClass = NoticeService.class) @MsAuditLog(module = OperLogModule.WORKSPACE_MESSAGE_SETTINGS, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getDelLogDetails(#identification)", msClass = NoticeService.class)
public int deleteMessage(@PathVariable String identification) { public int deleteMessage(@PathVariable String identification) {
return noticeService.delMessage(identification); return noticeService.delMessage(identification);
} }

View File

@ -189,8 +189,24 @@ public class NoticeService {
} }
} }
List<DetailColumn> columns = ReflexObjectUtil.getColumns(task, SystemReference.messageColumns); List<DetailColumn> columns = ReflexObjectUtil.getColumns(task, SystemReference.messageColumns);
OperatingLogDetails details = new OperatingLogDetails(JSON.toJSONString(task.getId()), null, OperatingLogDetails details = new OperatingLogDetails(JSON.toJSONString(task.getId()), task.getProjectId(),
StatusReference.statusMap.containsKey(task.getTaskType()) ? StatusReference.statusMap.get(task.getTaskType()) : task.getTaskType(), null, columns); StatusReference.statusMap.containsKey(task.getTaskType()) ? StatusReference.statusMap.get(task.getTaskType()) : task.getTaskType(), null, columns);
return JSON.toJSONString(details); return JSON.toJSONString(details);
} }
public String getDelLogDetails(String identification) {
MessageTaskExample example = new MessageTaskExample();
example.createCriteria().andIdentificationEqualTo(identification);
List<MessageTask> tasks = messageTaskMapper.selectByExample(example);
if (CollectionUtils.isNotEmpty(tasks)) {
MessageTask messageTask = tasks.get(0);
OperatingLogDetails details = new OperatingLogDetails(JSON.toJSONString(messageTask.getId()),
messageTask.getProjectId(),
StatusReference.statusMap.containsKey(messageTask.getTaskType()) ? StatusReference.statusMap.get(messageTask.getTaskType()) : messageTask.getTaskType(),
null,
new LinkedList<>());
return JSON.toJSONString(details);
}
return null;
}
} }