Search in sources :

Example 1 with ActivityDetailsDto

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

the class FishingOperationViewMapper method mapFaEntityToFaDto.

@Override
public FishingActivityViewDTO mapFaEntityToFaDto(FishingActivityEntity faEntity) {
    FishingActivityViewDTO viewDTO = new FishingActivityViewDTO();
    ActivityDetailsDto detailsDto = mapActivityDetails(faEntity);
    detailsDto.setOccurrence(faEntity.getOccurence());
    detailsDto.setVesselActivity(faEntity.getVesselActivityCode());
    if (faEntity.getOperationQuantity() != null) {
        detailsDto.setNrOfOperation(faEntity.getOperationQuantity().intValue());
    }
    detailsDto.setFisheryType(faEntity.getFisheryTypeCode());
    detailsDto.setSpeciesTarget(faEntity.getSpeciesTargetCode());
    Set<FishingActivityIdentifierEntity> fishingActivityIdentifiers = faEntity.getFishingActivityIdentifiers();
    detailsDto.setIdentifiers(FishingActivityIdentifierMapper.INSTANCE.mapToIdentifierDTOSet(fishingActivityIdentifiers));
    detailsDto.setFishingTime(this.calculateFishingTime(faEntity.getDelimitedPeriods()));
    viewDTO.setActivityDetails(detailsDto);
    viewDTO.setGears(this.getGearsFromEntity(faEntity.getFishingGears()));
    viewDTO.setReportDetails(this.getReportDocsFromEntity(faEntity.getFaReportDocument()));
    viewDTO.setCatches(this.mapCatchesToGroupDto(faEntity));
    viewDTO.setProcessingProducts(this.getProcessingProductsByFaCatches(faEntity.getFaCatchs()));
    viewDTO.setGearProblems(GearShotRetrievalTileMapper.INSTANCE.mapGearProblemsToGearsDto(faEntity.getGearProblems()));
    viewDTO.setGearShotRetrievalList(GearShotRetrievalTileMapperImpl.INSTANCE.mapFromRelatedFishingActivities(faEntity));
    Set<FluxLocationDto> fluxLocationDtos = mapFromFluxLocation(faEntity.getFluxLocations());
    viewDTO.setLocations(fluxLocationDtos);
    viewDTO.setVesselDetails(getVesselDetailsDTO(faEntity));
    return viewDTO;
}
Also used : ActivityDetailsDto(eu.europa.ec.fisheries.ers.service.dto.view.ActivityDetailsDto) FishingActivityViewDTO(eu.europa.ec.fisheries.ers.service.dto.view.parent.FishingActivityViewDTO) FishingActivityIdentifierEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingActivityIdentifierEntity) FluxLocationDto(eu.europa.ec.fisheries.ers.service.dto.view.FluxLocationDto)

Example 2 with ActivityDetailsDto

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

the class DiscardViewMapper method mapFaEntityToFaDto.

@Override
public FishingActivityViewDTO mapFaEntityToFaDto(FishingActivityEntity faEntity) {
    FishingActivityViewDTO fishingActivityViewDTO = new FishingActivityViewDTO();
    ActivityDetailsDto activityDetailsDto = mapActivityDetails(faEntity);
    activityDetailsDto.setReason(faEntity.getReasonCode());
    Set<FishingActivityIdentifierEntity> fishingActivityIdentifiers = faEntity.getFishingActivityIdentifiers();
    activityDetailsDto.setIdentifiers(FishingActivityIdentifierMapper.INSTANCE.mapToIdentifierDTOSet(fishingActivityIdentifiers));
    fishingActivityViewDTO.setActivityDetails(activityDetailsDto);
    fishingActivityViewDTO.setLocations(mapFromFluxLocation(faEntity.getFluxLocations()));
    fishingActivityViewDTO.setReportDetails(getReportDocsFromEntity(faEntity.getFaReportDocument()));
    fishingActivityViewDTO.setCatches(mapCatchesToGroupDto(faEntity));
    fishingActivityViewDTO.setProcessingProducts(getProcessingProductsByFaCatches(faEntity.getFaCatchs()));
    return fishingActivityViewDTO;
}
Also used : ActivityDetailsDto(eu.europa.ec.fisheries.ers.service.dto.view.ActivityDetailsDto) FishingActivityViewDTO(eu.europa.ec.fisheries.ers.service.dto.view.parent.FishingActivityViewDTO) FishingActivityIdentifierEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingActivityIdentifierEntity)

