diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml index 241b52ba1b..da8f332003 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml @@ -452,6 +452,9 @@ from test_case + + and test_case.node_id = #{request.nodeId} + diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReviewCaseMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReviewCaseMapper.java index edbc96ddd8..284e11820f 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReviewCaseMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReviewCaseMapper.java @@ -34,4 +34,6 @@ public interface ExtTestReviewCaseMapper { List selectIds(@Param("request") QueryCaseReviewRequest request); List selectTestCaseIds(@Param("request") QueryCaseReviewRequest request); + + List listForMinder(@Param("request") QueryCaseReviewRequest request); } diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReviewCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReviewCaseMapper.xml index 0c76da8a88..3366ec1cbe 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReviewCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReviewCaseMapper.xml @@ -109,6 +109,10 @@ inner join test_case on test_case_review_test_case.case_id = test_case.id left join test_case_node on test_case_node.id=test_case.node_id inner join project on project.id = test_case.project_id + + + + @@ -118,9 +122,9 @@ and (test_case.name like CONCAT('%', #{request.name},'%') - or test_case.num like CONCAT('%', #{request.name},'%') - or test_case.custom_num like CONCAT('%', #{request.name},'%') - ) + or test_case.num like CONCAT('%', #{request.name},'%') + or test_case.custom_num like CONCAT('%', #{request.name},'%') + ) and test_case.id = #{request.id} @@ -143,59 +147,43 @@ and test_case.method = #{request.method} - - - - - - and test_case.priority in - - #{value} - - - - and test_case.type in - - #{value} - - - - and test_case.method in - - #{value} - - - - and test_case.review_status in - - #{value} - - - - - - + - - order by - - - - - - - test_case.num ${order.type}, test_case.custom_num ${order.type} - - - test_case.priority ${order.type} - - - test_case_review_test_case.${order.name} ${order.type} - - + + + + + + + + and test_case.priority in + + #{value} + + + + and test_case.type in + + #{value} + + + + and test_case.method in + + #{value} + + + + and test_case.review_status in + + #{value} + + + + - + + diff --git a/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java b/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java index 7d858ba60e..81a44f78f6 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java @@ -62,6 +62,13 @@ public class TestCaseController { return testCaseService.listTestCase(request); } + @PostMapping("/list") + @RequiresPermissions("PROJECT_TRACK_CASE:READ") + public List list(@RequestBody QueryTestCaseRequest request) { + checkPermissionService.checkProjectOwner(request.getProjectId()); + return testCaseService.listTestCase(request); + } + @PostMapping("/list/minder") public List listDetail(@RequestBody QueryTestCaseRequest request) { checkPermissionService.checkProjectOwner(request.getProjectId()); @@ -91,11 +98,6 @@ public class TestCaseController { return testCaseService.recentTestPlans(request, count); } - @PostMapping("/list") - public List getTestCaseByNodeId(@RequestBody List nodeIds) { - return testCaseService.getTestCaseByNodeId(nodeIds); - } - @PostMapping("/relate/{goPage}/{pageSize}") public Pager> getTestCaseRelateList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryTestCaseRequest request) { Page page = PageHelper.startPage(goPage, pageSize, true); diff --git a/backend/src/main/java/io/metersphere/track/controller/TestPlanTestCaseController.java b/backend/src/main/java/io/metersphere/track/controller/TestPlanTestCaseController.java index 5093527f85..2bf718593f 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestPlanTestCaseController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestPlanTestCaseController.java @@ -4,7 +4,6 @@ import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import io.metersphere.base.domain.TestPlanTestCaseWithBLOBs; import io.metersphere.commons.constants.OperLogConstants; -import io.metersphere.commons.constants.RoleConstants; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; import io.metersphere.log.annotation.MsAuditLog; @@ -13,8 +12,6 @@ import io.metersphere.track.request.testcase.TestPlanCaseBatchRequest; import io.metersphere.track.request.testplancase.QueryTestPlanCaseRequest; import io.metersphere.track.request.testplancase.TestPlanFuncCaseBatchRequest; import io.metersphere.track.service.TestPlanTestCaseService; -import org.apache.shiro.authz.annotation.Logical; -import org.apache.shiro.authz.annotation.RequiresRoles; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -43,11 +40,9 @@ public class TestPlanTestCaseController { return testPlanTestCaseService.listByPlanId(request); } - @GetMapping("/list/minder/{planId}") - public List listForMinder(@PathVariable String planId) { - QueryTestPlanCaseRequest request = new QueryTestPlanCaseRequest(); - request.setPlanId(planId); - return testPlanTestCaseService.listForMinder(planId); + @PostMapping("/list/minder") + public List listForMinder(@RequestBody QueryTestPlanCaseRequest request) { + return testPlanTestCaseService.listForMinder(request); } @GetMapping("/list/node/{planId}/{nodePaths}") diff --git a/backend/src/main/java/io/metersphere/track/controller/TestReviewTestCaseController.java b/backend/src/main/java/io/metersphere/track/controller/TestReviewTestCaseController.java index 1fbc407053..71e070bc1a 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestReviewTestCaseController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestReviewTestCaseController.java @@ -4,7 +4,6 @@ import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import io.metersphere.base.domain.TestCaseReviewTestCase; import io.metersphere.commons.constants.OperLogConstants; -import io.metersphere.commons.constants.RoleConstants; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; import io.metersphere.log.annotation.MsAuditLog; @@ -13,8 +12,6 @@ import io.metersphere.track.request.testplancase.TestReviewCaseBatchRequest; import io.metersphere.track.request.testreview.DeleteRelevanceRequest; import io.metersphere.track.request.testreview.QueryCaseReviewRequest; import io.metersphere.track.service.TestReviewTestCaseService; -import org.apache.shiro.authz.annotation.Logical; -import org.apache.shiro.authz.annotation.RequiresRoles; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -57,9 +54,9 @@ public class TestReviewTestCaseController { testReviewTestCaseService.editTestCaseForMinder(testCases); } - @PostMapping("/list/all") - public List getTestReviewCases(@RequestBody QueryCaseReviewRequest request) { - return testReviewTestCaseService.list(request); + @PostMapping("/list/minder") + public List listForMinder(@RequestBody QueryCaseReviewRequest request) { + return testReviewTestCaseService.listForMinder(request); } @PostMapping("/edit") diff --git a/backend/src/main/java/io/metersphere/track/request/testcase/QueryTestCaseRequest.java b/backend/src/main/java/io/metersphere/track/request/testcase/QueryTestCaseRequest.java index 33e791b26d..a9a9c53f00 100644 --- a/backend/src/main/java/io/metersphere/track/request/testcase/QueryTestCaseRequest.java +++ b/backend/src/main/java/io/metersphere/track/request/testcase/QueryTestCaseRequest.java @@ -27,6 +27,8 @@ public class QueryTestCaseRequest extends BaseQueryRequest { private String caseCoverage; + private String nodeId; + private long createTime = 0; private long relevanceCreateTime = 0; private List testCaseContainIds; diff --git a/backend/src/main/java/io/metersphere/track/request/testplancase/QueryTestPlanCaseRequest.java b/backend/src/main/java/io/metersphere/track/request/testplancase/QueryTestPlanCaseRequest.java index 212f54f73a..817d9e7cca 100644 --- a/backend/src/main/java/io/metersphere/track/request/testplancase/QueryTestPlanCaseRequest.java +++ b/backend/src/main/java/io/metersphere/track/request/testplancase/QueryTestPlanCaseRequest.java @@ -34,5 +34,7 @@ public class QueryTestPlanCaseRequest extends TestPlanTestCase { private String method; + private String nodeId; + private Map combine; } diff --git a/backend/src/main/java/io/metersphere/track/request/testreview/QueryCaseReviewRequest.java b/backend/src/main/java/io/metersphere/track/request/testreview/QueryCaseReviewRequest.java index 15d72e3284..ae06c3dfcd 100644 --- a/backend/src/main/java/io/metersphere/track/request/testreview/QueryCaseReviewRequest.java +++ b/backend/src/main/java/io/metersphere/track/request/testreview/QueryCaseReviewRequest.java @@ -1,6 +1,5 @@ package io.metersphere.track.request.testreview; -import io.metersphere.base.domain.TestCaseReview; import io.metersphere.base.domain.TestCaseReviewTestCase; import io.metersphere.controller.request.OrderRequest; import lombok.Getter; @@ -32,6 +31,8 @@ public class QueryCaseReviewRequest extends TestCaseReviewTestCase { private String node; + private String nodeId; + private String method; private Map combine; diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanTestCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanTestCaseService.java index 13c3cac738..7297faea00 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanTestCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanTestCaseService.java @@ -48,8 +48,6 @@ public class TestPlanTestCaseService { @Resource ExtTestPlanTestCaseMapper extTestPlanTestCaseMapper; @Resource - private TestCaseTestMapper testCaseTestMapper; - @Resource private LoadTestMapper loadTestMapper; @Resource private ApiTestCaseMapper apiTestCaseMapper; @@ -209,8 +207,8 @@ public class TestPlanTestCaseService { return extTestPlanTestCaseMapper.updateTestCaseStates(ids, reportStatus); } - public List listForMinder(String planId) { - return extTestPlanTestCaseMapper.listForMinder(planId); + public List listForMinder(QueryTestPlanCaseRequest request) { + return extTestPlanTestCaseMapper.listForMinder(request); } public void editTestCaseForMinder(List testPlanTestCases) { diff --git a/backend/src/main/java/io/metersphere/track/service/TestReviewTestCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestReviewTestCaseService.java index ebde8929eb..d477d420f4 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestReviewTestCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestReviewTestCaseService.java @@ -340,4 +340,8 @@ public class TestReviewTestCaseService { } return null; } + + public List listForMinder(QueryCaseReviewRequest request) { + return extTestReviewCaseMapper.listForMinder(request); + } } diff --git a/frontend/src/business/components/common/components/MsModuleMinder.vue b/frontend/src/business/components/common/components/MsModuleMinder.vue index 70190beb1a..ff001b560e 100644 --- a/frontend/src/business/components/common/components/MsModuleMinder.vue +++ b/frontend/src/business/components/common/components/MsModuleMinder.vue @@ -23,7 +23,6 @@