fix: 测试计划报告报错

This commit is contained in:
chenjianxing 2021-07-23 18:47:00 +08:00 committed by jianxing
parent 41b6cfc178
commit 9b42195c8b
4 changed files with 9 additions and 4 deletions

View File

@ -12,6 +12,7 @@ import io.metersphere.track.dto.*;
import io.metersphere.track.service.IssuesService;
import io.metersphere.track.service.TestCaseNodeService;
import io.metersphere.track.service.TestPlanProjectService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import java.util.*;
@ -32,7 +33,11 @@ public class ReportResultComponent extends ReportComponent {
TestCaseNodeService testCaseNodeService = (TestCaseNodeService) CommonBeanFactory.getBean("testCaseNodeService");
ExtTestCaseNodeMapper extTestCaseNodeMapper = (ExtTestCaseNodeMapper) CommonBeanFactory.getBean("extTestCaseNodeMapper");
TestPlanProjectService testPlanProjectService = (TestPlanProjectService) CommonBeanFactory.getBean("testPlanProjectService");
List<TestCaseNodeDTO> nodes = extTestCaseNodeMapper.getNodeTreeByProjectIds(testPlanProjectService.getProjectIdsByPlanId(testPlan.getId()));
List<String> projectIds = testPlanProjectService.getProjectIdsByPlanId(testPlan.getId());
if (CollectionUtils.isEmpty(projectIds)) {
projectIds.add(testPlan.getProjectId());
}
List<TestCaseNodeDTO> nodes = extTestCaseNodeMapper.getNodeTreeByProjectIds(projectIds);
nodeTrees = testCaseNodeService.getNodeTrees(nodes);
nodeTrees.forEach(item -> {
Set<String> childIds = new HashSet<>();

View File

@ -313,7 +313,7 @@ export default {
field_type: 'Field Type',
field_option: 'Options',
field_text: 'Field Text',
field_value: 'Field Value',
field_value: 'Field ID',
add_field: 'Add Field',
api_field_name: 'API Field Name',
template_setting: 'Template Setting',

View File

@ -314,7 +314,7 @@ export default {
field_type: '字段类型',
field_option: '选项值',
field_text: '选项内容',
field_value: '选项',
field_value: '选项ID',
add_field: '添加字段',
api_field_name: 'API字段名',
template_setting: '模板设置',

View File

@ -314,7 +314,7 @@ export default {
field_type: '字段類型',
field_option: '選項值',
field_text: '選項內容',
field_value: '選項',
field_value: '選項ID',
add_field: '添加字段',
api_field_name: 'API字段名',
template_setting: '模板設置',