use of eu.europa.ec.fisheries.ers.service.dto.facatch.DestinationLocationDto in project UVMS-ActivityModule-APP by UnionVMS.
the class FaCatchesProcessorMapper method fillSpecifiedAndDestinationLocationsInGroupDetails.
/**
* Fills the locations on FaCatchGroupDetailsDto DTO.
*
* @param fluxLocations
* @param groupDetailsDto
*/
private static void fillSpecifiedAndDestinationLocationsInGroupDetails(Set<FluxLocationEntity> fluxLocations, FaCatchGroupDetailsDto groupDetailsDto) {
if (CollectionUtils.isEmpty(fluxLocations)) {
return;
}
List<DestinationLocationDto> destLocDtoList = groupDetailsDto.getDestinationLocation();
List<FluxLocationDto> specifiedFluxLocDto = groupDetailsDto.getSpecifiedFluxLocations();
for (FluxLocationEntity actLoc : fluxLocations) {
String fluxLocationType = actLoc.getFluxLocationType();
if (StringUtils.equals(fluxLocationType, FluxLocationCatchTypeEnum.FA_CATCH_DESTINATION.getType())) {
destLocDtoList.add(new DestinationLocationDto(actLoc.getFluxLocationIdentifier(), actLoc.getCountryId(), actLoc.getName()));
} else if (StringUtils.equals(fluxLocationType, FluxLocationCatchTypeEnum.FA_CATCH_SPECIFIED.getType())) {
specifiedFluxLocDto.add(FluxLocationMapper.INSTANCE.mapEntityToFluxLocationDto(actLoc));
}
}
groupDetailsDto.setDestinationLocation(destLocDtoList);
groupDetailsDto.setSpecifiedFluxLocations(specifiedFluxLocDto);
}
Aggregations