|
@@ -77,16 +77,18 @@ public class ReportController {
|
|
BugDTO masterReport = bugMap.get(masterId); // 得到主报告
|
|
BugDTO masterReport = bugMap.get(masterId); // 得到主报告
|
|
List<SupplementDTO> supplements = supplementService.getSupplementByMasterId(masterId, bugMap); // 补充点报告
|
|
List<SupplementDTO> supplements = supplementService.getSupplementByMasterId(masterId, bugMap); // 补充点报告
|
|
List<BugDTO> bugs = new LinkedList<>();
|
|
List<BugDTO> bugs = new LinkedList<>();
|
|
|
|
+ bugs.add(masterReport);
|
|
supplements.forEach(supplementDTO -> bugs.addAll(supplementDTO.getBugs()));
|
|
supplements.forEach(supplementDTO -> bugs.addAll(supplementDTO.getBugs()));
|
|
- List<BugDTO> sourceReports = bugs.stream().distinct().collect(Collectors.toList());
|
|
|
|
|
|
+ Collection<BugDTO> distinctBugs = bugs.stream().collect(Collectors.toMap(BugDTO::getId,Function.identity(),(v1,v2)->v1)).values();
|
|
|
|
+// List<BugDTO> sourceReports = distinctBugs.stream().distinct().collect(Collectors.toList());
|
|
// 各种类型的报告数量的统计,
|
|
// 各种类型的报告数量的统计,
|
|
- Map<String, Long> categoryCounts = sourceReports.stream().collect(Collectors.groupingBy(BugDTO::getBugCategory, Collectors.counting()));
|
|
|
|
- Map<String, Long> pageCounts = sourceReports.stream().filter(e->e.getBug_page()!=null).collect(Collectors.groupingBy(BugDTO::getBug_page,Collectors.counting()));
|
|
|
|
- Map<String, Long> recurrentCounts = sourceReports.stream()
|
|
|
|
|
|
+ Map<String, Long> categoryCounts = distinctBugs.stream().collect(Collectors.groupingBy(BugDTO::getBugCategory, Collectors.counting()));
|
|
|
|
+ Map<String, Long> pageCounts = distinctBugs.stream().filter(e->e.getBug_page()!=null).collect(Collectors.groupingBy(BugDTO::getBug_page,Collectors.counting()));
|
|
|
|
+ Map<String, Long> recurrentCounts = distinctBugs.stream()
|
|
.map(BugDTO::getRecurrent)
|
|
.map(BugDTO::getRecurrent)
|
|
.map((recurrentNum) -> ReportUtil.recurrent2String.get(recurrentNum))
|
|
.map((recurrentNum) -> ReportUtil.recurrent2String.get(recurrentNum))
|
|
.collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
|
|
.collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
|
|
- Map<String, Long> severityCounts = sourceReports.stream()
|
|
|
|
|
|
+ Map<String, Long> severityCounts = distinctBugs.stream()
|
|
.map(BugDTO::getSeverity)
|
|
.map(BugDTO::getSeverity)
|
|
.map((severityNum) -> ReportUtil.severity2String.get(severityNum))
|
|
.map((severityNum) -> ReportUtil.severity2String.get(severityNum))
|
|
.collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
|
|
.collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
|