|
@@ -157,6 +157,52 @@ public class HistoryController {
|
|
|
return "tree_report_new";
|
|
|
}
|
|
|
|
|
|
+ @GetMapping(value = "/report_part")
|
|
|
+ public String showTreerReportPart(@RequestParam("treeId") String treeId,
|
|
|
+ @RequestParam("examId") long examId,
|
|
|
+ @RequestParam("caseId") long caseId,
|
|
|
+ @RequestParam(value = "finalReportId", required = false) Long finalReportId,
|
|
|
+ Model model) {
|
|
|
+ Map<String, BugDTO> bugMap = bugReportService.getAllBugsMap(examId, caseId);
|
|
|
+ BugDTO treeReport = bugMap.get(treeId); // 从bugmap中取得主报告的信息
|
|
|
+ List<String> treeRootids = hisservice.getTreeRoots(caseId+"-"+examId); // 获得所有的根结点的id
|
|
|
+ List<String> childReportIds = hisservice.getSingleRootReports(treeId); // 获得所有自报告的信息
|
|
|
+ List<BugDTO> childReports = new ArrayList<>();
|
|
|
+ childReportIds.forEach(s->{
|
|
|
+ childReports.add(bugMap.get(s));
|
|
|
+ });
|
|
|
+ Map<String, Long> categoryCounts = childReports.stream().collect(Collectors.groupingBy(BugDTO::getBugCategory, Collectors.counting()));
|
|
|
+ Map<String, Long> pageCounts = childReports.stream().collect(Collectors.groupingBy(BugDTO::getBug_page,Collectors.counting()));
|
|
|
+ Map<String, Long> recurrentCounts = childReports.stream()
|
|
|
+ .map(BugDTO::getRecurrent)
|
|
|
+ .map((recurrentNum) -> ReportUtil.recurrent2String.get(recurrentNum))
|
|
|
+ .collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
|
|
|
+ Map<String, Long> severityCounts = childReports.stream()
|
|
|
+ .map(BugDTO::getSeverity)
|
|
|
+ .map((severityNum) -> ReportUtil.severity2String.get(severityNum))
|
|
|
+ .collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
|
|
|
+ List<FinalReportDTO> finalReports = new ArrayList<>();// 暂时还没有finalreport的数据
|
|
|
+
|
|
|
+
|
|
|
+ model.addAttribute("categoryCounts", categoryCounts);
|
|
|
+ model.addAttribute("severityCounts", severityCounts);
|
|
|
+ model.addAttribute("pageCounts",pageCounts);
|
|
|
+ model.addAttribute("recurrentCounts",recurrentCounts);
|
|
|
+ model.addAttribute("aggReportId", "ML-TR-" + treeId.substring(10)); // 树报告的信息
|
|
|
+ model.addAttribute("masterReport", treeReport);
|
|
|
+ model.addAttribute("createTime", new Date(Long.parseLong(treeReport.getCreateTimeMillis())));
|
|
|
+ model.addAttribute("supplements", childReports);
|
|
|
+ model.addAttribute("finalReports", finalReports);
|
|
|
+ model.addAttribute("category2String", ReportUtil.category2String);
|
|
|
+ model.addAttribute("recurrent2String", ReportUtil.recurrent2String);
|
|
|
+ model.addAttribute("severity2String", ReportUtil.severity2String);
|
|
|
+ model.addAttribute("reviewed",false);
|
|
|
+ model.addAttribute("examId", examId);
|
|
|
+ model.addAttribute("caseId", caseId);
|
|
|
+ return "tree_report_new::treeBody";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
//获取所有形成树状结构的bug根节点
|
|
|
// case_take_id=1281-2724&start=0&count=10&page=null&identity=0&report_id=5cbc1a9f825a8960cdc7bd4f&worker_id=22383
|