fix(测试跟踪): 优化测试计划报告计算方法

优化测试计划报告计算方法
This commit is contained in:
song-tianyang 2022-12-22 12:23:04 +08:00 committed by 建国
parent 1083dd32f5
commit 19205a7879
1 changed files with 8 additions and 5 deletions

View File

@ -491,13 +491,11 @@ public class TestPlanReportService {
return testPlanReport;
}
boolean isSendMessage = false;
if (testPlanReport != null) {
testPlanReport.setIsApiCaseExecuting(false);
testPlanReport.setIsScenarioExecuting(false);
testPlanReport.setIsPerformanceExecuting(false);
testPlanReport.setIsUiScenarioExecuting(false);
if (StringUtils.equalsIgnoreCase(testPlanReport.getStatus(), ExecuteResult.TEST_PLAN_RUNNING.toString())) {
isSendMessage = true;
}
@ -531,7 +529,7 @@ public class TestPlanReportService {
testPlanReport.setUpdateTime(endTime);
TestPlanReportContentExample contentExample = new TestPlanReportContentExample();
contentExample.createCriteria().andTestPlanReportIdEqualTo(testPlanReport.getTestPlanId());
contentExample.createCriteria().andTestPlanReportIdEqualTo(testPlanReport.getId());
List<TestPlanReportContentWithBLOBs> contents = testPlanReportContentMapper.selectByExampleWithBLOBs(contentExample);
if (CollectionUtils.isNotEmpty(contents)) {
content = contents.get(0);
@ -599,8 +597,13 @@ public class TestPlanReportService {
private void initTestPlanReportBaseCount(TestPlanReport testPlanReport, TestPlanReportContentWithBLOBs reportContent) {
if (testPlanReport != null && reportContent != null) {
TestPlanReportBuildResultDTO reportBuildResultDTO = testPlanService.buildPlanReport(testPlanReport, reportContent);
reportContent.setApiBaseCount(JSON.toJSONString(reportBuildResultDTO.getTestPlanSimpleReportDTO()));
try {
TestPlanReportBuildResultDTO reportBuildResultDTO = testPlanService.buildPlanReport(testPlanReport, reportContent);
reportContent.setApiBaseCount(JSON.toJSONString(reportBuildResultDTO.getTestPlanSimpleReportDTO()));
} catch (Exception e) {
LogUtil.error("计算测试计划报告信息出错!", e);
}
}
}