|
@@ -53,11 +53,7 @@ public class ReportController {
|
|
|
return "index";
|
|
|
}
|
|
|
|
|
|
- @GetMapping(value = "/report_test")
|
|
|
- public String report(HttpServletRequest request, @RequestParam(value = "name", required = false, defaultValue = "springboot-thymeleaf") String name) {
|
|
|
- request.setAttribute("name", name);
|
|
|
- return "agg_report";
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
@GetMapping(value = "/report")
|
|
|
public String showAggrReport(@RequestParam("masterId") String masterId,
|
|
@@ -73,15 +69,21 @@ public class ReportController {
|
|
|
List<BugDTO> bugs = new LinkedList<>();
|
|
|
supplements.forEach(supplementDTO -> bugs.addAll(supplementDTO.getBugs()));
|
|
|
List<BugDTO> sourceReports = bugs.stream().distinct().collect(Collectors.toList());
|
|
|
- List<String> categories = sourceReports.stream().map(BugDTO::getBugCategory).distinct().collect(Collectors.toList());
|
|
|
+ Map<String, Long> categoryCounts = sourceReports.stream().collect(Collectors.groupingBy(BugDTO::getBugCategory, Collectors.counting()));
|
|
|
+ Map<String, Long> severityCounts = sourceReports.stream()
|
|
|
+ .map(BugDTO::getSeverity)
|
|
|
+ .map((severityNum) -> ReportUtil.severity2String.get(severityNum))
|
|
|
+ .collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
|
|
|
|
|
|
List<FinalReportDTO> finalReports = finalReportService.getBySourceId(masterId);
|
|
|
+
|
|
|
model.addAttribute("wordList", getWordCloudList(sourceReports));
|
|
|
- model.addAttribute("categories", categories);
|
|
|
+ model.addAttribute("categoryCounts", categoryCounts);
|
|
|
+ model.addAttribute("severityCounts", severityCounts);
|
|
|
model.addAttribute("aggReportId", "ML-AG-" + masterId.substring(10));
|
|
|
model.addAttribute("masterReport", masterReport);
|
|
|
+ model.addAttribute("createTime", new Date(Long.parseLong(masterReport.getCreateTimeMillis())));
|
|
|
model.addAttribute("supplements", supplements);
|
|
|
-
|
|
|
model.addAttribute("finalReports", finalReports);
|
|
|
model.addAttribute("category2String", ReportUtil.category2String);
|
|
|
model.addAttribute("recurrent2String", ReportUtil.recurrent2String);
|