From 4bc046cf80c695f0fd615b2087334a7fbf53a615 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Mon, 17 Jun 2024 19:11:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E8=A1=A5=E5=85=85=E5=BC=82=E5=B8=B8=E6=8A=A5=E5=91=8A=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E8=AF=A6=E6=83=85=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/sdk/src/main/resources/i18n/plan.properties | 1 + .../sdk/src/main/resources/i18n/plan_en_US.properties | 1 + .../sdk/src/main/resources/i18n/plan_zh_CN.properties | 1 + .../sdk/src/main/resources/i18n/plan_zh_TW.properties | 1 + .../io/metersphere/plan/service/TestPlanReportService.java | 6 +++++- 5 files changed, 9 insertions(+), 1 deletion(-) 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());