Search in sources :

Example 1 with FishingTrip

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

the class MapperUtil method getStandardFishingActivity.

private static FishingActivity getStandardFishingActivity() {
    List<IDType> ids = Arrays.asList(getIdType("Id_1", "fhr574fh-thrud754-kgitjf754-gjtufe89"));
    CodeType typeCode = getCodeType("FISHING_OPERATION", "FLUX_FA_TYPE");
    DateTimeType occurrenceDateTime = getDateTimeType("2016-07-01 11:15:00");
    CodeType reasonCode = getCodeType("Reason_code_1", "FA_REASON_DEPARTURE");
    CodeType vesselRelatedActivityCode = getCodeType("Vessel activity 1", "58thft-58fjd8-gt85eje-hjgute8");
    CodeType fisheryTypeCode = getCodeType("Fishing_Type_code 1", "FA_FISHERY");
    CodeType speciesTargetCode = getCodeType("Species code 1", "FAO_SPECIES");
    QuantityType operationsQuantity = getQuantityType(100);
    MeasureType fishingDurationMeasure = getMeasureType(500, "C62", "4hr2yf0-t583thf-6jgttue8-6jtie844");
    List<FLAPDocument> specifiedFLAPDocument = Arrays.asList(getFlapDocument());
    VesselStorageCharacteristic sourceVesselStorageCharacteristic = getVesselStorageCharacteristic();
    VesselStorageCharacteristic destinationVesselStorageCharacteristic = getVesselStorageCharacteristic();
    List<FACatch> specifiedFACatches = Arrays.asList(getFaCatch());
    List<FLUXLocation> relatedFLUXLocations = Arrays.asList(getFluxLocation());
    List<GearProblem> specifiedGearProblems = Arrays.asList(getGearProblem());
    List<FLUXCharacteristic> specifiedFLUXCharacteristics = Arrays.asList(getFluxCharacteristics());
    List<FishingGear> specifiedFishingGears = Arrays.asList(getFishingGear());
    List<DelimitedPeriod> specifiedDelimitedPeriods = Arrays.asList(getDelimitedPeriod());
    FishingTrip specifiedFishingTrip = getFishingTrip();
    List<VesselTransportMeans> relatedVesselTransportMeans = Arrays.asList(getVesselTransportMeans());
    FishingActivity fishingActivity = new FishingActivity(ids, typeCode, occurrenceDateTime, reasonCode, vesselRelatedActivityCode, fisheryTypeCode, speciesTargetCode, operationsQuantity, fishingDurationMeasure, specifiedFACatches, relatedFLUXLocations, specifiedGearProblems, specifiedFLUXCharacteristics, specifiedFishingGears, sourceVesselStorageCharacteristic, destinationVesselStorageCharacteristic, null, specifiedFLAPDocument, specifiedDelimitedPeriods, specifiedFishingTrip, relatedVesselTransportMeans);
    return fishingActivity;
}
Also used : DelimitedPeriod(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.DelimitedPeriod) FLAPDocument(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLAPDocument) FishingGear(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear) MeasureType(un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType) GearProblem(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.GearProblem) FishingActivity(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity) VesselStorageCharacteristic(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselStorageCharacteristic) FLUXCharacteristic(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXCharacteristic) VesselTransportMeans(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselTransportMeans) DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType) QuantityType(un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType) FLUXLocation(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation) FishingTrip(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingTrip) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) FACatch(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FACatch)

Example 2 with FishingTrip

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

the class MapperUtil method getFishingTrip.

public static FishingTrip getFishingTrip() {
    List<IDType> ids = Arrays.asList(getIdType("ID 1", "fhty58-gh586t-5tjf8-t58rjewe"));
    CodeType typeCode = getCodeType("Code Type 1", "57t3yf-ght43yrf-ght56yru-ght7565h");
    List<DelimitedPeriod> specifiedDelimitedPeriods = Arrays.asList(getDelimitedPeriod());
    FishingTrip fishingTrip = new FishingTrip(ids, typeCode, specifiedDelimitedPeriods);
    return fishingTrip;
}
Also used : DelimitedPeriod(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.DelimitedPeriod) FishingTrip(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingTrip) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)

Example 3 with FishingTrip

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

the class FishingTripMapperTest method getFishingTripWithFACatch.

@Test
public void getFishingTripWithFACatch() {
    FishingTrip fishingTrip = MapperUtil.getFishingTrip();
    FishingTripEntity fishingTripEntity = FishingTripMapper.INSTANCE.mapToFishingTripEntity(fishingTrip);
    assertEquals(fishingTrip.getTypeCode().getValue(), fishingTripEntity.getTypeCode());
    assertEquals(fishingTrip.getTypeCode().getListID(), fishingTripEntity.getTypeCodeListId());
    assertNull(fishingTripEntity.getFaCatch());
    assertNotNull(fishingTripEntity.getDelimitedPeriods());
    assertNotNull(fishingTripEntity.getFishingTripIdentifiers());
}
Also used : FishingTripEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingTripEntity) FishingTrip(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingTrip) Test(org.junit.Test)

Example 4 with FishingTrip

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingTrip 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 5 with FishingTrip

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

the class BaseMapper method mapToFishingTripEntity.

private static FishingTripEntity mapToFishingTripEntity(FishingTrip fishingTrip) {
    FishingTripEntity fishingTripEntity = FishingTripMapper.INSTANCE.mapToFishingTripEntity(fishingTrip);
    List<IDType> ids = fishingTrip.getIDS();
    if (CollectionUtils.isNotEmpty(ids)) {
        for (IDType idType : ids) {
            fishingTripEntity.addFishingTripIdentifiers(FishingTripIdentifierMapper.INSTANCE.mapToFishingTripIdentifier(idType));
        }
    }
    List<DelimitedPeriod> specifiedDelimitedPeriods = fishingTrip.getSpecifiedDelimitedPeriods();
    if (CollectionUtils.isNotEmpty(specifiedDelimitedPeriods)) {
        for (DelimitedPeriod delimitedPeriod : specifiedDelimitedPeriods) {
            fishingTripEntity.addDelimitedPeriods(DelimitedPeriodMapper.INSTANCE.mapToDelimitedPeriodEntity(delimitedPeriod));
        }
    }
    return fishingTripEntity;
}
Also used : FishingTripEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingTripEntity) DelimitedPeriod(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.DelimitedPeriod) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)

Aggregations

FishingTrip (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingTrip)7 FishingTripEntity (eu.europa.ec.fisheries.ers.fa.entities.FishingTripEntity)4 DelimitedPeriod (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.DelimitedPeriod)3 CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)3 IDType (un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)3 Test (org.junit.Test)2 FACatch (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FACatch)2 FLUXCharacteristic (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXCharacteristic)2 FLUXLocation (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation)2 FishingActivity (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity)2 FishingGear (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear)2 MeasureType (un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType)2 QuantityType (un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType)2 Sets.newHashSet (com.google.common.collect.Sets.newHashSet)1 FishingActivityEntity (eu.europa.ec.fisheries.ers.fa.entities.FishingActivityEntity)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 AAPProcess (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPProcess)1 AAPStock (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPStock)1 FLAPDocument (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLAPDocument)1