From 608d4a04b7e1caaae7afec7cf0928ff3c179f1fd Mon Sep 17 00:00:00 2001 From: AgAngle <1323481023@qq.com> Date: Tue, 10 Dec 2024 11:44:47 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?ID=E7=AD=9B=E9=80=89=EF=BC=8C=E6=A8=A1=E5=9D=97=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E6=95=B0=E6=98=BE=E7=A4=BA=E6=9C=89=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1049981 --user=陈建星 【测试跟踪】github#34489,功能用例自定义ID筛选存在问题 https://www.tapd.cn/55049933/s/1627444 --- .../metersphere/controller/TestCaseNodeController.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test-track/backend/src/main/java/io/metersphere/controller/TestCaseNodeController.java b/test-track/backend/src/main/java/io/metersphere/controller/TestCaseNodeController.java index a8cd9f8c24..86459168fd 100644 --- a/test-track/backend/src/main/java/io/metersphere/controller/TestCaseNodeController.java +++ b/test-track/backend/src/main/java/io/metersphere/controller/TestCaseNodeController.java @@ -1,9 +1,11 @@ package io.metersphere.controller; +import io.metersphere.base.domain.ProjectApplication; import io.metersphere.base.domain.TestCaseNode; import io.metersphere.commons.constants.OperLogConstants; import io.metersphere.commons.constants.OperLogModule; import io.metersphere.commons.constants.PermissionConstants; +import io.metersphere.commons.constants.ProjectApplicationType; import io.metersphere.dto.TestCaseNodeDTO; import io.metersphere.log.annotation.MsAuditLog; import io.metersphere.log.annotation.MsRequestLog; @@ -14,9 +16,11 @@ import io.metersphere.request.testcase.QueryTestCaseRequest; import io.metersphere.request.testreview.QueryCaseReviewRequest; import io.metersphere.security.CheckOwner; import io.metersphere.service.BaseCheckPermissionService; +import io.metersphere.service.BaseProjectApplicationService; import io.metersphere.service.TestCaseNodeService; import io.metersphere.service.wapper.CheckPermissionService; import jakarta.annotation.Resource; +import org.apache.commons.lang3.StringUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.web.bind.annotation.*; @@ -34,6 +38,8 @@ public class TestCaseNodeController { private CheckPermissionService trackCheckPermissionService; @Resource private BaseCheckPermissionService baseCheckPermissionService; + @Resource + private BaseProjectApplicationService projectApplicationService; @GetMapping("/list/{projectId}") @RequiresPermissions(value = {PermissionConstants.PROJECT_TRACK_CASE_READ}) @@ -49,6 +55,10 @@ public class TestCaseNodeController { if (request != null && request.getProjectId() != null) { projectId = request.getProjectId(); } + ProjectApplication projectApplication = projectApplicationService.getProjectApplication(request.getProjectId(), ProjectApplicationType.CASE_CUSTOM_NUM.name()); + if (projectApplication != null && StringUtils.isNotEmpty(projectApplication.getTypeValue()) && request.getCombine() != null) { + request.getCombine().put("caseCustomNum", projectApplication.getTypeValue()); + } baseCheckPermissionService.checkProjectOwner(projectId); return testCaseNodeService.getNodeTreeByProjectId(projectId, Optional.ofNullable(request).orElse(new QueryTestCaseRequest()));