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;