fix(测试计划): 报告名称修改日志记录有误

--bug=1042754 --user=宋昌昌 【测试计划】报告-快捷修改名称-查看系统/组织/项目日志-日志名称显示的为修改前的名称,应该显示修改后的名称 https://www.tapd.cn/55049933/s/1533063
This commit is contained in:
song-cc-rock 2024-06-20 17:57:36 +08:00 committed by Craftsman
parent 04d4115546
commit 91cbccfec1
2 changed files with 19 additions and 1 deletions

View File

@ -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());
}

View File

@ -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());
}