Search in sources :

Example 1 with FluxReportIdentifierDTO

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

the class FishingActivityMapper method getUniqueFaReportId.

protected String getUniqueFaReportId(FishingActivityEntity entity) {
    List<FluxReportIdentifierDTO> fluxReportIdentifierDTOs = getUniqueId(entity);
    if (CollectionUtils.isEmpty(fluxReportIdentifierDTOs)) {
        return null;
    }
    // for EU implementation we are expecting only single value for the FLUXReportIdentifier per FLUXReportDocument as per implementation guide.
    FluxReportIdentifierDTO fluxReportIdentifierDTO = fluxReportIdentifierDTOs.get(0);
    return fluxReportIdentifierDTO.getFluxReportId();
}
Also used : FluxReportIdentifierDTO(eu.europa.ec.fisheries.ers.service.dto.FluxReportIdentifierDTO)

Example 2 with FluxReportIdentifierDTO

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

the class FishingActivityMapper method getUniqueId.

protected List<FluxReportIdentifierDTO> getUniqueId(FishingActivityEntity entity) {
    if (entity == null || entity.getFaReportDocument() == null || entity.getFaReportDocument().getFluxReportDocument() == null) {
        return Collections.emptyList();
    }
    List<FluxReportIdentifierDTO> identifierDTOs = new ArrayList<>();
    Set<FluxReportIdentifierEntity> identifiers = entity.getFaReportDocument().getFluxReportDocument().getFluxReportIdentifiers();
    for (FluxReportIdentifierEntity fluxReportIdentifierEntity : identifiers) {
        identifierDTOs.add(FluxReportIdentifierMapper.INSTANCE.mapToFluxReportIdentifierDTO(fluxReportIdentifierEntity));
    }
    return identifierDTOs;
}
Also used : FluxReportIdentifierEntity(eu.europa.ec.fisheries.ers.fa.entities.FluxReportIdentifierEntity) FluxReportIdentifierDTO(eu.europa.ec.fisheries.ers.service.dto.FluxReportIdentifierDTO) ArrayList(java.util.ArrayList)

Example 3 with FluxReportIdentifierDTO

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

the class FishingActivityMapper method getUniqueFaReportSchemeId.

protected String getUniqueFaReportSchemeId(FishingActivityEntity entity) {
    List<FluxReportIdentifierDTO> fluxReportIdentifierDTOs = getUniqueId(entity);
    if (CollectionUtils.isEmpty(fluxReportIdentifierDTOs)) {
        return null;
    }
    // for EU implementation we are expecting only single value for the FLUXReportIdentifier per FLUXReportDocument as per implementation guide.
    FluxReportIdentifierDTO fluxReportIdentifierDTO = fluxReportIdentifierDTOs.get(0);
    return fluxReportIdentifierDTO.getFluxReportSchemeId();
}
Also used : FluxReportIdentifierDTO(eu.europa.ec.fisheries.ers.service.dto.FluxReportIdentifierDTO)

Aggregations

FluxReportIdentifierDTO (eu.europa.ec.fisheries.ers.service.dto.FluxReportIdentifierDTO)3 FluxReportIdentifierEntity (eu.europa.ec.fisheries.ers.fa.entities.FluxReportIdentifierEntity)1 ArrayList (java.util.ArrayList)1