Loading time-series-view/src/main/java/es/redmic/timeseriesview/controller/ObjectCollectingSeriesController.java +9 −10 Original line number Diff line number Diff line Loading @@ -57,14 +57,14 @@ public class ObjectCollectingSeriesController extends RSeriesController<ObjectCo @ResponseBody public SuperDTO findClassificationList(@Valid @RequestBody DataQueryDTO queryDTO, BindingResult bindingResult) { if (bindingResult != null && bindingResult.hasErrors()) throw new DTONotValidException(bindingResult); AggsPropertiesDTO agg = new AggsPropertiesDTO(); agg.setField("classificationList"); queryDTO.addAgg(agg); queryDTO.setSize(0); if (bindingResult != null && bindingResult.hasErrors()) throw new DTONotValidException(bindingResult); return service.findClassificationList(queryDTO); } Loading @@ -72,14 +72,14 @@ public class ObjectCollectingSeriesController extends RSeriesController<ObjectCo @ResponseBody public SuperDTO findClassification(@Valid @RequestBody DataQueryDTO queryDTO, BindingResult bindingResult) { if (bindingResult != null && bindingResult.hasErrors()) throw new DTONotValidException(bindingResult); AggsPropertiesDTO agg = new AggsPropertiesDTO(); agg.setField("classification"); queryDTO.addAgg(agg); queryDTO.setSize(0); if (bindingResult != null && bindingResult.hasErrors()) throw new DTONotValidException(bindingResult); return service.findClassificationStatistics(queryDTO); } Loading @@ -87,15 +87,14 @@ public class ObjectCollectingSeriesController extends RSeriesController<ObjectCo @ResponseBody public SuperDTO findTemporalData(@Valid @RequestBody DataQueryDTO queryDTO, BindingResult bindingResult) { if (bindingResult != null && bindingResult.hasErrors()) throw new DTONotValidException(bindingResult); AggsPropertiesDTO agg = new AggsPropertiesDTO(); agg.setField("temporaldata"); queryDTO.addAgg(agg); queryDTO.setSize(0); if (bindingResult != null && bindingResult.hasErrors()) throw new DTONotValidException(bindingResult); return service.findTemporalDataStatistics(queryDTO); } Loading time-series-view/src/main/java/es/redmic/timeseriesview/service/ObjectCollectingSeriesESService.java +10 −3 Original line number Diff line number Diff line Loading @@ -58,22 +58,26 @@ public class ObjectCollectingSeriesESService this.repository = repository; } @SuppressWarnings("unchecked") public ElasticSearchDTO findClassificationList(DataQueryDTO query) { SeriesSearchWrapper<ObjectCollectingSeries> response = repository.find(query); if (response == null || response.getAggregations() == null) return new ElasticSearchDTO(null, 0); ClassificationsForListDTO dtoOut = Mappers.getMapper(ObjectCollectingSeriesESMapper.class) .convertToList(response.getAggregations()); return new ElasticSearchDTO(dtoOut.getClassification(), dtoOut.getClassification().size()); } @SuppressWarnings("unchecked") public ElasticSearchDTO findClassificationStatistics(DataQueryDTO query) { SeriesSearchWrapper<ObjectCollectingSeries> response = repository.find(query); if (response == null || response.getAggregations() == null) return new ElasticSearchDTO(null, 0); ClassificationsForPieChartDTO dtoOut = Mappers.getMapper(ObjectCollectingSeriesESMapper.class) .convertToPieChart(response.getAggregations()); Loading @@ -85,9 +89,12 @@ public class ObjectCollectingSeriesESService SeriesSearchWrapper<ObjectCollectingSeries> response = repository.find(query); DataHistogramDTO dtoOut = Mappers.getMapper(DataHistogramESMapper.class).map(response.getAggregations()); if (response == null || response.getAggregations() == null) return new ElasticSearchDTO(null, 0); DataHistogramDTO dtoOut = Mappers.getMapper(DataHistogramESMapper.class).map(response.getAggregations()); dtoOut.setDataDefinitionIds((List<Integer>) query.getTerms().get("dataDefinition")); return new ElasticSearchDTO(dtoOut, dtoOut.getData().size()); } Loading Loading
time-series-view/src/main/java/es/redmic/timeseriesview/controller/ObjectCollectingSeriesController.java +9 −10 Original line number Diff line number Diff line Loading @@ -57,14 +57,14 @@ public class ObjectCollectingSeriesController extends RSeriesController<ObjectCo @ResponseBody public SuperDTO findClassificationList(@Valid @RequestBody DataQueryDTO queryDTO, BindingResult bindingResult) { if (bindingResult != null && bindingResult.hasErrors()) throw new DTONotValidException(bindingResult); AggsPropertiesDTO agg = new AggsPropertiesDTO(); agg.setField("classificationList"); queryDTO.addAgg(agg); queryDTO.setSize(0); if (bindingResult != null && bindingResult.hasErrors()) throw new DTONotValidException(bindingResult); return service.findClassificationList(queryDTO); } Loading @@ -72,14 +72,14 @@ public class ObjectCollectingSeriesController extends RSeriesController<ObjectCo @ResponseBody public SuperDTO findClassification(@Valid @RequestBody DataQueryDTO queryDTO, BindingResult bindingResult) { if (bindingResult != null && bindingResult.hasErrors()) throw new DTONotValidException(bindingResult); AggsPropertiesDTO agg = new AggsPropertiesDTO(); agg.setField("classification"); queryDTO.addAgg(agg); queryDTO.setSize(0); if (bindingResult != null && bindingResult.hasErrors()) throw new DTONotValidException(bindingResult); return service.findClassificationStatistics(queryDTO); } Loading @@ -87,15 +87,14 @@ public class ObjectCollectingSeriesController extends RSeriesController<ObjectCo @ResponseBody public SuperDTO findTemporalData(@Valid @RequestBody DataQueryDTO queryDTO, BindingResult bindingResult) { if (bindingResult != null && bindingResult.hasErrors()) throw new DTONotValidException(bindingResult); AggsPropertiesDTO agg = new AggsPropertiesDTO(); agg.setField("temporaldata"); queryDTO.addAgg(agg); queryDTO.setSize(0); if (bindingResult != null && bindingResult.hasErrors()) throw new DTONotValidException(bindingResult); return service.findTemporalDataStatistics(queryDTO); } Loading
time-series-view/src/main/java/es/redmic/timeseriesview/service/ObjectCollectingSeriesESService.java +10 −3 Original line number Diff line number Diff line Loading @@ -58,22 +58,26 @@ public class ObjectCollectingSeriesESService this.repository = repository; } @SuppressWarnings("unchecked") public ElasticSearchDTO findClassificationList(DataQueryDTO query) { SeriesSearchWrapper<ObjectCollectingSeries> response = repository.find(query); if (response == null || response.getAggregations() == null) return new ElasticSearchDTO(null, 0); ClassificationsForListDTO dtoOut = Mappers.getMapper(ObjectCollectingSeriesESMapper.class) .convertToList(response.getAggregations()); return new ElasticSearchDTO(dtoOut.getClassification(), dtoOut.getClassification().size()); } @SuppressWarnings("unchecked") public ElasticSearchDTO findClassificationStatistics(DataQueryDTO query) { SeriesSearchWrapper<ObjectCollectingSeries> response = repository.find(query); if (response == null || response.getAggregations() == null) return new ElasticSearchDTO(null, 0); ClassificationsForPieChartDTO dtoOut = Mappers.getMapper(ObjectCollectingSeriesESMapper.class) .convertToPieChart(response.getAggregations()); Loading @@ -85,9 +89,12 @@ public class ObjectCollectingSeriesESService SeriesSearchWrapper<ObjectCollectingSeries> response = repository.find(query); DataHistogramDTO dtoOut = Mappers.getMapper(DataHistogramESMapper.class).map(response.getAggregations()); if (response == null || response.getAggregations() == null) return new ElasticSearchDTO(null, 0); DataHistogramDTO dtoOut = Mappers.getMapper(DataHistogramESMapper.class).map(response.getAggregations()); dtoOut.setDataDefinitionIds((List<Integer>) query.getTerms().get("dataDefinition")); return new ElasticSearchDTO(dtoOut, dtoOut.getData().size()); } Loading