From 67f0e41a93fc79f6375d416f4671ff701d97b18a Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Mon, 31 Oct 2022 16:32:40 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5=E7=9A=84=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E5=AF=B9=E8=B1=A1=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1018658 --user=李玉号 【系统设置】操作日志-“新建”消息通知的消息设置日志显示的是“更新” https://www.tapd.cn/55049933/s/1283804 --- .../sdk-parent/frontend/src/i18n/lang/zh-CN.js | 1 + .../notice/controller/NoticeController.java | 2 +- .../notice/service/NoticeService.java | 18 +++++++++++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/framework/sdk-parent/frontend/src/i18n/lang/zh-CN.js b/framework/sdk-parent/frontend/src/i18n/lang/zh-CN.js index fcf0a40ecd..2defafb982 100644 --- a/framework/sdk-parent/frontend/src/i18n/lang/zh-CN.js +++ b/framework/sdk-parent/frontend/src/i18n/lang/zh-CN.js @@ -2423,6 +2423,7 @@ const message = { organization_member: "组织-成员", organization_workspace: "组织-工作空间", workspace_service_integration: "工作空间-服务集成", + project_message_settings: "项目-消息设置", project_settings: "项目-消息设置", workspace_member: "工作空间-成员", project_template_settings_field: "项目-模版设置-自定义字段", diff --git a/framework/sdk-parent/sdk/src/main/java/io/metersphere/notice/controller/NoticeController.java b/framework/sdk-parent/sdk/src/main/java/io/metersphere/notice/controller/NoticeController.java index 9dbecfb157..3392b85fee 100644 --- a/framework/sdk-parent/sdk/src/main/java/io/metersphere/notice/controller/NoticeController.java +++ b/framework/sdk-parent/sdk/src/main/java/io/metersphere/notice/controller/NoticeController.java @@ -35,7 +35,7 @@ public class NoticeController { } @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) { return noticeService.delMessage(identification); } diff --git a/framework/sdk-parent/sdk/src/main/java/io/metersphere/notice/service/NoticeService.java b/framework/sdk-parent/sdk/src/main/java/io/metersphere/notice/service/NoticeService.java index 0b531de6a1..0325a9160d 100644 --- a/framework/sdk-parent/sdk/src/main/java/io/metersphere/notice/service/NoticeService.java +++ b/framework/sdk-parent/sdk/src/main/java/io/metersphere/notice/service/NoticeService.java @@ -189,8 +189,24 @@ public class NoticeService { } } List 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); return JSON.toJSONString(details); } + + public String getDelLogDetails(String identification) { + MessageTaskExample example = new MessageTaskExample(); + example.createCriteria().andIdentificationEqualTo(identification); + List 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; + } }