fix(测试跟踪): 修复查看测试计划报告时会改编测试计划表格中通过率的问题

修复查看测试计划报告时会改编测试计划表格中通过率的问题
This commit is contained in:
song-tianyang 2022-07-13 15:56:53 +08:00 committed by TIanyang
parent b3d622b23d
commit 4a5348976d
2 changed files with 15 additions and 10 deletions

View File

@ -472,7 +472,7 @@ public class TestPlanReportService {
TestPlanService testPlanService = CommonBeanFactory.getBean(TestPlanService.class);
TestPlanSimpleReportDTO reportDTO = testPlanService.buildPlanReport(testPlanReport, reportContent);
reportDTO.setStartTime(testPlanReport.getStartTime());
reportContent = parseReportDaoToReportContent(reportDTO, reportContent);
reportContent = parseReportDaoToReportContent(testPlanReport.getStatus(), reportDTO, reportContent);
return reportContent;
}
@ -598,7 +598,7 @@ public class TestPlanReportService {
TestPlanSimpleReportDTO reportDTO = testPlanService.buildPlanReport(testPlan.getId(), false);
if (!testPlanReportContentList.isEmpty()) {
testPlanReportContent = testPlanReportContentList.get(0);
testPlanReportContentMapper.updateByPrimaryKeySelective(parseReportDaoToReportContent(reportDTO, testPlanReportContent));
testPlanReportContentMapper.updateByPrimaryKeySelective(parseReportDaoToReportContent(testPlanReport.getStatus(), reportDTO, testPlanReportContent));
}
if (reportDTO.getStartTime() == null) {
@ -615,7 +615,7 @@ public class TestPlanReportService {
testPlanMessageService.checkTestPlanStatusAndSendMessage(testPlanReport, null, false);
}
public TestPlanReportContentWithBLOBs parseReportDaoToReportContent(TestPlanSimpleReportDTO reportDTO, TestPlanReportContentWithBLOBs testPlanReportContentWithBLOBs) {
public TestPlanReportContentWithBLOBs parseReportDaoToReportContent(String testPlanReportStatus, TestPlanSimpleReportDTO reportDTO, TestPlanReportContentWithBLOBs testPlanReportContentWithBLOBs) {
String id = testPlanReportContentWithBLOBs.getId();
String testPlanReportId = testPlanReportContentWithBLOBs.getTestPlanReportId();
if (testPlanReportContentWithBLOBs.getEndTime() != null) {
@ -673,13 +673,14 @@ public class TestPlanReportService {
testPlanReportContentWithBLOBs.setUnExecuteScenarios(JSONObject.toJSONString(reportDTO.getUnExecuteScenarios()));
}
// 更新测试计划报告通过率字段 passRate
TestPlanReportContentExample contentExample = new TestPlanReportContentExample();
contentExample.createCriteria().andTestPlanReportIdEqualTo(testPlanReportId);
TestPlanReportContentWithBLOBs content = new TestPlanReportContentWithBLOBs();
content.setPassRate(reportDTO.getPassRate());
testPlanReportContentMapper.updateByExampleSelective(content, contentExample);
// 如果报告已结束则更新测试计划报告通过率字段 passRate
if (!StringUtils.equalsIgnoreCase(testPlanReportStatus, "running")) {
TestPlanReportContentExample contentExample = new TestPlanReportContentExample();
contentExample.createCriteria().andTestPlanReportIdEqualTo(testPlanReportId);
TestPlanReportContentWithBLOBs content = new TestPlanReportContentWithBLOBs();
content.setPassRate(reportDTO.getPassRate());
testPlanReportContentMapper.updateByExampleSelective(content, contentExample);
}
return testPlanReportContentWithBLOBs;
}

View File

@ -93,6 +93,8 @@ export default {
},
methods: {
openCard(type) {
this.historyReportName = "";
this.historyReportId = "";
if (type === 'trackTestCase') {
this.testCaseTrendDrawer = true;
} else if (type === 'countTestCase') {
@ -100,6 +102,8 @@ export default {
}
},
close() {
this.historyReportName = "";
this.historyReportId = "";
this.testCaseTrendDrawer = false;
this.testCaseCountDrawer = false;
},