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;
}
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;
}
Aggregations