diff --git a/backend/framework/sdk/src/main/resources/i18n/plan.properties b/backend/framework/sdk/src/main/resources/i18n/plan.properties index 2d3495003f..d8c7714384 100644 --- a/backend/framework/sdk/src/main/resources/i18n/plan.properties +++ b/backend/framework/sdk/src/main/resources/i18n/plan.properties @@ -105,6 +105,7 @@ test_plan.error=测试计划不合法 test_plan_group.batch.log={0}测试计划组 test_plan.batch.log={0}测试计划 test_plan_report_not_exist=测试计划报告不存在 +test_plan_report_detail_not_exist=异常报告, 报告汇总失败! test_plan_report_id.not_blank=测试计划报告id不能为空 test_plan_report_name.not_blank=测试计划报告名称不能为空 test_plan_not_exist=测试计划不存在 diff --git a/backend/framework/sdk/src/main/resources/i18n/plan_en_US.properties b/backend/framework/sdk/src/main/resources/i18n/plan_en_US.properties index d80f68b0fc..8b37daf1d3 100644 --- a/backend/framework/sdk/src/main/resources/i18n/plan_en_US.properties +++ b/backend/framework/sdk/src/main/resources/i18n/plan_en_US.properties @@ -107,6 +107,7 @@ test_plan.error=Test plan error test_plan_group.batch.log={0} test plan group test_plan.batch.log={0} plan test_plan_report_not_exist=The test plan report does not exist +test_plan_report_detail_not_exist=Exception report. Report summary failed! test_plan_report_id.not_blank=The test plan report id cannot be empty test_plan_report_name.not_blank=The test plan report name cannot be empty run_functional_case=Run functional case diff --git a/backend/framework/sdk/src/main/resources/i18n/plan_zh_CN.properties b/backend/framework/sdk/src/main/resources/i18n/plan_zh_CN.properties index cfc6f2960d..b6d3e69425 100644 --- a/backend/framework/sdk/src/main/resources/i18n/plan_zh_CN.properties +++ b/backend/framework/sdk/src/main/resources/i18n/plan_zh_CN.properties @@ -107,6 +107,7 @@ test_plan.error=测试计划不合法 test_plan_group.batch.log={0}测试计划组 test_plan.batch.log={0}测试计划 test_plan_report_not_exist=测试计划报告不存在 +test_plan_report_detail_not_exist=异常报告, 报告汇总失败! test_plan_report_id.not_blank=测试计划报告id不能为空 test_plan_report_name.not_blank=测试计划报告名称不能为空 run_functional_case=执行功能用例 diff --git a/backend/framework/sdk/src/main/resources/i18n/plan_zh_TW.properties b/backend/framework/sdk/src/main/resources/i18n/plan_zh_TW.properties index de5df6b7ff..c7d836451c 100644 --- a/backend/framework/sdk/src/main/resources/i18n/plan_zh_TW.properties +++ b/backend/framework/sdk/src/main/resources/i18n/plan_zh_TW.properties @@ -106,6 +106,7 @@ test_plan.error=測試計劃不合法 test_plan_group.batch.log={0}測試計劃組 test_plan.batch.log={0}測試計劃 test_plan_report_not_exist=測試計劃報告不存在 +test_plan_report_detail_not_exist=異常報告, 報告彙總失敗! test_plan_report_id.not_blank=測試計劃報告id不能爲空 test_plan_report_name.not_blank=測試計劃報告名稱不能爲空 run_functional_case=執行功能用例 diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportService.java index d8bdb1e30f..9d13a8843d 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanReportService.java @@ -514,7 +514,11 @@ public class TestPlanReportService { TestPlanReport planReport = checkReport(reportId); TestPlanReportSummaryExample example = new TestPlanReportSummaryExample(); example.createCriteria().andTestPlanReportIdEqualTo(reportId); - TestPlanReportSummary reportSummary = testPlanReportSummaryMapper.selectByExampleWithBLOBs(example).get(0); + List testPlanReportSummaries = testPlanReportSummaryMapper.selectByExampleWithBLOBs(example); + if (CollectionUtils.isEmpty(testPlanReportSummaries)) { + throw new MSException(Translator.get("test_plan_report_detail_not_exist")); + } + TestPlanReportSummary reportSummary = testPlanReportSummaries.get(0); TestPlanReportDetailResponse planReportDetail = new TestPlanReportDetailResponse(); BeanUtils.copyBean(planReportDetail, planReport); int caseTotal = (int) (reportSummary.getFunctionalCaseCount() + reportSummary.getApiCaseCount() + reportSummary.getApiScenarioCount());