Search in sources :

Example 1 with RiksdagenCommitteeDecisionTypeSummaryEmbeddedId

use of com.hack23.cia.model.internal.application.data.committee.impl.RiksdagenCommitteeDecisionTypeSummaryEmbeddedId in project cia by Hack23.

the class DecisionChartDataManagerImpl method getCommitteeDecisionTypeMap.

/**
 * Gets the committee decision type map.
 *
 * @return the committee decision type map
 */
private Map<String, List<ViewRiksdagenCommitteeDecisionTypeDailySummary>> getCommitteeDecisionTypeMap() {
    final DataContainer<ViewRiksdagenCommitteeDecisionTypeDailySummary, RiksdagenCommitteeDecisionTypeSummaryEmbeddedId> committeeBallotDecisionPartyDataContainer = getApplicationManager().getDataContainer(ViewRiksdagenCommitteeDecisionTypeDailySummary.class);
    final Date now = new Date();
    final Date notBefore = new GregorianCalendar(2000, Calendar.JANUARY, 1).getTime();
    return committeeBallotDecisionPartyDataContainer.getAll().parallelStream().filter(t -> t != null && !t.getEmbeddedId().getDecisionDate().after(now) && !notBefore.after(t.getEmbeddedId().getDecisionDate())).collect(Collectors.groupingBy(t -> t.getEmbeddedId().getDecisionType()));
}
Also used : DataSeries(org.dussan.vaadin.dcharts.data.DataSeries) GregorianCalendar(java.util.GregorianCalendar) Date(java.util.Date) SimpleDateFormat(java.text.SimpleDateFormat) Collectors(java.util.stream.Collectors) DecisionChartDataManager(com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.DecisionChartDataManager) ViewRiksdagenCommitteeDecisionTypeOrgDailySummary(com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommitteeDecisionTypeOrgDailySummary) Objects(java.util.Objects) RiksdagenCommitteeDecisionTypeOrgSummaryEmbeddedId(com.hack23.cia.model.internal.application.data.committee.impl.RiksdagenCommitteeDecisionTypeOrgSummaryEmbeddedId) DCharts(org.dussan.vaadin.dcharts.DCharts) DataContainer(com.hack23.cia.service.api.DataContainer) List(java.util.List) Calendar(java.util.Calendar) ViewRiksdagenCommitteeDecisionTypeDailySummary(com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommitteeDecisionTypeDailySummary) RiksdagenCommitteeDecisionTypeSummaryEmbeddedId(com.hack23.cia.model.internal.application.data.committee.impl.RiksdagenCommitteeDecisionTypeSummaryEmbeddedId) Locale(java.util.Locale) Service(org.springframework.stereotype.Service) Map(java.util.Map) Series(org.dussan.vaadin.dcharts.options.Series) Entry(java.util.Map.Entry) XYseries(org.dussan.vaadin.dcharts.base.elements.XYseries) AbstractOrderedLayout(com.vaadin.ui.AbstractOrderedLayout) RiksdagenCommitteeDecisionTypeSummaryEmbeddedId(com.hack23.cia.model.internal.application.data.committee.impl.RiksdagenCommitteeDecisionTypeSummaryEmbeddedId) ViewRiksdagenCommitteeDecisionTypeDailySummary(com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommitteeDecisionTypeDailySummary) GregorianCalendar(java.util.GregorianCalendar) Date(java.util.Date)

Aggregations

RiksdagenCommitteeDecisionTypeOrgSummaryEmbeddedId (com.hack23.cia.model.internal.application.data.committee.impl.RiksdagenCommitteeDecisionTypeOrgSummaryEmbeddedId)1 RiksdagenCommitteeDecisionTypeSummaryEmbeddedId (com.hack23.cia.model.internal.application.data.committee.impl.RiksdagenCommitteeDecisionTypeSummaryEmbeddedId)1 ViewRiksdagenCommitteeDecisionTypeDailySummary (com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommitteeDecisionTypeDailySummary)1 ViewRiksdagenCommitteeDecisionTypeOrgDailySummary (com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommitteeDecisionTypeOrgDailySummary)1 DataContainer (com.hack23.cia.service.api.DataContainer)1 DecisionChartDataManager (com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.DecisionChartDataManager)1 AbstractOrderedLayout (com.vaadin.ui.AbstractOrderedLayout)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Calendar (java.util.Calendar)1 Date (java.util.Date)1 GregorianCalendar (java.util.GregorianCalendar)1 List (java.util.List)1 Locale (java.util.Locale)1 Map (java.util.Map)1 Entry (java.util.Map.Entry)1 Objects (java.util.Objects)1 Collectors (java.util.stream.Collectors)1 DCharts (org.dussan.vaadin.dcharts.DCharts)1 XYseries (org.dussan.vaadin.dcharts.base.elements.XYseries)1 DataSeries (org.dussan.vaadin.dcharts.data.DataSeries)1