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

View File

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