feat(任务中心): 修复任务详情停止操作日志未生成问题

--bug=1048046 --user=王旭 【项目任务中心】任务详情-操作-停止任务-未生成系统日志 https://www.tapd.cn/55049933/s/1601605
This commit is contained in:
WangXu10 2024-10-30 10:27:38 +08:00 committed by Craftsman
parent 0ba1d0ac2b
commit ba00ddf70b
4 changed files with 6 additions and 72 deletions

View File

@ -136,10 +136,11 @@ public class ProjectTaskHubController {
@GetMapping("/exec-task/item/stop/{id}")
@Operation(summary = "项目-任务中心-用例任务详情-停止任务")
@Log(type = OperationLogType.STOP, expression = "#msClass.projectStopItemLog(#id)", msClass = BaseTaskHubLogService.class)
@RequiresPermissions(PermissionConstants.PROJECT_CASE_TASK_CENTER_EXEC_STOP)
public void stopTaskItem(@PathVariable String id) {
baseTaskHubService.stopTaskItem(id, SessionUtils.getUserId(), null, null);
baseTaskHubLogService.taskItemBatchLog(List.of(id), SessionUtils.getUserId(), OperationLogType.STOP.name(), SessionUtils.getCurrentProjectId(), SessionUtils.getCurrentOrganizationId(),
"/project/task-center/exec-task/item/stop/", OperationLogModule.PROJECT_MANAGEMENT_TASK_CENTER);
}
@PostMapping("/exec-task/item/batch-stop")

View File

@ -147,10 +147,11 @@ public class OrganizationTaskHubController {
@GetMapping("/exec-task/item/stop/{id}")
@Operation(summary = "组织-任务中心-用例任务详情-停止任务")
@Log(type = OperationLogType.STOP, expression = "#msClass.orgStopItemLog(#id)", msClass = BaseTaskHubLogService.class)
@RequiresPermissions(PermissionConstants.ORGANIZATION_CASE_TASK_CENTER_EXEC_STOP)
public void stopTaskItem(@PathVariable String id) {
baseTaskHubService.stopTaskItem(id, SessionUtils.getUserId(), SessionUtils.getCurrentOrganizationId(), null);
baseTaskHubLogService.taskItemBatchLog(List.of(id), SessionUtils.getUserId(), OperationLogType.STOP.name(), OperationLogConstants.ORGANIZATION, SessionUtils.getCurrentOrganizationId(),
"/organization/task-center/exec-task/item/stop/", OperationLogModule.SETTING_ORGANIZATION_TASK_CENTER);
}
@PostMapping("/exec-task/item/batch-stop")

View File

@ -164,10 +164,11 @@ public class SystemTaskHubController {
@GetMapping("/exec-task/item/stop/{id}")
@Operation(summary = "系统-任务中心-用例任务详情-停止任务")
@Log(type = OperationLogType.STOP, expression = "#msClass.systemStopItemLog(#id)", msClass = BaseTaskHubLogService.class)
@RequiresPermissions(PermissionConstants.SYSTEM_CASE_TASK_CENTER_EXEC_STOP)
public void stopTaskItem(@PathVariable String id) {
baseTaskHubService.stopTaskItem(id, SessionUtils.getUserId(), null, null);
baseTaskHubLogService.taskItemBatchLog(List.of(id), SessionUtils.getUserId(), OperationLogType.STOP.name(), OperationLogConstants.SYSTEM, OperationLogConstants.SYSTEM,
"/system/task-center/exec-task/item/stop/", OperationLogModule.SETTING_SYSTEM_TASK_CENTER);
}
@PostMapping("/exec-task/item/batch-stop")

View File

@ -171,29 +171,6 @@ public class BaseTaskHubLogService {
}
/**
* 系统停止任务项日志
*
* @param id
* @return
*/
public LogDTO systemStopItemLog(String id) {
ExecTaskItem execTaskItem = execTaskItemMapper.selectByPrimaryKey(id);
LogDTO dto = null;
if (execTaskItem != null) {
dto = new LogDTO(
OperationLogConstants.SYSTEM,
OperationLogConstants.SYSTEM,
execTaskItem.getId(),
null,
OperationLogType.STOP.name(),
OperationLogModule.SETTING_SYSTEM_TASK_CENTER,
execTaskItem.getResourceName());
}
return dto;
}
/**
* 任务项 批量操作日志统一记录
*
@ -233,52 +210,6 @@ public class BaseTaskHubLogService {
}
/**
* 组织停止任务项日志
*
* @param id
* @return
*/
public LogDTO orgStopItemLog(String id) {
ExecTaskItem execTaskItem = execTaskItemMapper.selectByPrimaryKey(id);
LogDTO dto = null;
if (execTaskItem != null) {
dto = new LogDTO(
OperationLogConstants.ORGANIZATION,
null,
execTaskItem.getId(),
null,
OperationLogType.STOP.name(),
OperationLogModule.SETTING_ORGANIZATION_TASK_CENTER,
execTaskItem.getResourceName());
}
return dto;
}
/**
* 项目停止任务项日志
*
* @param id
* @return
*/
public LogDTO projectStopItemLog(String id) {
ExecTaskItem execTaskItem = execTaskItemMapper.selectByPrimaryKey(id);
LogDTO dto = null;
if (execTaskItem != null) {
dto = new LogDTO(
OperationLogConstants.ORGANIZATION,
null,
execTaskItem.getId(),
null,
OperationLogType.STOP.name(),
OperationLogModule.SETTING_ORGANIZATION_TASK_CENTER,
execTaskItem.getResourceName());
}
return dto;
}
/**
* 任务批量 操作日志统一处理
*