Example 3 with ActivityDetailsDto

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

the class ActivityNotificationOfArrivalViewMapper method mapFaEntityToFaDto.

@Override
public FishingActivityViewDTO mapFaEntityToFaDto(FishingActivityEntity faEntity) {
    FishingActivityViewDTO fishingActivityViewDTO = new FishingActivityViewDTO();
    if (faEntity != null) {
        // Fishing Activity Tile
        ActivityDetailsDto activityDetailsDto = mapActivityDetails(faEntity);
        activityDetailsDto.setReason(faEntity.getReasonCode());
        fishingActivityViewDTO.setActivityDetails(activityDetailsDto);
        // Intented ports of Landing Tile
        fishingActivityViewDTO.setLocations(mapFromFluxLocation(faEntity.getFluxLocations()));
        // Activity Report document tile
        fishingActivityViewDTO.setReportDetails(getReportDocsFromEntity(faEntity.getFaReportDocument()));
        // Catch tile
        fishingActivityViewDTO.setCatches(mapCatchesToGroupDto(faEntity));
        // Applied AAP process Tile
        fishingActivityViewDTO.setProcessingProducts(getProcessingProductsByFaCatches(faEntity.getFaCatchs()));
    }
    return fishingActivityViewDTO;
}
Also used : ActivityDetailsDto(eu.europa.ec.fisheries.ers.service.dto.view.ActivityDetailsDto) FishingActivityViewDTO(eu.europa.ec.fisheries.ers.service.dto.view.parent.FishingActivityViewDTO)

Example 4 with ActivityDetailsDto

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

the class JointFishingOperationViewMapper method mapFaEntityToFaDto.

@Override
public FishingActivityViewDTO mapFaEntityToFaDto(FishingActivityEntity faEntity) {
    FishingActivityViewDTO viewDTO = new FishingActivityViewDTO();
    ActivityDetailsDto detailsDto = mapActivityDetails(faEntity);
    detailsDto.setVesselActivity(faEntity.getVesselActivityCode());
    detailsDto.setFisheryType(faEntity.getFisheryTypeCode());
    detailsDto.setSpeciesTarget(faEntity.getSpeciesTargetCode());
    detailsDto.setFishingTime(calculateFishingTime(faEntity.getDelimitedPeriods()));
    viewDTO.setActivityDetails(detailsDto);
    viewDTO.setLocations(mapFromFluxLocation(faEntity.getFluxLocations()));
    viewDTO.setReportDetails(getReportDocsFromEntity(faEntity.getFaReportDocument()));
    viewDTO.setGears(getGearsFromEntity(faEntity.getFishingGears()));
    viewDTO.setVesselDetails(getVesselDetailsDTO(faEntity));
    viewDTO.setCatches(mapCatchesToGroupDto(faEntity));
    viewDTO.setProcessingProducts(getProcessingProductsByFaCatches(faEntity.getFaCatchs()));
    viewDTO.setGearProblems(GearShotRetrievalTileMapper.INSTANCE.mapGearProblemsToGearsDto(faEntity.getGearProblems()));
    viewDTO.setRelocations(getRelocations(faEntity));
    return viewDTO;
}
Also used : ActivityDetailsDto(eu.europa.ec.fisheries.ers.service.dto.view.ActivityDetailsDto) FishingActivityViewDTO(eu.europa.ec.fisheries.ers.service.dto.view.parent.FishingActivityViewDTO)

Aggregations

ActivityDetailsDto (eu.europa.ec.fisheries.ers.service.dto.view.ActivityDetailsDto)4 FishingActivityViewDTO (eu.europa.ec.fisheries.ers.service.dto.view.parent.FishingActivityViewDTO)4 FishingActivityIdentifierEntity (eu.europa.ec.fisheries.ers.fa.entities.FishingActivityIdentifierEntity)2 FluxLocationDto (eu.europa.ec.fisheries.ers.service.dto.view.FluxLocationDto)1