From a5605230c7905485d8d7b8f1f57047ee9769bfe6 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Fri, 24 Sep 2021 15:26:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89)=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=A8=E4=BE=8B=E5=85=A8=E9=80=89=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20--bug=3D1006483=20--user=3D=E8=B5=B5=E5=8B=87=20?= =?UTF-8?q?=E3=80=90=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95=E3=80=91case?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=89=A7=E8=A1=8C=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=E5=8F=AA=E6=89=A7=E8=A1=8C=E4=BA=86=E7=AC=AC=E4=B8=80=E9=A1=B5?= =?UTF-8?q?=E7=9A=84case=20https://www.tapd.cn/55049933/s/1051212?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/api/dto/ApiCaseBatchRequest.java | 3 ++- .../metersphere/api/service/ApiTestCaseService.java | 2 +- .../base/mapper/ext/ExtApiTestCaseMapper.java | 2 +- .../definition/components/list/ApiCaseSimpleList.vue | 12 +++++++++--- 4 files changed, 13 insertions(+), 6 deletions(-) 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();