feat(测试计划): 测试报告中列表增加所属项目列

This commit is contained in:
shiziyuan9527 2020-09-14 16:50:49 +08:00
parent 3b439edaeb
commit 54b72c017e
11 changed files with 45 additions and 3 deletions

View File

@ -26,5 +26,7 @@ public class Issues implements Serializable {
private String model;
private String projectName;
private static final long serialVersionUID = 1L;
}

View File

@ -1,5 +1,6 @@
package io.metersphere.track.domain;
import io.metersphere.base.domain.Project;
import io.metersphere.base.domain.TestCaseNode;
import io.metersphere.base.domain.TestCaseNodeExample;
import io.metersphere.base.mapper.TestCaseNodeMapper;
@ -52,6 +53,9 @@ public class ReportResultComponent extends ReportComponent {
nodeTrees.forEach(rootNode -> {
TestCaseReportModuleResultDTO moduleResult = moduleResultMap.get(rootNode.getId());
if (moduleResult != null) {
TestCaseNodeService testCaseNodeService = (TestCaseNodeService) CommonBeanFactory.getBean("testCaseNodeService");
Project project = testCaseNodeService.getProjectByNode(rootNode.getId());
moduleResult.setProjectName(project.getName());
moduleResult.setModuleName(rootNode.getName());
}
});

View File

@ -20,4 +20,5 @@ public class TestCaseReportModuleResultDTO {
private Integer failureCount;
private Integer blockingCount;
private Integer underwayCount;
private String projectName;
}

View File

@ -498,4 +498,12 @@ public class TestCaseNodeService {
}
}
public Project getProjectByNode(String nodeId) {
TestCaseNodeExample example = new TestCaseNodeExample();
example.createCriteria().andIdEqualTo(nodeId);
List<TestCaseNode> testCaseNodes = testCaseNodeMapper.selectByExample(example);
String projectId = testCaseNodes.get(0).getProjectId();
return projectMapper.selectByPrimaryKey(projectId);
}
}

View File

@ -273,6 +273,9 @@ public class TestPlanService {
queryTestPlanRequest.setId(planId);
TestPlanDTO testPlan = extTestPlanMapper.list(queryTestPlanRequest).get(0);
String projectName = getProjectNameByPlanId(planId);
testPlan.setProjectName(projectName);
TestCaseReport testCaseReport = testCaseReportMapper.selectByPrimaryKey(testPlan.getReportId());
JSONObject content = JSONObject.parseObject(testCaseReport.getContent());
JSONArray componentIds = content.getJSONArray("components");
@ -286,6 +289,7 @@ public class TestPlanService {
if (issue.size() > 0) {
for (Issues i : issue) {
i.setModel(testCase.getNodePath());
i.setProjectName(testCase.getProjectName());
String des = i.getDescription().replaceAll("<p>", "").replaceAll("</p>", "");
i.setDescription(des);
if (i.getLastmodify() == null || i.getLastmodify() == "") {

View File

@ -15,6 +15,11 @@
:label="$t('test_track.module.module')"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="projectName"
:label="$t('test_track.module.project_name')"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="title"
:label="$t('test_track.module.title')"

View File

@ -50,6 +50,12 @@
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="projectName"
:label="$t('test_track.case.project_name')"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="executorName"
:label="$t('test_track.plan_view.executor')">

View File

@ -13,6 +13,12 @@
:label="$t('test_track.module.module')"
>
</el-table-column>
<el-table-column
prop="projectName"
:label="$t('test_track.module.project_name')"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
prop="caseCount"
:label="$t('test_track.plan_view.case_count')"

View File

@ -630,6 +630,7 @@ export default {
batch_move_case: 'Batch move',
batch_delete_case: 'Batch delete',
batch_unlink: 'Batch Unlink',
project_name: "Project",
import: {
import: "Import test case",
case_import: "Import test case",
@ -684,7 +685,8 @@ export default {
describe: "Describe",
status: "Status",
current_owner: "Current Owner",
creation_time: "Creation time"
creation_time: "Creation time",
project_name: "Project"
},
home: {
recent_test: "Recent test",

View File

@ -633,6 +633,7 @@ export default {
batch_move_case: '批量移动用例',
batch_delete_case: '批量删除用例',
batch_unlink: '批量取消关联',
project_name: '所属项目',
import: {
import: "导入用例",
case_import: "导入测试用例",
@ -687,7 +688,8 @@ export default {
status: "状态",
describe: "描述",
current_owner: "处理人",
creation_time: "创建时间"
creation_time: "创建时间",
project_name: "所属项目"
},
home: {
recent_test: "最近测试",

View File

@ -629,6 +629,7 @@ export default {
batch_move_case: '批量移動用例',
batch_delete_case: '批量刪除用例',
batch_unlink: '批量取消關聯',
project_name: '所屬項目',
import: {
import: "導入用例",
case_import: "導入測試用例",
@ -683,7 +684,8 @@ export default {
status: "狀態",
describe: "描述",
current_owner: "處理人",
creation_time: "創建時間"
creation_time: "創建時間",
project_name: "所屬項目"
},
home: {
recent_test: "最近測試",