From f3df5f5ad123e57c4be38f9219eb061fd6392a4d Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Mon, 19 Apr 2021 16:52:00 +0400 Subject: [PATCH] #23-Create statistic method --- .../controller/StatisticController.java | 14 +-- src/main/resources/templates/statistic.html | 118 ++++++++++++------ 2 files changed, 88 insertions(+), 44 deletions(-) diff --git a/src/main/java/ru/ulstu/extractor/controller/StatisticController.java b/src/main/java/ru/ulstu/extractor/controller/StatisticController.java index babdc1a..05f7d98 100644 --- a/src/main/java/ru/ulstu/extractor/controller/StatisticController.java +++ b/src/main/java/ru/ulstu/extractor/controller/StatisticController.java @@ -38,13 +38,6 @@ public class StatisticController { url[i] = urlCommits().get(i)[0].toString().substring(urlCommits().get(i)[0].toString().lastIndexOf("/") + 1); } model.addAttribute("urls", url); - for (int i = 0; i < entityCommits().size(); i++) { - entityCommits().get(i)[0] = Boolean.TRUE.equals(entityCommits().get(i)[0]) - ? "Есть сущности" - : (entityCommits().get(i)[0] == null - ? "Нет данных" - : "Нет сущностей"); - } model.addAttribute("commitEntityData", entityCommits()); model.addAttribute("commitTimeEntityData", allTimeEntityCommits()); return STATISTIC; @@ -75,6 +68,13 @@ public class StatisticController { List entityCommits = commitRepository.getCommitEntityStatistic().stream() .map(stat -> new Object[]{stat.getEntity(), stat.getCountCommit()}) .collect(Collectors.toList()); + for (int i = 0; i < entityCommits.size(); i++) { + entityCommits.get(i)[0] = Boolean.TRUE.equals(entityCommits.get(i)[0]) + ? "Есть сущности" + : (entityCommits.get(i)[0] == null + ? "Нет данных" + : "Нет сущностей"); + } return entityCommits; } diff --git a/src/main/resources/templates/statistic.html b/src/main/resources/templates/statistic.html index a1f9c9a..8befdd5 100644 --- a/src/main/resources/templates/statistic.html +++ b/src/main/resources/templates/statistic.html @@ -79,44 +79,44 @@ $('#container').highcharts(json); }); - + + + + + + + + + +
+