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