use of eu.europa.ec.fisheries.ers.service.dto.view.PositionDto in project UVMS-ActivityModule-APP by UnionVMS.
the class BaseMapper method extractPositionDtoFromFishingActivity.
@NotNull
protected PositionDto extractPositionDtoFromFishingActivity(FishingActivityEntity faEntity) {
if (faEntity == null) {
return null;
}
PositionDto positionDto = new PositionDto();
positionDto.setOccurence(faEntity.getOccurence());
if (CollectionUtils.isNotEmpty(faEntity.getFluxLocations())) {
FluxLocationEntity locationEntity = extractFLUXPosition(faEntity.getFluxLocations());
if (locationEntity != null && locationEntity.getGeom() != null) {
positionDto.setGeometry(GeometryMapper.INSTANCE.geometryToWkt(locationEntity.getGeom()).getValue());
}
}
return positionDto;
}
use of eu.europa.ec.fisheries.ers.service.dto.view.PositionDto in project UVMS-ActivityModule-APP by UnionVMS.
the class AreaDtoMapper method getTransmission.
protected PositionDto getTransmission(FishingActivityEntity faEntity) {
if (faEntity == null) {
return null;
}
PositionDto positionDto = new PositionDto();
if (faEntity.getFaReportDocument() != null && faEntity.getFaReportDocument().getVesselTransportMeans() != null && CollectionUtils.isNotEmpty(faEntity.getFaReportDocument().getVesselTransportMeans()) && CollectionUtils.isNotEmpty(faEntity.getFaReportDocument().getVesselTransportMeans().iterator().next().getVesselPositionEvents())) {
VesselPositionEventEntity vesselPositionEventEntity = faEntity.getFaReportDocument().getVesselTransportMeans().iterator().next().getVesselPositionEvents().iterator().next();
positionDto.setOccurence(vesselPositionEventEntity.getObtainedOccurrenceDateTime());
;
positionDto.setGeometry(extractGeometryWkt(vesselPositionEventEntity.getLongitude(), vesselPositionEventEntity.getLatitude()));
} else if (faEntity.getFaReportDocument() != null) {
positionDto.setOccurence(faEntity.getFaReportDocument().getAcceptedDatetime());
}
return positionDto;
}
Aggregations