diff --git a/api-test/backend/src/main/java/io/metersphere/controller/scenario/ApiScenarioController.java b/api-test/backend/src/main/java/io/metersphere/controller/scenario/ApiScenarioController.java index a7e0f0d9ef..bde9bb972f 100644 --- a/api-test/backend/src/main/java/io/metersphere/controller/scenario/ApiScenarioController.java +++ b/api-test/backend/src/main/java/io/metersphere/controller/scenario/ApiScenarioController.java @@ -328,11 +328,11 @@ public class ApiScenarioController { List reportIds = new ArrayList<>(); TaskRequestDTO taskRequest = new TaskRequestDTO(); taskRequest.setReportId(reportId); - taskRequest.setType(ElementConstants.SCENARIO); + taskRequest.setType(ElementConstants.SCENARIO_UPPER); reportIds.add(taskRequest); WebSocketUtil.onClose(reportId); - apiTaskService.stop(reportIds); + apiTaskService.apiStop(reportIds); } } diff --git a/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioReportService.java b/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioReportService.java index fb6eff5695..73c4229cdb 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioReportService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioReportService.java @@ -44,6 +44,7 @@ import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import jakarta.annotation.Resource; + import java.nio.charset.StandardCharsets; import java.util.*; import java.util.stream.Collectors; @@ -262,7 +263,8 @@ public class ApiScenarioReportService { report = new ApiScenarioReportWithBLOBs(); report.setId(reportId); } - if (StringUtils.equals(reportType, RunModeConstants.SET_REPORT.toString())) { + if (StringUtils.equals(reportType, RunModeConstants.SET_REPORT.toString()) + || StringUtils.equals(report.getStatus(), ApiReportStatus.STOPPED.name())) { return report; } if (StringUtils.equals(runMode, CommonConstants.CASE)) {