fix(用例管理): 修复功能用例取消关联其他用例报错问题

This commit is contained in:
guoyuqi 2024-05-21 10:32:51 +08:00 committed by Craftsman
parent 329e32f9c6
commit 050d08a998
3 changed files with 3 additions and 3 deletions

View File

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

View File

@ -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)

View File

@ -191,7 +191,7 @@ public class FunctionalTestCaseService {
public List<String> doSelectIds(DisassociateOtherCaseRequest request) {
if (request.isSelectAll()) {
List<String> ids = extFunctionalCaseTestMapper.getIds(request);
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(request.getExcludeIds())) {
if (CollectionUtils.isNotEmpty(request.getExcludeIds())) {
ids.removeAll(request.getExcludeIds());
}
return ids;