Search in sources :

Example 11 with FishingActivity

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity in project UVMS-ActivityModule-APP by UnionVMS.

the class ActivityEntityToModelMapper method mapDestinationVesselStorageCharacteristic.

private void mapDestinationVesselStorageCharacteristic(FishingActivity target, VesselStorageCharacteristicsEntity source) {
    if (ObjectUtils.allNotNull(target, source)) {
        VesselStorageCharacteristic vesselStorageCharacteristic = new VesselStorageCharacteristic();
        mapID(vesselStorageCharacteristic, source);
        mapVesselStorageCharCodes(vesselStorageCharacteristic, source.getVesselStorageCharCode());
        target.setDestinationVesselStorageCharacteristic(vesselStorageCharacteristic);
    }
}
Also used : VesselStorageCharacteristic(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselStorageCharacteristic)

Example 12 with FishingActivity

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity in project UVMS-ActivityModule-APP by UnionVMS.

the class ActivityEntityToModelMapper method mapVesselRelatedActivityCode.

private void mapVesselRelatedActivityCode(FishingActivity target, FishingActivityEntity source) {
    if (ObjectUtils.allNotNull(target, source) && (StringUtils.isNotEmpty(source.getVesselActivityCode()) || StringUtils.isNotEmpty(source.getVesselActivityCodeListId()))) {
        CodeType codeType = new CodeType();
        if (StringUtils.isNotEmpty(source.getVesselActivityCode())) {
            codeType.setValue(source.getVesselActivityCode());
        }
        if (StringUtils.isNotEmpty(source.getVesselActivityCodeListId())) {
            codeType.setListID(source.getVesselActivityCodeListId());
        }
        target.setVesselRelatedActivityCode(codeType);
    }
}
Also used : CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)

Example 13 with FishingActivity

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity in project UVMS-ActivityModule-APP by UnionVMS.

the class ActivityEntityToModelMapper method mapFisheryTypeCode.

private void mapFisheryTypeCode(FishingActivity target, FishingActivityEntity source) {
    if (ObjectUtils.allNotNull(target, source) && (StringUtils.isNotEmpty(source.getFisheryTypeCode()) || StringUtils.isNotEmpty(source.getFisheryTypeCodeListId()))) {
        CodeType codeType = new CodeType();
        if (StringUtils.isNotEmpty(source.getFisheryTypeCode())) {
            codeType.setValue(source.getFisheryTypeCode());
        }
        if (StringUtils.isNotEmpty(source.getFisheryTypeCodeListId())) {
            codeType.setListID(source.getFisheryTypeCodeListId());
        }
        target.setFisheryTypeCode(codeType);
    }
}
Also used : CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)

Example 14 with FishingActivity

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity in project UVMS-ActivityModule-APP by UnionVMS.

the class ActivityEntityToModelMapper method mapFishingActivities.

private void mapFishingActivities(FAReportDocument faReportDocument, Set<FishingActivityEntity> fishingActivityEntities) {
    if (CollectionUtils.isNotEmpty(fishingActivityEntities)) {
        List<FishingActivity> fishingActivityList = new ArrayList<>();
        for (FishingActivityEntity source : fishingActivityEntities) {
            FishingActivity target = new FishingActivity();
            mapPurposeCode(target, source);
            mapReasonCode(target, source);
            mapOperationsQuantity(target, source);
            mapFisheryTypeCode(target, source);
            mapSpeciesTargetCode(target, source);
            mapFishingDurationMeasure(target, source);
            mapVesselRelatedActivityCode(target, source);
            mapOccurrenceDateTime(target, source.getOccurence());
            mapSourceVesselStorageCharacteristic(target, source.getSourceVesselCharId());
            mapDestinationVesselStorageCharacteristic(target, source.getDestVesselCharId());
            target.setRelatedFLUXLocations(FluxLocationMapper.INSTANCE.mapToFluxLocationList(source.getFluxLocations()));
            mapSpecifiedFLUXCharacteristics(target, source.getFluxCharacteristics());
            target.setSpecifiedDelimitedPeriods(DelimitedPeriodMapper.INSTANCE.mapToDelimitedPeriodList(source.getDelimitedPeriods()));
            List<FishingTrip> fishingTrips = FishingTripMapper.INSTANCE.mapToFishingTripList(source.getFishingTrips());
            if (CollectionUtils.isNotEmpty(fishingTrips)) {
                target.setSpecifiedFishingTrip(fishingTrips.get(0));
            }
            // TODO MAP
            source.getFishingGears();
            // TODO MAP
            source.getFlagState();
            // target.getSpecifiedFACatches() // TODO map
            fishingActivityList.add(target);
        }
        faReportDocument.setSpecifiedFishingActivities(fishingActivityList);
    }
}
Also used : FishingActivity(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity) ArrayList(java.util.ArrayList) FishingTrip(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingTrip) FishingActivityEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingActivityEntity)

Example 15 with FishingActivity

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity in project UVMS-ActivityModule-APP by UnionVMS.

the class ActivityEntityToModelMapper method mapSpecifiedFLUXCharacteristics.

private void mapSpecifiedFLUXCharacteristics(FishingActivity fishingActivity, Set<FluxCharacteristicEntity> fluxCharacteristics) {
    if (CollectionUtils.isNotEmpty(fluxCharacteristics)) {
        List<FLUXCharacteristic> fluxCharacteristicList = new ArrayList<>();
        for (FluxCharacteristicEntity source : fluxCharacteristics) {
            FLUXCharacteristic target = new FLUXCharacteristic();
            mapPurposeCode(target, source);
            mapValueCode(target, source);
            mapValueDateTime(target, source);
            mapValueIndicator(target, source);
            mapValueQuantity(target, source);
            mapValueMeasure(target, source);
            mapDescriptions(target, source);
            mapValues(target, source);
            fluxCharacteristicList.add(target);
        }
        fishingActivity.setSpecifiedFLUXCharacteristics(fluxCharacteristicList);
    }
}
Also used : ArrayList(java.util.ArrayList) FLUXCharacteristic(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXCharacteristic) FluxCharacteristicEntity(eu.europa.ec.fisheries.ers.fa.entities.FluxCharacteristicEntity)

Aggregations

FishingActivity (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity)9 CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)7 FishingActivityEntity (eu.europa.ec.fisheries.ers.fa.entities.FishingActivityEntity)5 VesselTransportMeans (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselTransportMeans)4 DateTimeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType)4 HashSet (java.util.HashSet)3 VesselStorageCharacteristic (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselStorageCharacteristic)3 FluxCharacteristicEntity (eu.europa.ec.fisheries.ers.fa.entities.FluxCharacteristicEntity)2 BigDecimal (java.math.BigDecimal)2 ArrayList (java.util.ArrayList)2 Test (org.junit.Test)2 DelimitedPeriod (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.DelimitedPeriod)2 FLUXCharacteristic (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXCharacteristic)2 FishingTrip (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingTrip)2 IDType (un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)2 MeasureType (un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType)2 QuantityType (un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType)2 DelimitedPeriodEntity (eu.europa.ec.fisheries.ers.fa.entities.DelimitedPeriodEntity)1 FaCatchEntity (eu.europa.ec.fisheries.ers.fa.entities.FaCatchEntity)1 FishingActivityIdentifierEntity (eu.europa.ec.fisheries.ers.fa.entities.FishingActivityIdentifierEntity)1