From 050d08a99835edcb51bd0fbd66fc4c1fd6ea6b59 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Tue, 21 May 2024 10:32:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=94=A8=E4=BE=8B=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E5=85=B3=E8=81=94=E5=85=B6=E4=BB=96=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../functional/controller/FunctionalTestCaseController.java | 2 +- .../functional/request/DisassociateOtherCaseRequest.java | 2 +- .../functional/service/FunctionalTestCaseService.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalTestCaseController.java b/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalTestCaseController.java index ef0e3b9215..0b5bc84ea0 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalTestCaseController.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalTestCaseController.java @@ -77,7 +77,7 @@ public class FunctionalTestCaseController { @Operation(summary = "用例管理-功能用例-关联其他用例-取消关联用例") @Log(type = OperationLogType.DISASSOCIATE, expression = "#msClass.disassociateCaseLog(#request)", msClass = FunctionalCaseLogService.class) @RequiresPermissions(value = {PermissionConstants.FUNCTIONAL_CASE_READ_ADD, PermissionConstants.FUNCTIONAL_CASE_READ_UPDATE, PermissionConstants.FUNCTIONAL_CASE_READ_DELETE}, logical = Logical.OR) - @CheckOwner(resourceId = "#request.projectId", resourceType = "project") + @CheckOwner(resourceId = "#request.caseId", resourceType = "functional_case") public void disassociateCase(@Validated @RequestBody DisassociateOtherCaseRequest request) { functionalTestCaseService.disassociateCase(request); } diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/request/DisassociateOtherCaseRequest.java b/backend/services/case-management/src/main/java/io/metersphere/functional/request/DisassociateOtherCaseRequest.java index 09c7ab436f..39f851c4d9 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/request/DisassociateOtherCaseRequest.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/request/DisassociateOtherCaseRequest.java @@ -9,7 +9,7 @@ import lombok.Data; public class DisassociateOtherCaseRequest extends BaseFunctionalCaseBatchDTO { @Schema(description = "功能用例选择的项目id", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{case_review_case.project_id.not_blank}") + @NotBlank(message = "{functional_case.id.not_blank}") private String caseId; @Schema(description = "关联用例的类型(API,SCENARIO,UI,PERFORMANCE)", requiredMode = Schema.RequiredMode.REQUIRED) diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalTestCaseService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalTestCaseService.java index 5f58446145..97f4d89d45 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalTestCaseService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalTestCaseService.java @@ -191,7 +191,7 @@ public class FunctionalTestCaseService { public List doSelectIds(DisassociateOtherCaseRequest request) { if (request.isSelectAll()) { List ids = extFunctionalCaseTestMapper.getIds(request); - if (org.apache.commons.collections.CollectionUtils.isNotEmpty(request.getExcludeIds())) { + if (CollectionUtils.isNotEmpty(request.getExcludeIds())) { ids.removeAll(request.getExcludeIds()); } return ids;