From 04b10fb846f6b2d9992aaeb3eae7b7d2f5e9151a Mon Sep 17 00:00:00 2001 From: AgAngle <1323481023@qq.com> Date: Wed, 20 Mar 2024 19:53:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=89=A7=E8=A1=8C=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E6=8A=A5=E5=91=8A=E6=B2=A1=E6=9C=89=E8=AE=BE=E7=BD=AE=E7=8E=AF?= =?UTF-8?q?=E5=A2=83ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/service/definition/ApiTestCaseBatchRunService.java | 1 - .../api/service/definition/ApiTestCaseService.java | 1 + .../api/service/scenario/ApiScenarioService.java | 6 ++++-- 3 files changed, 5 insertions(+), 3 deletions(-) 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 849d878b73..a0248f060a 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 @@ -27,7 +27,6 @@ import io.metersphere.sdk.util.BeanUtils; import io.metersphere.sdk.util.LogUtils; import io.metersphere.sdk.util.SubListUtils; import jakarta.annotation.Resource; -import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseService.java index 08ce0bb51f..132cfd946e 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiTestCaseService.java @@ -735,6 +735,7 @@ public class ApiTestCaseService extends MoveNodeService { apiReport.setName(apiTestCase.getName()); apiReport.setRunMode(ApiBatchRunMode.PARALLEL.name()); apiReport.setPoolId(poolId); + apiReport.setEnvironmentId(apiTestCase.getEnvironmentId()); apiReport.setProjectId(apiTestCase.getProjectId()); // 创建报告和用例的关联关系 diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/scenario/ApiScenarioService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/scenario/ApiScenarioService.java index a012504770..c0b12f07ca 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/scenario/ApiScenarioService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/scenario/ApiScenarioService.java @@ -1134,7 +1134,7 @@ public class ApiScenarioService extends MoveNodeService { parseConfig.setReportId(reportId); // 初始化报告 - initApiReport(apiScenario, reportId, poolId, userId); + initApiReport(apiScenario, reportId, parseParam.getEnvironmentId(), poolId, userId); // 初始化报告步骤 initScenarioReportSteps(steps, taskRequest.getReportId()); @@ -1150,7 +1150,7 @@ public class ApiScenarioService extends MoveNodeService { * @param userId * @return */ - public ApiScenarioRecord initApiReport(ApiScenario apiScenario, String reportId, String poolId, String userId) { + public ApiScenarioRecord initApiReport(ApiScenario apiScenario, String envId, String reportId, String poolId, String userId) { // 初始化报告 ApiScenarioReport scenarioReport = getScenarioReport(userId); scenarioReport.setId(reportId); @@ -1158,6 +1158,8 @@ public class ApiScenarioService extends MoveNodeService { scenarioReport.setName(apiScenario.getName()); scenarioReport.setRunMode(ApiBatchRunMode.PARALLEL.name()); scenarioReport.setPoolId(poolId); + scenarioReport.setEnvironmentId(apiScenario.getEnvironmentId()); + scenarioReport.setEnvironmentId(envId); scenarioReport.setProjectId(apiScenario.getProjectId()); // 创建报告和用例的关联关系