diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.java index 26f36f86ae..a3584780d1 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.java @@ -149,4 +149,6 @@ public interface ExtTestCaseMapper { List getMaintainerMap(@Param("request") QueryTestCaseRequest request); List getForNodeEdit(@Param("ids") List ids); + + List> moduleExtraNodeCount(@Param("nodeIds") List nodeIds); } 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 83e336e1e5..0db2d38292 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 @@ -1007,4 +1007,13 @@ SET test_case.latest = TRUE WHERE ref_id = #{refId,jdbcType=VARCHAR} + + diff --git a/backend/src/main/java/io/metersphere/track/controller/TestCaseNodeController.java b/backend/src/main/java/io/metersphere/track/controller/TestCaseNodeController.java index 670087627b..cd3ad0effa 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestCaseNodeController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestCaseNodeController.java @@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.List; +import java.util.Map; @RequestMapping("/case/node") @RestController @@ -30,6 +31,11 @@ public class TestCaseNodeController { return testCaseNodeService.getNodeTreeByProjectId(projectId); } + @PostMapping("/minder/extraNode/count") + public Map getMinderTreeExtraNodeCount(@RequestBody List nodeIds) { + return testCaseNodeService.getMinderTreeExtraNodeCount(nodeIds); + } + @GetMapping("/trashCount/{projectId}") public long trashCount(@PathVariable String projectId) { checkPermissionService.checkProjectOwner(projectId); 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 63ef9cdd77..feebe870e1 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseNodeService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseNodeService.java @@ -740,4 +740,17 @@ public class TestCaseNodeService extends NodeTreeService { return extTestCaseMapper.countByWorkSpaceId(workSpaceId); } + + /** + * 统计某些节点下的临时节点的数量 + * @param nodeIds + * @return + */ + public Map getMinderTreeExtraNodeCount(List nodeIds) { + if (nodeIds.isEmpty()) { + return new HashMap<>(); + } + List> moduleCountList = extTestCaseMapper.moduleExtraNodeCount(nodeIds); + return this.parseModuleCountList(moduleCountList); + } } diff --git a/frontend/src/business/components/common/components/MsModuleMinder.vue b/frontend/src/business/components/common/components/MsModuleMinder.vue index 1e30762fd0..b6f1d0a2a3 100644 --- a/frontend/src/business/components/common/components/MsModuleMinder.vue +++ b/frontend/src/business/components/common/components/MsModuleMinder.vue @@ -1,6 +1,6 @@