diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseBatchRunService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseBatchRunService.java index cf42e7dfbe..cdc4a4eabb 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseBatchRunService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseBatchRunService.java @@ -494,7 +494,7 @@ public class ApiTestCaseBatchRunService { private void serialRerunExecute(ExecTask execTask, String userId) { ApiRunModeConfigDTO runModeConfig = getRunModeConfig(execTask); - List execTaskItems = extExecTaskItemMapper.selectIdAndResourceIdByTaskId(execTask.getId()); + List execTaskItems = extExecTaskItemMapper.selectRerunIdAndResourceIdByTaskId(execTask.getId()); // 初始化执行队列 ExecutionQueue queue = apiBatchRunBaseService.getExecutionQueue(runModeConfig, ApiExecuteResourceType.API_CASE.name(), execTask.getId(), userId); @@ -516,7 +516,7 @@ public class ApiTestCaseBatchRunService { */ public void parallelRerunExecute(ExecTask execTask, String userId) { String projectId = execTask.getProjectId(); - List execTaskItems = extExecTaskItemMapper.selectIdAndResourceIdByTaskId(execTask.getId()); + List execTaskItems = extExecTaskItemMapper.selectRerunIdAndResourceIdByTaskId(execTask.getId()); ApiRunModeConfigDTO runModeConfig = getRunModeConfig(execTask); // 记录用例和任务的映射 diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/scenario/ApiScenarioBatchRunService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/scenario/ApiScenarioBatchRunService.java index 604f23f522..92be83136d 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/scenario/ApiScenarioBatchRunService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/scenario/ApiScenarioBatchRunService.java @@ -464,7 +464,7 @@ public class ApiScenarioBatchRunService { private void serialRerunExecute(ExecTask execTask, String userId) { ApiRunModeConfigDTO runModeConfig = apiTestCaseBatchRunService.getRunModeConfig(execTask); - List execTaskItems = extExecTaskItemMapper.selectIdAndResourceIdByTaskId(execTask.getId()); + List execTaskItems = extExecTaskItemMapper.selectRerunIdAndResourceIdByTaskId(execTask.getId()); // 删除重跑的步骤 deleteRerunIntegratedStepResult(execTask, execTaskItems, runModeConfig); @@ -489,7 +489,7 @@ public class ApiScenarioBatchRunService { */ public void parallelRerunExecute(ExecTask execTask, String userId) { String projectId = execTask.getProjectId(); - List execTaskItems = extExecTaskItemMapper.selectIdAndResourceIdByTaskId(execTask.getId()); + List execTaskItems = extExecTaskItemMapper.selectRerunIdAndResourceIdByTaskId(execTask.getId()); ApiRunModeConfigDTO runModeConfig = apiTestCaseBatchRunService.getRunModeConfig(execTask); // 删除重跑的步骤 diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtExecTaskItemMapper.java b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtExecTaskItemMapper.java index e646581ff6..80044690b3 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtExecTaskItemMapper.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtExecTaskItemMapper.java @@ -72,5 +72,7 @@ public interface ExtExecTaskItemMapper { List selectIdAndResourceIdByTaskId(@Param("taskId") String taskId); + List selectRerunIdAndResourceIdByTaskId(@Param("taskId") String taskId); + void deleteRerunTaskItem(@Param("taskId") String taskId, String userId); } diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtExecTaskItemMapper.xml b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtExecTaskItemMapper.xml index 68ff154f38..781241f5d9 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtExecTaskItemMapper.xml +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtExecTaskItemMapper.xml @@ -333,6 +333,12 @@ where task_id = #{taskId} and deleted = false + + insert into exec_task_item(id, task_id, resource_id, resource_name, task_origin, status, `result`, resource_pool_id, resource_pool_node, resource_type, project_id, organization_id, thread_id, start_time, end_time, executor, collection_id,