From 0edc4d136f1b76d93a80633d285175c6b4af1ee1 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Tue, 16 Mar 2021 12:55:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=84=91=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/service/ApiModuleService.java | 4 +- .../api/service/ApiScenarioModuleService.java | 4 +- .../mapper/ext/ExtTestPlanTestCaseMapper.java | 2 + .../mapper/ext/ExtTestPlanTestCaseMapper.xml | 19 ++- .../TestPlanTestCaseController.java | 7 + .../track/service/TestCaseNodeService.java | 4 +- .../service/TestPlanTestCaseService.java | 4 + .../track/common/minder/TestPlanMinder.vue | 128 ++++++++++++++++++ .../functional/FunctionalTestCaseList.vue | 11 +- .../functional/TestPlanFunctional.vue | 27 +++- 10 files changed, 201 insertions(+), 9 deletions(-) create mode 100644 frontend/src/business/components/track/common/minder/TestPlanMinder.vue diff --git a/backend/src/main/java/io/metersphere/api/service/ApiModuleService.java b/backend/src/main/java/io/metersphere/api/service/ApiModuleService.java index d207ca7912..a0eddeeca5 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiModuleService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiModuleService.java @@ -112,7 +112,9 @@ public class ApiModuleService extends NodeTreeService { apiModuleDTO.setName(name); apiModuleDTO.setLabel(name); apiModuleDTO.setChildren(nodeList); - list.add(apiModuleDTO); + if (!org.springframework.util.CollectionUtils.isEmpty(nodeList)) { + list.add(apiModuleDTO); + } }); return list; } diff --git a/backend/src/main/java/io/metersphere/api/service/ApiScenarioModuleService.java b/backend/src/main/java/io/metersphere/api/service/ApiScenarioModuleService.java index ab6ebab28a..23493f60c5 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiScenarioModuleService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiScenarioModuleService.java @@ -100,7 +100,9 @@ public class ApiScenarioModuleService extends NodeTreeService getExecResultByPlanId(String planId); + + List listForMinder(@Param("planId") String planId); } diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml index 1e132017fd..80c68f3fbc 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml @@ -405,6 +405,23 @@ + + update test_plan_test_case @@ -423,4 +440,4 @@ from test_plan_api_case where api_case_id = #{id,jdbcType=VARCHAR} - \ No newline at end of file + 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 0d2d38cbad..f3362abbd0 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestPlanTestCaseController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestPlanTestCaseController.java @@ -39,6 +39,13 @@ 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); + } + @GetMapping("/list/node/{planId}/{nodePaths}") public List getTestPlanCasesByNodePath(@PathVariable String planId, @PathVariable String nodePaths) { String nodePath = nodePaths.replace("f", "/"); diff --git a/backend/src/main/java/io/metersphere/track/service/TestCaseNodeService.java b/backend/src/main/java/io/metersphere/track/service/TestCaseNodeService.java index ee74a265d0..2e6658799e 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseNodeService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseNodeService.java @@ -189,7 +189,9 @@ public class TestCaseNodeService extends NodeTreeService { testCaseNodeDTO.setName(name); testCaseNodeDTO.setLabel(name); testCaseNodeDTO.setChildren(nodeList); - list.add(testCaseNodeDTO); + if (!CollectionUtils.isEmpty(nodeList)) { + list.add(testCaseNodeDTO); + } } }); 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 8de4cdbcab..7617f37d07 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanTestCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanTestCaseService.java @@ -150,4 +150,8 @@ public class TestPlanTestCaseService { public int updateTestCaseStates(List ids, String reportStatus) { return extTestPlanTestCaseMapper.updateTestCaseStates(ids, reportStatus); } + + public List listForMinder(String planId) { + return extTestPlanTestCaseMapper.listForMinder(planId); + } } diff --git a/frontend/src/business/components/track/common/minder/TestPlanMinder.vue b/frontend/src/business/components/track/common/minder/TestPlanMinder.vue new file mode 100644 index 0000000000..f15a0c0ecd --- /dev/null +++ b/frontend/src/business/components/track/common/minder/TestPlanMinder.vue @@ -0,0 +1,128 @@ + + + + + diff --git a/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue b/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue index 31a32b357a..93ebabd7ae 100644 --- a/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue +++ b/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue @@ -1,7 +1,7 @@