From d5470a8f152f13b9c419a3bf13d7b9fb198706d3 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Mon, 25 Nov 2024 16:16:10 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=B7=A5=E4=BD=9C=E5=8F=B0):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E8=AE=A1=E5=88=92=E9=81=97=E7=95=99=E5=8D=A1=E7=89=87?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/service/DashboardService.java | 12 ++++++------ .../workbench/homePage/components/defectCount.vue | 4 +++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/backend/services/dashboard/src/main/java/io/metersphere/dashboard/service/DashboardService.java b/backend/services/dashboard/src/main/java/io/metersphere/dashboard/service/DashboardService.java index af7361cd17..e79000abaf 100644 --- a/backend/services/dashboard/src/main/java/io/metersphere/dashboard/service/DashboardService.java +++ b/backend/services/dashboard/src/main/java/io/metersphere/dashboard/service/DashboardService.java @@ -1323,7 +1323,7 @@ public class DashboardService { List nameCountDTOS = buildBugRetentionRateList(totalSize, statusSize); Map> statusStatisticsMap = new HashMap<>(); statusStatisticsMap.put("retentionRate", nameCountDTOS); - List headerStatusOption = getHeaderStatusOption(projectId, platformName); + List headerStatusOption = getHeaderStatusOption(projectId, platformName, new ArrayList<>()); Map> bugMap = allSimpleList.stream().collect(Collectors.groupingBy(Bug::getStatus)); List bugPercentList = bulidBugPercentList(headerStatusOption, bugMap, totalSize); statisticsDTO.setStatusStatisticsMap(statusStatisticsMap); @@ -1361,10 +1361,10 @@ public class DashboardService { retentionRate.setCount(getTurnCount(divide)); } retentionRates.add(retentionRate); - NameCountDTO total = getNameCountDTO(totalSize, Translator.get("bug_management.totalCount")); - retentionRates.add(total); NameCountDTO retentionDTO = getNameCountDTO(statusSize, Translator.get("bug_management.retentionCount")); retentionRates.add(retentionDTO); + NameCountDTO total = getNameCountDTO(totalSize, Translator.get("bug_management.totalCount")); + retentionRates.add(total); return retentionRates; } @@ -1412,7 +1412,7 @@ public class DashboardService { List planBugList = extTestPlanMapper.getPlanBugList(projectId, TestPlanConstants.TEST_PLAN_TYPE_PLAN, new ArrayList<>(platforms), null); List localLastStepStatus = getBugEndStatus(projectId, platformName); List legacyBugList = planBugList.stream().filter(t -> !localLastStepStatus.contains(t.getText())).toList(); - List headerStatusOption = getHeaderStatusOption(projectId, platformName); + List headerStatusOption = getHeaderStatusOption(projectId, platformName, localLastStepStatus); int statusSize = CollectionUtils.isEmpty(legacyBugList) ? 0 : legacyBugList.size(); int totalSize = CollectionUtils.isEmpty(planBugList) ? 0 : planBugList.size(); List nameCountDTOS = buildBugRetentionRateList(totalSize, statusSize); @@ -1441,7 +1441,7 @@ public class DashboardService { } @NotNull - private List getHeaderStatusOption(String projectId, String platformName) { + private List getHeaderStatusOption(String projectId, String platformName, List endStatus) { List allLocalStatusOptions = bugStatusService.getAllLocalStatusOptions(projectId); List headerStatusOption = new ArrayList<>(allLocalStatusOptions); if (!StringUtils.equals(platformName, BugPlatform.LOCAL.getName())) { @@ -1450,7 +1450,7 @@ public class DashboardService { headerStatusOption.addAll(thirdStatusOptions); } } - headerStatusOption = headerStatusOption.stream().distinct().toList(); + headerStatusOption = headerStatusOption.stream().filter(t->!endStatus.contains(t.getValue())).distinct().toList(); return headerStatusOption; } diff --git a/frontend/src/views/workbench/homePage/components/defectCount.vue b/frontend/src/views/workbench/homePage/components/defectCount.vue index 11aea89a55..b22390af8d 100644 --- a/frontend/src/views/workbench/homePage/components/defectCount.vue +++ b/frontend/src/views/workbench/homePage/components/defectCount.vue @@ -135,7 +135,9 @@ hasPermission.value = errorCode !== 109001; countOptions.value = handlePieData(props.item.key, hasPermission.value, statusPercentList); - + if (props.item.key === WorkCardEnum.PLAN_LEGACY_BUG) { + countOptions.value.title.text = t('workbench.homePage.legacyDefectsNumber'); + } const [rate, totalBug, legacy] = statusStatisticsMap?.retentionRate || []; const unLegacy = totalBug && legacy ? totalBug.count - legacy.count : 0;