Search in sources :

Example 1 with RelocationDto

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

the class BaseActivityViewMapper method getRelocations.

public List<RelocationDto> getRelocations(FishingActivityEntity fishingActivityEntity) {
    List<RelocationDto> relocationDtos = new ArrayList<>();
    Set<FishingActivityEntity> relatedActivities = fishingActivityEntity.getAllRelatedFishingActivities();
    for (FishingActivityEntity fishingActivity : relatedActivities) {
        if (fishingActivity.getTypeCode().toUpperCase().equalsIgnoreCase(ActivityViewEnum.RELOCATION.name())) {
            relocationDtos.addAll(FaCatchMapper.INSTANCE.mapToRelocationDtoList(fishingActivity.getFaCatchs()));
        }
    }
    return relocationDtos;
}
Also used : ArrayList(java.util.ArrayList) RelocationDto(eu.europa.ec.fisheries.ers.service.dto.view.RelocationDto) FishingActivityEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingActivityEntity)

Aggregations

FishingActivityEntity (eu.europa.ec.fisheries.ers.fa.entities.FishingActivityEntity)1 RelocationDto (eu.europa.ec.fisheries.ers.service.dto.view.RelocationDto)1 ArrayList (java.util.ArrayList)1