fix(测试跟踪): 修复测试计划左侧模块树展开异常的问题

This commit is contained in:
shiziyuan9527 2020-11-09 10:53:13 +08:00
parent 1e5e19417e
commit e6231fc07e
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);