From d499f3e287751233ddda72433973576e45cd3cf2 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Mon, 23 Aug 2021 15:09:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=A1=88=E4=BE=8B):=20#1?= =?UTF-8?q?005994=E3=80=90=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89=E3=80=91?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E5=88=97=E8=A1=A8=EF=BC=8C=E7=AD=9B=E9=80=89?= =?UTF-8?q?=E6=9C=AA=E6=89=A7=E8=A1=8C=E7=9A=84=E7=BB=93=E6=9E=9C=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E3=80=81#1006017=E3=80=90=E6=8E=A5=E5=8F=A3=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E3=80=91=E5=88=A0=E9=99=A4=E7=94=A8=E4=BE=8B=EF=BC=8C?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E5=88=97=E8=A1=A8=E6=B2=A1=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【【接口定义】用例列表,筛选未执行的结果失败】https://www.tapd.cn/55049933/bugtrace/bugs/view?bug_id=1155049933001005994;【【接口定义】删除用例,用例列表没更新】https://www.tapd.cn/55049933/bugtrace/bugs/view?bug_id=1155049933001006017 --- .../api/service/ApiTestCaseService.java | 2 +- .../base/mapper/ext/ExtApiTestCaseMapper.java | 1 - .../base/mapper/ext/ExtApiTestCaseMapper.xml | 35 ++++++++++++++----- .../db/migration/V93__v1.12_release.sql | 5 ++- .../components/case/ApiCaseItem.vue | 2 +- 5 files changed, 32 insertions(+), 13 deletions(-) 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 728373c475..47cf0d79d2 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiTestCaseService.java @@ -323,6 +323,7 @@ public class ApiTestCaseService { final ApiTestCaseWithBLOBs test = new ApiTestCaseWithBLOBs(); test.setId(request.getId()); test.setName(request.getName()); + test.setStatus(""); test.setApiDefinitionId(request.getApiDefinitionId()); test.setCreateUserId(Objects.requireNonNull(SessionUtils.getUser()).getId()); test.setUpdateUserId(Objects.requireNonNull(SessionUtils.getUser()).getId()); @@ -883,7 +884,6 @@ public class ApiTestCaseService { cannotReductionApiCaseList.stream().map(ApiTestCaseDTO::getId).collect(Collectors.toList()); List deleteIds = ids.stream().filter(id -> !cannotReductionCaseId.contains(id)).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(deleteIds)) { - extApiTestCaseMapper.checkOriginalStatusByIds(deleteIds); extApiTestCaseMapper.reduction(deleteIds); } } 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 56d61773c4..23f3cd200f 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 @@ -43,7 +43,6 @@ public interface ExtApiTestCaseMapper { int deleteToGc(ApiTestCaseRequest request); int reduction(@Param("ids") List ids); - void checkOriginalStatusByIds(@Param("ids") List ids); List getCannotReductionApiCaseList(@Param("ids") List ids); diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml index 8b91e538af..8ae5581585 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml @@ -532,6 +532,32 @@ AND t1.api_definition_id = #{request.apiDefinitionId} + + + + + + and t1.priority in + + #{value} + + + + and t1.status in + + #{value} + + + + + + and (t1.status is null or t1.status != 'Trash') + + + + + and (t1.status is null or t1.status != 'Trash') + and a.module_id in @@ -574,13 +600,4 @@ #{v} - - update api_test_case - set - original_status = 'Underway' - where (original_status IS NULL OR original_status = 'Trash') AND id in - - #{v} - - diff --git a/backend/src/main/resources/db/migration/V93__v1.12_release.sql b/backend/src/main/resources/db/migration/V93__v1.12_release.sql index 14c03c8f7d..5bf13499d5 100644 --- a/backend/src/main/resources/db/migration/V93__v1.12_release.sql +++ b/backend/src/main/resources/db/migration/V93__v1.12_release.sql @@ -98,4 +98,7 @@ ALTER TABLE share_info change ALTER TABLE test_plan ADD report_config text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '测试计划报告配置'; -- 删除不用的记录表 -DROP TABLE test_plan_report_resource; \ No newline at end of file +DROP TABLE test_plan_report_resource; +-- 统一接口案例未执行的状态字段 +update api_test_case SET `status` = '' WHERE `status` = 'Underway'; +update api_test_case SET `original_status` = '' WHERE `original_status` = 'Underway'; \ No newline at end of file diff --git a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue index e6f86bd26a..e506e427f3 100644 --- a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue +++ b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue @@ -285,7 +285,7 @@ export default { confirmButtonText: this.$t('commons.confirm'), callback: (action) => { if (action === 'confirm') { - this.$get('/api/testcase/delete/' + row.id, () => { + this.$get('/api/testcase/deleteToGc/' + row.id, () => { this.$success(this.$t('commons.delete_success')); this.$emit('refresh'); });