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'); });