WIP: страницы для правил #62

Closed
Ghost wants to merge 132 commits from master into 61-rules-pages
Showing only changes of commit fd001da317 - Show all commits

View File

@ -3,6 +3,7 @@ package ru.ulstu.extractor.ts;
import ru.ulstu.extractor.model.TimeSeriesValue;
import ru.ulstu.extractor.service.TimeSeriesService;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
@ -35,6 +36,13 @@ public abstract class AbstractTimeSeriesCreator {
// сгруппированные по временным интервалам точки временных рядов
timeSeriesValues.replaceAll((k, v) -> mapTimeSeriesToInterval(getTimeSeriesService().getTimeSeriesInterval(), v));
getTimeSeriesService().save(timeSeriesValues);
getTimeSeriesService().save(sortTimeSeriesValues(timeSeriesValues));
}
private Map<String, List<TimeSeriesValue>> sortTimeSeriesValues(Map<String, List<TimeSeriesValue>> timeSeriesValues) {
for (Map.Entry<String, List<TimeSeriesValue>> entry : timeSeriesValues.entrySet()) {
entry.getValue().sort(Comparator.comparing(TimeSeriesValue::getDate));
}
return timeSeriesValues;
}
}