diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/PlanRunApiScenarioExecuteCallbackService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/PlanRunApiScenarioExecuteCallbackService.java index 6e6ca403b4..1c12d1615d 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/PlanRunApiScenarioExecuteCallbackService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/PlanRunApiScenarioExecuteCallbackService.java @@ -58,7 +58,7 @@ public class PlanRunApiScenarioExecuteCallbackService implements ApiExecuteCallb ApiScenarioDetail apiScenarioDetail = apiScenarioRunService.getForRunWithTaskItemErrorMassage(request.getTaskItem().getId(), testPlanReportApiScenario.getApiScenarioId()); apiScenarioDetail.setEnvironmentId(testPlanReportApiScenario.getEnvironmentId()); apiScenarioDetail.setGrouped(testPlanReportApiScenario.getGrouped()); - GetRunScriptResult result = planRunTestPlanApiScenarioService.getRunScript(request); + GetRunScriptResult result = apiScenarioRunService.getRunScript(request, apiScenarioDetail); String reportId = initReport(request, testPlanReportApiScenario, apiScenarioDetail); result.setReportId(reportId); return result; diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/PlanRunTestPlanApiScenarioService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/PlanRunTestPlanApiScenarioService.java index c62c35af45..53215a34df 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/PlanRunTestPlanApiScenarioService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/PlanRunTestPlanApiScenarioService.java @@ -2,7 +2,6 @@ package io.metersphere.plan.service; import io.metersphere.api.domain.ApiScenario; import io.metersphere.api.domain.ApiScenarioReport; -import io.metersphere.api.dto.scenario.ApiScenarioDetail; import io.metersphere.api.mapper.ApiScenarioMapper; import io.metersphere.api.service.ApiBatchRunBaseService; import io.metersphere.api.service.ApiExecuteService; @@ -201,13 +200,4 @@ public class PlanRunTestPlanApiScenarioService { apiExecutionQueueService.deleteQueue(queue.getQueueId()); } } - - public GetRunScriptResult getRunScript(GetRunScriptRequest request) { - TaskItem taskItem = request.getTaskItem(); - TestPlanReportApiScenario testPlanReportApiScenario = testPlanReportApiScenarioMapper.selectByPrimaryKey(taskItem.getResourceId()); - ApiScenarioDetail apiScenarioDetail = apiScenarioRunService.getForRun(testPlanReportApiScenario.getApiScenarioId()); - apiScenarioDetail.setEnvironmentId(testPlanReportApiScenario.getEnvironmentId()); - apiScenarioDetail.setGrouped(testPlanReportApiScenario.getGrouped()); - return apiScenarioRunService.getRunScript(request, apiScenarioDetail); - } }