diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanFunctionalCaseController.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanFunctionalCaseController.java index 5cc616b50a0b..9eeed7fd1855 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanFunctionalCaseController.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanFunctionalCaseController.java @@ -63,7 +63,7 @@ public TestPlanResourceSortResponse sortNode(@Validated @RequestBody ResourceSor @PostMapping("/page") @Operation(summary = "测试计划-已关联功能用例分页查询") - @RequiresPermissions(PermissionConstants.FUNCTIONAL_CASE_READ) + @RequiresPermissions(PermissionConstants.TEST_PLAN_READ) @CheckOwner(resourceId = "#request.getTestPlanId()", resourceType = "test_plan") public Pager> page(@Validated @RequestBody TestPlanCaseRequest request) { Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize()); @@ -73,7 +73,7 @@ public Pager> page(@Validated @RequestBody TestPl @GetMapping("/tree/{testPlanId}") @Operation(summary = "测试计划-已关联功能用例列表模块树") - @RequiresPermissions(PermissionConstants.CASE_REVIEW_READ) + @RequiresPermissions(PermissionConstants.TEST_PLAN_READ) @CheckOwner(resourceId = "#testPlanId", resourceType = "test_plan") public List getTree(@PathVariable String testPlanId) { return testPlanFunctionalCaseService.getTree(testPlanId); @@ -81,7 +81,7 @@ public List getTree(@PathVariable String testPlanId) { @PostMapping("/module/count") @Operation(summary = "测试计划-已关联功能用例模块数量") - @RequiresPermissions(PermissionConstants.CASE_REVIEW_READ) + @RequiresPermissions(PermissionConstants.TEST_PLAN_READ) @CheckOwner(resourceId = "#request.getTestPlanId()", resourceType = "test_plan") public Map moduleCount(@Validated @RequestBody TestPlanCaseRequest request) { return testPlanFunctionalCaseService.moduleCount(request); diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanBaseUtilsService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanBaseUtilsService.java index 3dc7cc216868..9a6acb2d209a 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanBaseUtilsService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanBaseUtilsService.java @@ -39,20 +39,6 @@ public void validateTestPlan(TestPlan testPlan) { TestPlan group = testPlanMapper.selectByPrimaryKey(testPlan.getGroupId()); testPlan.setModuleId(group.getModuleId()); } - TestPlanExample example = new TestPlanExample(); - if (StringUtils.isBlank(testPlan.getId())) { - //新建 校验 - example.createCriteria().andNameEqualTo(testPlan.getName()).andProjectIdEqualTo(testPlan.getProjectId()).andModuleIdEqualTo(testPlan.getModuleId()); - if (testPlanMapper.countByExample(example) > 0) { - throw new MSException(Translator.get("test_plan.name.exist") + ":" + testPlan.getName()); - } - } else { - //更新 校验 - example.createCriteria().andNameEqualTo(testPlan.getName()).andProjectIdEqualTo(testPlan.getProjectId()).andIdNotEqualTo(testPlan.getId()).andModuleIdEqualTo(testPlan.getModuleId()); - if (testPlanMapper.countByExample(example) > 0) { - throw new MSException(Translator.get("test_plan.name.exist") + ":" + testPlan.getName()); - } - } }