From fa81f2721f397054aa0edc77c3dac3f5e36ccdbe Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Tue, 29 Oct 2024 10:24:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=BB=E5=8A=A1=E4=B8=AD=E5=BF=83):=20?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E5=8D=B3=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=88=A0=E9=99=A4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1048270 --user=王旭 【系统设置】系统-任务中心-系统即时任务-全选所有页-删除-提示删除成功,实际一条数据都没删除掉 https://www.tapd.cn/55049933/s/1599907 --- .../project/controller/ProjectTaskHubController.java | 4 ++-- .../system/controller/OrganizationTaskHubController.java | 4 ++-- .../system/controller/SystemTaskHubController.java | 4 ++-- .../java/io/metersphere/system/mapper/ExtExecTaskMapper.java | 2 +- .../java/io/metersphere/system/mapper/ExtExecTaskMapper.xml | 4 +++- .../io/metersphere/system/service/BaseTaskHubService.java | 4 ++-- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectTaskHubController.java b/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectTaskHubController.java index 437b54eb17..3049953e9c 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectTaskHubController.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectTaskHubController.java @@ -102,7 +102,7 @@ public class ProjectTaskHubController { @Operation(summary = "项目-任务中心-用例执行任务-批量停止任务") @RequiresPermissions(PermissionConstants.PROJECT_CASE_TASK_CENTER_EXEC_STOP) public void batchStopTask(@Validated @RequestBody TableBatchProcessDTO request) { - List ids = baseTaskHubService.getTaskIds(request, null, SessionUtils.getCurrentProjectId()); + List ids = baseTaskHubService.getTaskIds(request, null, SessionUtils.getCurrentProjectId(), true); baseTaskHubService.batchStopTask(ids, SessionUtils.getUserId(), null, SessionUtils.getCurrentProjectId()); baseTaskHubLogService.taskBatchLog(ids, SessionUtils.getUserId(), OperationLogType.STOP.name(), SessionUtils.getCurrentProjectId(), SessionUtils.getCurrentOrganizationId(), "/project/task-center/exec-task/batch-stop", OperationLogModule.PROJECT_MANAGEMENT_TASK_CENTER); @@ -127,7 +127,7 @@ public class ProjectTaskHubController { @Operation(summary = "项目-任务中心-用例执行任务-批量删除任务") @RequiresPermissions(PermissionConstants.PROJECT_CASE_TASK_CENTER_DELETE) public void batchDeleteTask(@Validated @RequestBody TableBatchProcessDTO request) { - List ids = baseTaskHubService.getTaskIds(request, null, SessionUtils.getCurrentProjectId()); + List ids = baseTaskHubService.getTaskIds(request, null, SessionUtils.getCurrentProjectId(), false); baseTaskHubLogService.taskBatchLog(ids, SessionUtils.getUserId(), OperationLogType.DELETE.name(), SessionUtils.getCurrentProjectId(), SessionUtils.getCurrentOrganizationId(), "/project/task-center/exec-task/batch-delete", OperationLogModule.PROJECT_MANAGEMENT_TASK_CENTER); baseTaskHubService.batchDeleteTask(ids, null, SessionUtils.getCurrentProjectId()); diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/OrganizationTaskHubController.java b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/OrganizationTaskHubController.java index 5866868596..1b8a521dcb 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/OrganizationTaskHubController.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/OrganizationTaskHubController.java @@ -107,7 +107,7 @@ public class OrganizationTaskHubController { @Operation(summary = "组织-任务中心-用例执行任务-批量停止任务") @RequiresPermissions(PermissionConstants.ORGANIZATION_CASE_TASK_CENTER_EXEC_STOP) public void batchStopTask(@Validated @RequestBody TableBatchProcessDTO request) { - List ids = baseTaskHubService.getTaskIds(request, SessionUtils.getCurrentOrganizationId(), null); + List ids = baseTaskHubService.getTaskIds(request, SessionUtils.getCurrentOrganizationId(), null, true); baseTaskHubService.batchStopTask(ids, SessionUtils.getUserId(), SessionUtils.getCurrentOrganizationId(), null); //日志 baseTaskHubLogService.taskBatchLog(ids, SessionUtils.getUserId(), OperationLogType.STOP.name(), OperationLogConstants.ORGANIZATION, SessionUtils.getCurrentOrganizationId(), @@ -134,7 +134,7 @@ public class OrganizationTaskHubController { @Operation(summary = "组织-任务中心-用例执行任务-批量删除任务") @RequiresPermissions(PermissionConstants.ORGANIZATION_CASE_TASK_CENTER_DELETE) public void batchDeleteTask(@Validated @RequestBody TableBatchProcessDTO request) { - List ids = baseTaskHubService.getTaskIds(request, SessionUtils.getCurrentOrganizationId(), null); + List ids = baseTaskHubService.getTaskIds(request, SessionUtils.getCurrentOrganizationId(), null, false); //日志 baseTaskHubLogService.taskBatchLog(ids, SessionUtils.getUserId(), OperationLogType.DELETE.name(), OperationLogConstants.ORGANIZATION, SessionUtils.getCurrentOrganizationId(), "/organization/task-center/exec-task/batch-delete", OperationLogModule.SETTING_ORGANIZATION_TASK_CENTER); diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/SystemTaskHubController.java b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/SystemTaskHubController.java index c3831b9803..65d74425a6 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/SystemTaskHubController.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/SystemTaskHubController.java @@ -106,7 +106,7 @@ public class SystemTaskHubController { @Operation(summary = "系统-任务中心-用例执行任务-批量停止任务") @RequiresPermissions(PermissionConstants.SYSTEM_CASE_TASK_CENTER_EXEC_STOP) public void batchStopTask(@Validated @RequestBody TableBatchProcessDTO request) { - List ids = baseTaskHubService.getTaskIds(request, null, null); + List ids = baseTaskHubService.getTaskIds(request, null, null, true); baseTaskHubService.batchStopTask(ids, SessionUtils.getUserId(), null, null); //系統日志 baseTaskHubLogService.taskBatchLog(ids, SessionUtils.getUserId(), OperationLogType.STOP.name(), OperationLogConstants.SYSTEM, OperationLogConstants.SYSTEM, @@ -133,7 +133,7 @@ public class SystemTaskHubController { @Operation(summary = "系统-任务中心-用例执行任务-批量删除任务") @RequiresPermissions(PermissionConstants.SYSTEM_CASE_TASK_CENTER_DELETE) public void batchDeleteTask(@Validated @RequestBody TableBatchProcessDTO request) { - List ids = baseTaskHubService.getTaskIds(request, null, null); + List ids = baseTaskHubService.getTaskIds(request, null, null, false); //系統日志 baseTaskHubLogService.taskBatchLog(ids, SessionUtils.getUserId(), OperationLogType.DELETE.name(), OperationLogConstants.SYSTEM, OperationLogConstants.SYSTEM, "/system/task-center/exec-task/batch-delete", OperationLogModule.SETTING_SYSTEM_TASK_CENTER); diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtExecTaskMapper.java b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtExecTaskMapper.java index c364d9cae2..b03c743e1b 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtExecTaskMapper.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtExecTaskMapper.java @@ -17,7 +17,7 @@ public interface ExtExecTaskMapper { void deleteTaskByIds(@Param("ids") List ids, @Param("orgId") String orgId, @Param("projectId") String projectId); - List getIds(@Param("request") TableBatchProcessDTO request, @Param("organizationId") String organizationId, @Param("projectId") String projectId); + List getIds(@Param("request") TableBatchProcessDTO request, @Param("organizationId") String organizationId, @Param("projectId") String projectId, @Param("flag") boolean flag); void batchUpdateTaskStatus(@Param("ids") List ids, @Param("userId") String userId, @Param("organizationId") String organizationId, @Param("projectId") String projectId, @Param("status") String status); diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtExecTaskMapper.xml b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtExecTaskMapper.xml index 72ce2736b5..84a30fc5df 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtExecTaskMapper.xml +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtExecTaskMapper.xml @@ -47,7 +47,9 @@