From f9ee1c5f894d012b1322d3a91a9e0605c2c775b3 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Sat, 22 Jan 2022 14:26:28 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA=20):?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E5=85=AC=E5=85=B1=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E5=BA=93=E6=89=B9=E9=87=8F=E5=A4=8D=E5=88=B6=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E5=88=B0=E6=A8=A1=E5=9D=97=E5=90=8E=EF=BC=8C=E5=86=8D=E6=AC=A1?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=A4=8D=E5=88=B6=E5=88=B0=E5=90=8C=E4=B8=80?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E4=BC=9A=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1009848 --user=王孝刚 公共用例库 批量复制用例到模块后,再次批量复制到同一模块会报错 https://www.tapd.cn/55049933/s/1096183 --- .../base/mapper/ext/ExtTestCaseMapper.java | 3 + .../base/mapper/ext/ExtTestCaseMapper.xml | 155 ++++++++++-------- .../track/service/TestCaseService.java | 2 +- .../track/case/components/TestCaseList.vue | 2 + 4 files changed, 94 insertions(+), 68 deletions(-) diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.java index a5c8becb22..7b8bcc9aae 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.java @@ -67,8 +67,11 @@ public interface ExtTestCaseMapper { List selectIds(@Param("request") BaseQueryRequest condition); + List selectPublicIds(@Param("request") BaseQueryRequest condition); + /** * 按照用例等级统计 + * * @param projectId 项目ID * @return 统计结果 */ diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml index 33b9215666..921ac8f86b 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml @@ -82,7 +82,6 @@ update test_case set custom_num = num where (custom_num is null or custom_num = '') and project_id = #{projectId} - @@ -516,6 +460,83 @@ + + diff --git a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java index 41a09d7168..5c30658a5d 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java @@ -1466,7 +1466,7 @@ public class TestCaseService { public void copyTestCaseBathPublic(TestCaseBatchRequest request) { ServiceUtils.getSelectAllIds(request, request.getCondition(), - (query) -> extTestCaseMapper.selectIds(query)); + (query) -> extTestCaseMapper.selectPublicIds(query)); List ids = request.getIds(); if (CollectionUtils.isEmpty(ids)) { return; diff --git a/frontend/src/business/components/track/case/components/TestCaseList.vue b/frontend/src/business/components/track/case/components/TestCaseList.vue index d54fad71e9..aea9266c40 100644 --- a/frontend/src/business/components/track/case/components/TestCaseList.vue +++ b/frontend/src/business/components/track/case/components/TestCaseList.vue @@ -1158,6 +1158,8 @@ export default { copyPublic(param) { param.condition = this.condition; param.projectId = this.projectId; + param.condition.projectId = null; + param.condition.ids = null; this.page.result = this.$post('/test/case/batch/copy/public', param, () => { this.$success(this.$t('commons.save_success')); this.$refs.testBatchMove.close();