fix(工作台): 修复计划遗留缺陷卡片显示问题

This commit is contained in:
guoyuqi 2024-11-26 10:25:12 +08:00 committed by 刘瑞斌
parent d1e4c688e3
commit d1f635f6b7
1 changed files with 15 additions and 7 deletions

View File

@ -1320,7 +1320,7 @@ public class DashboardService {
List<Bug> statusList = allSimpleList.stream().filter(t -> !localLastStepStatus.contains(t.getStatus())).toList(); List<Bug> statusList = allSimpleList.stream().filter(t -> !localLastStepStatus.contains(t.getStatus())).toList();
int statusSize = CollectionUtils.isEmpty(statusList) ? 0 : statusList.size(); int statusSize = CollectionUtils.isEmpty(statusList) ? 0 : statusList.size();
int totalSize = CollectionUtils.isEmpty(allSimpleList) ? 0 : allSimpleList.size(); int totalSize = CollectionUtils.isEmpty(allSimpleList) ? 0 : allSimpleList.size();
List<NameCountDTO> nameCountDTOS = buildBugRetentionRateList(totalSize, statusSize); List<NameCountDTO> nameCountDTOS = buildBugRetentionRateList(totalSize, statusSize, false);
Map<String, List<NameCountDTO>> statusStatisticsMap = new HashMap<>(); Map<String, List<NameCountDTO>> statusStatisticsMap = new HashMap<>();
statusStatisticsMap.put("retentionRate", nameCountDTOS); statusStatisticsMap.put("retentionRate", nameCountDTOS);
List<SelectOption> headerStatusOption = getHeaderStatusOption(projectId, platformName, new ArrayList<>()); List<SelectOption> headerStatusOption = getHeaderStatusOption(projectId, platformName, new ArrayList<>());
@ -1350,7 +1350,7 @@ public class DashboardService {
} }
private static List<NameCountDTO> buildBugRetentionRateList(int totalSize, int statusSize) { private static List<NameCountDTO> buildBugRetentionRateList(int totalSize, int statusSize, boolean isPlan) {
List<NameCountDTO> retentionRates = new ArrayList<>(); List<NameCountDTO> retentionRates = new ArrayList<>();
NameCountDTO retentionRate = new NameCountDTO(); NameCountDTO retentionRate = new NameCountDTO();
retentionRate.setName(Translator.get("bug_management.retentionRate")); retentionRate.setName(Translator.get("bug_management.retentionRate"));
@ -1361,10 +1361,18 @@ public class DashboardService {
retentionRate.setCount(getTurnCount(divide)); retentionRate.setCount(getTurnCount(divide));
} }
retentionRates.add(retentionRate); retentionRates.add(retentionRate);
if (isPlan) {
NameCountDTO retentionDTO = getNameCountDTO(statusSize, Translator.get("bug_management.retentionCount")); NameCountDTO retentionDTO = getNameCountDTO(statusSize, Translator.get("bug_management.retentionCount"));
retentionRates.add(retentionDTO); retentionRates.add(retentionDTO);
NameCountDTO total = getNameCountDTO(totalSize, Translator.get("bug_management.totalCount")); NameCountDTO total = getNameCountDTO(totalSize, Translator.get("bug_management.totalCount"));
retentionRates.add(total); retentionRates.add(total);
} else {
NameCountDTO total = getNameCountDTO(totalSize, Translator.get("bug_management.totalCount"));
retentionRates.add(total);
NameCountDTO retentionDTO = getNameCountDTO(statusSize, Translator.get("bug_management.retentionCount"));
retentionRates.add(retentionDTO);
}
return retentionRates; return retentionRates;
} }
@ -1415,7 +1423,7 @@ public class DashboardService {
List<SelectOption> headerStatusOption = getHeaderStatusOption(projectId, platformName, localLastStepStatus); List<SelectOption> headerStatusOption = getHeaderStatusOption(projectId, platformName, localLastStepStatus);
int statusSize = CollectionUtils.isEmpty(legacyBugList) ? 0 : legacyBugList.size(); int statusSize = CollectionUtils.isEmpty(legacyBugList) ? 0 : legacyBugList.size();
int totalSize = CollectionUtils.isEmpty(planBugList) ? 0 : planBugList.size(); int totalSize = CollectionUtils.isEmpty(planBugList) ? 0 : planBugList.size();
List<NameCountDTO> nameCountDTOS = buildBugRetentionRateList(totalSize, statusSize); List<NameCountDTO> nameCountDTOS = buildBugRetentionRateList(totalSize, statusSize, true);
Map<String, List<NameCountDTO>> statusStatisticsMap = new HashMap<>(); Map<String, List<NameCountDTO>> statusStatisticsMap = new HashMap<>();
statusStatisticsMap.put("retentionRate", nameCountDTOS); statusStatisticsMap.put("retentionRate", nameCountDTOS);
Map<String, List<SelectOption>> bugMap = legacyBugList.stream().collect(Collectors.groupingBy(SelectOption::getText)); Map<String, List<SelectOption>> bugMap = legacyBugList.stream().collect(Collectors.groupingBy(SelectOption::getText));