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 b13fd92621..bd560d820d 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 @@ -274,7 +274,7 @@ public class ApiTestCaseBatchRunService { */ private ApiReport initIntegratedReport(ApiRunModeConfigDTO runModeConfig, List ids, String userId, String projectId) { ApiReport apiReport = getApiReport(runModeConfig, userId); - apiReport.setName(runModeConfig.getCollectionReport().getReportName() + DateUtils.getTimeString(System.currentTimeMillis())); + apiReport.setName(runModeConfig.getCollectionReport().getReportName() + "_" + DateUtils.getTimeString(System.currentTimeMillis())); apiReport.setIntegrated(true); apiReport.setProjectId(projectId); // 初始化集成报告与用例的关联关系 @@ -369,7 +369,7 @@ public class ApiTestCaseBatchRunService { private ApiReport getApiReport(ApiRunModeConfigDTO runModeConfig, ApiTestCase apiTestCase, String userId) { ApiReport apiReport = getApiReport(runModeConfig, userId); apiReport.setEnvironmentId(getEnvId(runModeConfig, apiTestCase)); - apiReport.setName(apiTestCase.getName() + DateUtils.getTimeString(System.currentTimeMillis())); + apiReport.setName(apiTestCase.getName() + "_" + DateUtils.getTimeString(System.currentTimeMillis())); apiReport.setProjectId(apiTestCase.getProjectId()); apiReport.setTriggerMode(TaskTriggerMode.BATCH.name()); return apiReport; 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 46962d2796..af760e970a 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 @@ -724,7 +724,7 @@ public class ApiTestCaseService extends MoveNodeService { ApiReport apiReport = getApiReport(userId); apiReport.setId(reportId); apiReport.setTriggerMode(TaskTriggerMode.MANUAL.name()); - apiReport.setName(apiTestCase.getName() + DateUtils.getTimeString(System.currentTimeMillis())); + apiReport.setName(apiTestCase.getName() + "_" + DateUtils.getTimeString(System.currentTimeMillis())); apiReport.setRunMode(ApiBatchRunMode.PARALLEL.name()); apiReport.setPoolId(poolId); apiReport.setEnvironmentId(apiTestCase.getEnvironmentId()); 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 cad7f04254..e9687d3e0c 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 @@ -23,6 +23,7 @@ import io.metersphere.sdk.dto.api.task.TaskRequestDTO; import io.metersphere.sdk.dto.queue.ExecutionQueue; import io.metersphere.sdk.dto.queue.ExecutionQueueDetail; import io.metersphere.sdk.util.BeanUtils; +import io.metersphere.sdk.util.DateUtils; import io.metersphere.sdk.util.LogUtils; import io.metersphere.system.uid.IDGenerator; import jakarta.annotation.Resource; @@ -236,7 +237,7 @@ public class ApiScenarioBatchRunService { */ private ApiScenarioReport initIntegratedReport(ApiRunModeConfigDTO runModeConfig, List ids, String userId, String projectId) { ApiScenarioReport apiScenarioReport = getScenarioReport(runModeConfig, userId); - apiScenarioReport.setName(runModeConfig.getCollectionReport().getReportName()); + apiScenarioReport.setName(runModeConfig.getCollectionReport().getReportName() + "_" + DateUtils.getTimeString(System.currentTimeMillis())); apiScenarioReport.setIntegrated(true); apiScenarioReport.setProjectId(projectId); // 初始化集成报告与用例的关联关系 @@ -334,7 +335,7 @@ public class ApiScenarioBatchRunService { private ApiScenarioReport getScenarioReport(ApiRunModeConfigDTO runModeConfig, ApiScenario apiScenario, String userId) { ApiScenarioReport apiScenarioReport = getScenarioReport(runModeConfig, userId); apiScenarioReport.setEnvironmentId(getEnvId(runModeConfig, apiScenario)); - apiScenarioReport.setName(apiScenario.getName()); + apiScenarioReport.setName(apiScenario.getName() + "_" + DateUtils.getTimeString(System.currentTimeMillis())); apiScenarioReport.setProjectId(apiScenario.getProjectId()); apiScenarioReport.setTriggerMode(TaskTriggerMode.BATCH.name()); return apiScenarioReport; 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 f7747c7b56..0a9c22b154 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 @@ -1292,7 +1292,7 @@ public class ApiScenarioService extends MoveNodeService { ApiScenarioReport scenarioReport = getScenarioReport(userId); scenarioReport.setId(reportId); scenarioReport.setTriggerMode(TaskTriggerMode.MANUAL.name()); - scenarioReport.setName(apiScenario.getName() + DateUtils.getTimeString(System.currentTimeMillis())); + scenarioReport.setName(apiScenario.getName() + "_" + DateUtils.getTimeString(System.currentTimeMillis())); scenarioReport.setRunMode(ApiBatchRunMode.PARALLEL.name()); scenarioReport.setPoolId(poolId); scenarioReport.setEnvironmentId(apiScenario.getEnvironmentId());