diff --git a/backend/src/main/java/io/metersphere/api/dto/ApiCaseBatchRequest.java b/backend/src/main/java/io/metersphere/api/dto/ApiCaseBatchRequest.java index 4d1b92087f..45004d0ab0 100644 --- a/backend/src/main/java/io/metersphere/api/dto/ApiCaseBatchRequest.java +++ b/backend/src/main/java/io/metersphere/api/dto/ApiCaseBatchRequest.java @@ -1,5 +1,6 @@ package io.metersphere.api.dto; +import io.metersphere.api.dto.definition.ApiTestCaseRequest; import io.metersphere.base.domain.ApiTestCaseWithBLOBs; import io.metersphere.controller.request.BaseQueryRequest; import io.metersphere.controller.request.OrderRequest; @@ -15,5 +16,5 @@ public class ApiCaseBatchRequest extends ApiTestCaseWithBLOBs { private List orders; private String projectId; private String environmentId; - private BaseQueryRequest condition; + private ApiTestCaseRequest condition; } diff --git a/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java b/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java index 0b1ef90999..1340f3daa8 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java @@ -701,7 +701,7 @@ public class ApiTestCaseService { public void batchRun(ApiCaseBatchRequest request) { ServiceUtils.getSelectAllIds(request, request.getCondition(), - (query) -> extApiTestCaseMapper.selectIdsByQuery(query)); + (query) -> extApiTestCaseMapper.selectIdsByQuery((ApiTestCaseRequest)query)); Map executeQueue = new HashMap<>(); SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH); ApiDefinitionExecResultMapper batchMapper = sqlSession.getMapper(ApiDefinitionExecResultMapper.class); diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.java index 1933160b42..49439a4ec7 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.java @@ -48,7 +48,7 @@ public interface ExtApiTestCaseMapper { List selectNameByIdIn(@Param("ids")List ids); String selectNameById(String id); - List selectIdsByQuery(BaseQueryRequest query); + List selectIdsByQuery(@Param("request") ApiTestCaseRequest request); List selectProjectIds(); diff --git a/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue b/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue index ea45eb40f3..5678a5a019 100644 --- a/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue +++ b/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue @@ -508,9 +508,15 @@ export default { this.$refs.batchRun.open(); }, runBatch(environment) { - this.condition.environmentId = environment.id; - this.condition.ids = this.$refs.caseTable.selectIds; - this.$post('/api/testcase/batch/run', this.condition, () => { + let obj = {}; + obj.projectId = this.projectId; + obj.selectAllDate = this.selectAll; + obj.unSelectIds = this.unSelection; + obj.ids = Array.from(this.selectRows).map(row => row.id); + obj.environmentId = environment.id; + obj.condition = this.condition; + + this.$post('/api/testcase/batch/run', obj, () => { this.condition.ids = []; this.$refs.batchRun.close(); this.search();