Merge branch 'master' of github.com:metersphere/metersphere into master

This commit is contained in:
Captain.B 2020-11-09 16:49:41 +08:00
commit 3e57e9359d
1 changed files with 5 additions and 3 deletions

View File

@ -191,17 +191,19 @@ public class TestCaseNodeService {
* 获取当前计划下 * 获取当前计划下
* 有关联数据的节点 * 有关联数据的节点
* *
* @param planId * @param planId plan id
* @return * @return List<TestCaseNodeDTO>
*/ */
public List<TestCaseNodeDTO> getNodeByPlanId(String planId) { public List<TestCaseNodeDTO> getNodeByPlanId(String planId) {
List<TestCaseNodeDTO> list = new ArrayList<>(); List<TestCaseNodeDTO> list = new ArrayList<>();
List<String> projectIds = testPlanProjectService.getProjectIdsByPlanId(planId); List<String> projectIds = testPlanProjectService.getProjectIdsByPlanId(planId);
projectIds.forEach(id -> { projectIds.forEach(id -> {
String name = projectMapper.selectByPrimaryKey(id).getName(); Project project = projectMapper.selectByPrimaryKey(id);
String name = project.getName();
List<TestCaseNodeDTO> nodeList = getNodeDTO(id, planId); List<TestCaseNodeDTO> nodeList = getNodeDTO(id, planId);
TestCaseNodeDTO testCaseNodeDTO = new TestCaseNodeDTO(); TestCaseNodeDTO testCaseNodeDTO = new TestCaseNodeDTO();
testCaseNodeDTO.setId(project.getId());
testCaseNodeDTO.setName(name); testCaseNodeDTO.setName(name);
testCaseNodeDTO.setLabel(name); testCaseNodeDTO.setLabel(name);
testCaseNodeDTO.setChildren(nodeList); testCaseNodeDTO.setChildren(nodeList);