From 91cbccfec1f9737616ec14d2ce9436f11f6420cb Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Thu, 20 Jun 2024 17:57:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E6=8A=A5=E5=91=8A=E5=90=8D=E7=A7=B0=E4=BF=AE=E6=94=B9=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E8=AE=B0=E5=BD=95=E6=9C=89=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1042754 --user=宋昌昌 【测试计划】报告-快捷修改名称-查看系统/组织/项目日志-日志名称显示的为修改前的名称,应该显示修改后的名称 https://www.tapd.cn/55049933/s/1533063 --- .../controller/TestPlanReportController.java | 2 +- .../plan/service/TestPlanReportLogService.java | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportController.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportController.java index ca38a3abe8..26f3e8148a 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportController.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanReportController.java @@ -62,7 +62,7 @@ public class TestPlanReportController { @Operation(summary = "测试计划-报告-重命名") @RequiresPermissions(PermissionConstants.TEST_PLAN_REPORT_READ_UPDATE) @CheckOwner(resourceId = "#id", resourceType = "test_plan_report") - @Log(type = OperationLogType.UPDATE, expression = "#msClass.updateLog(#id)", msClass = TestPlanReportLogService.class) + @Log(type = OperationLogType.UPDATE, expression = "#msClass.renameLog(#id, #name)", msClass = TestPlanReportLogService.class) public void rename(@PathVariable String id, @RequestBody Object name) { testPlanReportService.rename(id, name.toString()); } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportLogService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportLogService.java index 7f487008ad..11cf4fe48c 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportLogService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportLogService.java @@ -68,6 +68,24 @@ public class TestPlanReportLogService { return dto; } + public LogDTO renameLog(String id, Object name) { + TestPlanReport report = testPlanReportMapper.selectByPrimaryKey(id); + Project project = projectMapper.selectByPrimaryKey(report.getProjectId()); + LogDTO dto = new LogDTO( + report.getProjectId(), + project.getOrganizationId(), + report.getId(), + null, + OperationLogType.UPDATE.name(), + OperationLogModule.TEST_PLAN_REPORT, + name.toString()); + + dto.setPath(OperationLogAspect.getPath()); + dto.setMethod(HttpMethodConstants.GET.name()); + dto.setOriginalValue(JSON.toJSONBytes(report)); + return dto; + } + public LogDTO updateDetailLog(TestPlanReportDetailEditRequest request) { return updateLog(request.getId()); }