Search in sources :

Example 1 with ProposalCommitteeeSummary

use of com.hack23.cia.web.impl.ui.application.views.common.dataseriesfactory.api.ProposalCommitteeeSummary in project cia by Hack23.

the class DecisionDataFactoryImpl method createCommitteeSummary.

@Override
public List<ProposalCommitteeeSummary> createCommitteeSummary(final String processedIn) {
    final List<ProposalCommitteeeSummary> summary = new ArrayList<>();
    final DataContainer<DocumentStatusContainer, Long> dataContainer = applicationManager.getDataContainer(DocumentStatusContainer.class);
    for (final DocumentStatusContainer document : dataContainer.getAll()) {
        addProposalCommitteeeSummary(processedIn, summary, document);
    }
    return summary;
}
Also used : DocumentStatusContainer(com.hack23.cia.model.external.riksdagen.dokumentstatus.impl.DocumentStatusContainer) ProposalCommitteeeSummary(com.hack23.cia.web.impl.ui.application.views.common.dataseriesfactory.api.ProposalCommitteeeSummary) ArrayList(java.util.ArrayList)

Example 2 with ProposalCommitteeeSummary

use of com.hack23.cia.web.impl.ui.application.views.common.dataseriesfactory.api.ProposalCommitteeeSummary in project cia by Hack23.

the class DecisionFlowChartManagerImpl method createCommitteeDecisionFlow.

@Override
public SankeyChart createCommitteeDecisionFlow(final ViewRiksdagenCommittee viewRiksdagenCommittee, final Map<String, List<ViewRiksdagenCommittee>> committeeMap, final String rm) {
    final List<ProposalCommitteeeSummary> createCommitteeSummary = decisionDataFactory.createCommitteeSummary(rm);
    final SankeyChart chart = new SankeyChart();
    final Map<String, List<ProposalCommitteeeSummary>> orgProposalMap = createCommitteeSummary.stream().collect(Collectors.groupingBy(ProposalCommitteeeSummary::getOrg));
    for (final Entry<String, List<ProposalCommitteeeSummary>> entry : orgProposalMap.entrySet()) {
        if (committeeMap.containsKey(entry.getKey()) && viewRiksdagenCommittee.getEmbeddedId().getOrgCode().equals(entry.getKey())) {
            addDocTypeDecisionDataRows(chart, entry);
        }
    }
    chart.drawChart();
    return chart;
}
Also used : SankeyChart(com.hack23.cia.web.widgets.charts.SankeyChart) ProposalCommitteeeSummary(com.hack23.cia.web.impl.ui.application.views.common.dataseriesfactory.api.ProposalCommitteeeSummary) List(java.util.List)

Example 3 with ProposalCommitteeeSummary

use of com.hack23.cia.web.impl.ui.application.views.common.dataseriesfactory.api.ProposalCommitteeeSummary in project cia by Hack23.

the class DecisionFlowChartManagerImpl method createAllDecisionFlow.

@Override
public SankeyChart createAllDecisionFlow(final Map<String, List<ViewRiksdagenCommittee>> committeeMap, final String rm) {
    final List<ProposalCommitteeeSummary> createCommitteeSummary = decisionDataFactory.createCommitteeSummary(rm);
    final SankeyChart chart = new SankeyChart();
    final Map<String, List<ProposalCommitteeeSummary>> orgProposalMap = createCommitteeSummary.stream().collect(Collectors.groupingBy(ProposalCommitteeeSummary::getOrg));
    for (final Entry<String, List<ProposalCommitteeeSummary>> entry : orgProposalMap.entrySet()) {
        if (committeeMap.containsKey(entry.getKey())) {
            final Optional<ViewRiksdagenCommittee> vewRiksdagenCommittee = committeeMap.get(entry.getKey()).stream().findFirst();
            if (vewRiksdagenCommittee.isPresent()) {
                addDocTypeDataRows(chart, entry, vewRiksdagenCommittee.get());
                addDecisionDataRows(chart, entry, vewRiksdagenCommittee.get());
            }
        }
    }
    chart.drawChart();
    return chart;
}
Also used : SankeyChart(com.hack23.cia.web.widgets.charts.SankeyChart) ProposalCommitteeeSummary(com.hack23.cia.web.impl.ui.application.views.common.dataseriesfactory.api.ProposalCommitteeeSummary) List(java.util.List) ViewRiksdagenCommittee(com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommittee)

Aggregations

ProposalCommitteeeSummary (com.hack23.cia.web.impl.ui.application.views.common.dataseriesfactory.api.ProposalCommitteeeSummary)3 SankeyChart (com.hack23.cia.web.widgets.charts.SankeyChart)2 List (java.util.List)2 DocumentStatusContainer (com.hack23.cia.model.external.riksdagen.dokumentstatus.impl.DocumentStatusContainer)1 ViewRiksdagenCommittee (com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommittee)1 ArrayList (java.util.ArrayList)1