Search in sources :

Example 1 with SummaryTableDTO

use of eu.europa.ec.fisheries.ers.service.dto.fareport.summary.SummaryTableDTO in project UVMS-ActivityModule-APP by UnionVMS.

the class FACatchSummaryHelper method populateSummaryTableWithTotal.

/**
 * Creates Summary table structure for provided DTO list
 * @param catchSummaryDTOList list of records to be processed to create summary structure
 * @return
 */
public SummaryTableDTO populateSummaryTableWithTotal(List<FACatchSummaryRecordDTO> catchSummaryDTOList) {
    SummaryTableDTO summaryTableWithTotals = new SummaryTableDTO();
    for (FACatchSummaryRecordDTO faCatchSummaryDTO : catchSummaryDTOList) {
        SummaryTableDTO summaryTable = faCatchSummaryDTO.getSummaryTable();
        populateTotalFishSizeMap(summaryTableWithTotals, summaryTable);
        populateTotalFaCatchMap(summaryTableWithTotals, summaryTable);
    }
    return summaryTableWithTotals;
}
Also used : SummaryTableDTO(eu.europa.ec.fisheries.ers.service.dto.fareport.summary.SummaryTableDTO) FACatchSummaryRecordDTO(eu.europa.ec.fisheries.ers.service.dto.fareport.summary.FACatchSummaryRecordDTO)

Example 2 with SummaryTableDTO

use of eu.europa.ec.fisheries.ers.service.dto.fareport.summary.SummaryTableDTO in project UVMS-ActivityModule-APP by UnionVMS.

the class FaCatchReportServiceBean method getCatchSummaryReport.

/**
 *  This method groups FACatch Data, performs business logic to create summary report
 *  and creates FacatchSummaryDTO object as expected by web interface.
 *  isReporting : TRUE indicates that the method should be used to generate result for REPORTING module
 *                FALSE indicates that the method should be used to generate result from TRIP SUMMARY VIEW
 * @param query
 * @return
 * @throws ServiceException
 */
@Override
public FACatchSummaryDTO getCatchSummaryReport(FishingActivityQuery query, boolean isLanding) throws ServiceException {
    // get grouped data
    Map<FaCatchSummaryCustomProxy, List<FaCatchSummaryCustomProxy>> groupedData = faCatchDao.getGroupedFaCatchData(query, isLanding);
    // post process data to create Summary table part of Catch summary Report
    FACatchSummaryHelper faCatchSummaryHelper = isLanding ? FACatchSummaryHelperFactory.getFACatchSummaryHelper(FACatchSummaryHelperFactory.PRESENTATION) : FACatchSummaryHelperFactory.getFACatchSummaryHelper(FACatchSummaryHelperFactory.STANDARD);
    List<FACatchSummaryRecordDTO> catchSummaryList = faCatchSummaryHelper.buildFACatchSummaryRecordDTOList(groupedData);
    // Post process data to calculate Totals for each column
    SummaryTableDTO summaryTableDTOTotal = faCatchSummaryHelper.populateSummaryTableWithTotal(catchSummaryList);
    // Create DTO object to send back to the web
    FACatchSummaryDTO faCatchSummaryDTO = new FACatchSummaryDTO();
    faCatchSummaryDTO.setRecordDTOs(catchSummaryList);
    faCatchSummaryDTO.setTotal(summaryTableDTOTotal);
    return faCatchSummaryDTO;
}
Also used : FaCatchSummaryCustomProxy(eu.europa.ec.fisheries.ers.fa.dao.proxy.FaCatchSummaryCustomProxy) FACatchSummaryHelper(eu.europa.ec.fisheries.ers.service.facatch.FACatchSummaryHelper) FACatchSummaryDTO(eu.europa.ec.fisheries.ers.service.dto.fareport.summary.FACatchSummaryDTO) ArrayList(java.util.ArrayList) List(java.util.List) FACatchSummaryRecordDTO(eu.europa.ec.fisheries.ers.service.dto.fareport.summary.FACatchSummaryRecordDTO) SummaryTableDTO(eu.europa.ec.fisheries.ers.service.dto.fareport.summary.SummaryTableDTO)

Aggregations

FACatchSummaryRecordDTO (eu.europa.ec.fisheries.ers.service.dto.fareport.summary.FACatchSummaryRecordDTO)2 SummaryTableDTO (eu.europa.ec.fisheries.ers.service.dto.fareport.summary.SummaryTableDTO)2 FaCatchSummaryCustomProxy (eu.europa.ec.fisheries.ers.fa.dao.proxy.FaCatchSummaryCustomProxy)1 FACatchSummaryDTO (eu.europa.ec.fisheries.ers.service.dto.fareport.summary.FACatchSummaryDTO)1 FACatchSummaryHelper (eu.europa.ec.fisheries.ers.service.facatch.FACatchSummaryHelper)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1