Search in sources :

Example 6 with FishingActivity

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

the class ActivityEntityToModelMapper method mapReasonCode.

private void mapReasonCode(FishingActivity target, FishingActivityEntity source) {
    if (ObjectUtils.allNotNull(target, target)) {
        CodeType codeType = new CodeType();
        codeType.setValue(source.getReasonCode());
        codeType.setListID(source.getReasonCodeListId());
        target.setReasonCode(codeType);
    }
}
Also used : CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)

Example 7 with FishingActivity

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

the class ActivityEntityToModelMapper method mapOperationsQuantity.

private void mapOperationsQuantity(FishingActivity target, FishingActivityEntity source) {
    if (ObjectUtils.allNotNull(target, target)) {
        QuantityType quantityType = new QuantityType();
        if (source.getOperationsQuantity() != null) {
            Double operationQuantity = source.getOperationsQuantity().getValue();
            if (operationQuantity != null) {
                quantityType.setValue(new BigDecimal(operationQuantity));
            }
            String unitCode = source.getOperationsQuantity().getUnitCode();
            if (StringUtils.isNotEmpty(unitCode)) {
                quantityType.setUnitCode(unitCode);
            }
            String unitCodeListID = source.getOperationsQuantity().getUnitCodeListID();
            if (StringUtils.isNotEmpty(unitCodeListID)) {
                quantityType.setUnitCodeListID(unitCodeListID);
            }
            target.setOperationsQuantity(quantityType);
        }
    }
}
Also used : QuantityType(un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType) BigDecimal(java.math.BigDecimal)

Example 8 with FishingActivity

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

the class ActivityEntityToModelMapper method mapSpeciesTargetCode.

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

Example 9 with FishingActivity

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

the class ActivityEntityToModelMapper method mapFishingDurationMeasure.

private void mapFishingDurationMeasure(FishingActivity target, FishingActivityEntity source) {
    if (ObjectUtils.allNotNull(target, source)) {
        MeasureType measureType = new MeasureType();
        Double fishingDurationMeasure = source.getFishingDurationMeasure();
        if (fishingDurationMeasure != null) {
            measureType.setValue(new BigDecimal(fishingDurationMeasure));
        }
        if (StringUtils.isNotEmpty(source.getFishingDurationMeasureCode())) {
            measureType.setUnitCode(source.getFishingDurationMeasureCode());
        }
        if (StringUtils.isNotEmpty(source.getFishingDurationMeasureUnitCodeListVersionID())) {
            measureType.setUnitCodeListVersionID(source.getFishingDurationMeasureUnitCodeListVersionID());
        }
        target.setFishingDurationMeasure(measureType);
    }
}
Also used : MeasureType(un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType) BigDecimal(java.math.BigDecimal)

Example 10 with FishingActivity

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

the class ActivityEntityToModelMapper method mapPurposeCode.

private void mapPurposeCode(FishingActivity target, FishingActivityEntity source) {
    if (ObjectUtils.allNotNull(target, source)) {
        CodeType codeType = new CodeType();
        codeType.setValue(source.getTypeCode());
        codeType.setListID(source.getTypeCodeListid());
        target.setTypeCode(codeType);
    }
}
Also used : CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)

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