Search in sources :

Example 6 with MeasureType

use of un.unece.uncefact.data.standard.unqualifieddatatype._18.MeasureType in project UVMS-ActivityModule-APP by UnionVMS.

the class ActivityEntityToModelMapper method mapValueMeasure.

private void mapValueMeasure(FLUXCharacteristic target, FluxCharacteristicEntity source) {
    if (ObjectUtils.allNotNull(target, source)) {
        Double valueMeasure = source.getValueMeasure();
        String valueMeasureUnitCode = source.getValueMeasureUnitCode();
        if (valueMeasure != null || StringUtils.isNotEmpty(valueMeasureUnitCode)) {
            MeasureType measureType = new MeasureType();
            if (valueMeasure != null) {
                measureType.setValue(new BigDecimal(valueMeasure));
            }
            if (StringUtils.isNotEmpty(valueMeasureUnitCode)) {
                measureType.setUnitCode(valueMeasureUnitCode);
            }
            target.setValueMeasure(measureType);
        }
    }
}
Also used : MeasureType(un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType) BigDecimal(java.math.BigDecimal)

Example 7 with MeasureType

use of un.unece.uncefact.data.standard.unqualifieddatatype._18.MeasureType in project UVMS-ActivityModule-APP by UnionVMS.

the class MapperUtil method getGearCharacteristics.

public static GearCharacteristic getGearCharacteristics() {
    CodeType typeCode = getCodeType("Code 1", "57t3yf-ght43yrf-ght56yru-ght7565h");
    List<TextType> descriptions = Arrays.asList(getTextType("This is sample text"));
    MeasureType valueMeasure = getMeasureType(123, "C62", "57t3yf-ght43yrf-ght56yru-ght7565h");
    DateTimeType valueDateTime = getDateTimeType("2016-07-01 11:15:00");
    IndicatorType valueIndicator = getIndicatorType(true, "Test value", "Test format");
    CodeType valueCode = getCodeType("Code type 1", "4fhry5-thfyr85-67thf-5htr84");
    TextType value = getTextType("This is sample Text");
    QuantityType valueQuantity = getQuantityType(123);
    List<FLUXLocation> specifiedFluxLocations = Arrays.asList(getFluxLocation());
    GearCharacteristic gearCharacteristic = new GearCharacteristic(typeCode, descriptions, valueMeasure, valueDateTime, valueIndicator, valueCode, value, valueQuantity, specifiedFluxLocations);
    return gearCharacteristic;
}
Also used : DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType) IndicatorType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IndicatorType) QuantityType(un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType) FLUXLocation(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) MeasureType(un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType) GearCharacteristic(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.GearCharacteristic) TextType(un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)

Example 8 with MeasureType

use of un.unece.uncefact.data.standard.unqualifieddatatype._18.MeasureType in project UVMS-ActivityModule-APP by UnionVMS.

the class MapperUtil method getMeasureType.

private static MeasureType getMeasureType(int value, String unitCode, String listId) {
    MeasureType measureType = new MeasureType();
    measureType.setValue(new BigDecimal(value));
    measureType.setUnitCode(unitCode);
    measureType.setUnitCodeListVersionID(listId);
    return measureType;
}
Also used : MeasureType(un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType) BigDecimal(java.math.BigDecimal)

Example 9 with MeasureType

use of un.unece.uncefact.data.standard.unqualifieddatatype._18.MeasureType in project UVMS-ActivityModule-APP by UnionVMS.

the class MapperUtil method getDelimitedPeriod.

public static DelimitedPeriod getDelimitedPeriod() {
    DateTimeType startDate = getDateTimeType("2011-07-01 11:15:00");
    DateTimeType endDate = getDateTimeType("2016-07-01 11:15:00");
    MeasureType measureType = getMeasureType(500, "C62", "4rhfy5-fhtydr-tyfr85-ghtyd54");
    DelimitedPeriod delimitedPeriod = new DelimitedPeriod(startDate, endDate, measureType);
    return delimitedPeriod;
}
Also used : DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType) DelimitedPeriod(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.DelimitedPeriod) MeasureType(un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType)

Example 10 with MeasureType

use of un.unece.uncefact.data.standard.unqualifieddatatype._18.MeasureType in project UVMS-ActivityModule-APP by UnionVMS.

the class MapperUtil method getAapProduct.

public static AAPProduct getAapProduct() {
    CodeType speciesCode = getCodeType("Species 1", "qbdcg-3fhr5-rd4kd5-er5tgd5k");
    QuantityType quantityType = getQuantityType(123);
    MeasureType measureType = getMeasureType(123, "C62", "qbdcg-3fhr5-rd4kd5-er5tgd5k");
    CodeType weighingMeansCode = getCodeType("Weighing Means 1", "qbd43cg-3fhr5t65-rd4kd5rt4-er5tgd5k");
    CodeType usageCode = getCodeType("Usage Code 1", "qbd43cg-3fhr5t65-rd4kd5rt4-er5tgd5k");
    QuantityType packagingUnitQuantity = getQuantityType(1234);
    CodeType packagingTypeCode = getCodeType("packaging type 1", "FISH_PACKAGING");
    MeasureType packagingUnitAverageWeightMeasure = getMeasureType(123, "C62", "qbdcg-3fhr5-rd4kd5-er5tgd5k");
    SalesPrice totalSalesPrice = getSalesPrice(getAmountType(123, "qbd43cg-3fhr5t65-rd4kd5rt4-er5tgd5k", "1"));
    SizeDistribution specifiedSizeDistribution = getSizeDistribution(getCodeType("catagory 1", "qbd43cg-3fhr5t65-rd4kd5rt4-er5tgd5k"), getCodeType("class code1", "qbd43cg-3fhr5t65-rd45674-er5tgd5k"));
    AAPProduct aapProduct = new AAPProduct(speciesCode, quantityType, measureType, weighingMeansCode, usageCode, packagingUnitQuantity, packagingTypeCode, packagingUnitAverageWeightMeasure, null, totalSalesPrice, specifiedSizeDistribution, null, null);
    return aapProduct;
}
Also used : SalesPrice(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.SalesPrice) QuantityType(un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType) SizeDistribution(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.SizeDistribution) AAPProduct(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPProduct) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) MeasureType(un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType)

Aggregations

MeasureType (un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType)9 CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)5 QuantityType (un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType)5 BigDecimal (java.math.BigDecimal)4 FLUXLocation (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation)4 DateTimeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType)4 FLUXCharacteristic (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXCharacteristic)3 DelimitedPeriod (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.DelimitedPeriod)2 FACatch (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FACatch)2 FLAPDocument (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLAPDocument)2 FishingGear (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear)2 FishingTrip (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingTrip)2 SizeDistribution (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.SizeDistribution)2 IndicatorType (un.unece.uncefact.data.standard.unqualifieddatatype._20.IndicatorType)2 MobileTerminalType (eu.europa.ec.fisheries.schema.mobileterminal.types.v1.MobileTerminalType)1 AbstractRestServiceTest (eu.europa.ec.fisheries.uvms.docker.validation.common.AbstractRestServiceTest)1 Asset (eu.europa.ec.fisheries.wsdl.asset.types.Asset)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 GregorianCalendar (java.util.GregorianCalendar)1