Search in sources :

Example 1 with AAPProcess

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

the class MapperUtil method getAapProcess.

public static AAPProcess getAapProcess() {
    List<CodeType> codeList = Arrays.asList(getCodeType("FISH_FRESHNESS", "FLUX_PROCESS_TYPE"));
    NumericType numericType = getNumericType(123);
    return new AAPProcess(codeList, numericType, null, Arrays.asList(getAapProduct()));
}
Also used : NumericType(un.unece.uncefact.data.standard.unqualifieddatatype._20.NumericType) AAPProcess(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPProcess) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)

Example 2 with AAPProcess

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

the class AapProductMapperTest method testMapToProcessingProduct.

@Test
public void testMapToProcessingProduct() {
    // Prepare
    FACatch faCatch = MapperUtil.getFaCatch();
    FaCatchEntity faCatchEntity = new FaCatchEntity();
    FaCatchMapper.INSTANCE.mapToFaCatchEntity(faCatch);
    AAPProcess aapProcess = MapperUtil.getAapProcess();
    AapProcessEntity aapProcessEntity = AapProcessMapper.INSTANCE.mapToAapProcessEntity(aapProcess);
    aapProcessEntity.setFaCatch(faCatchEntity);
    AAPProduct aapProduct = MapperUtil.getAapProduct();
    AapProductEntity aapProductEntity = AapProductMapper.INSTANCE.mapToAapProductEntity(aapProduct);
    aapProductEntity.setAapProcess(aapProcessEntity);
    // Create Input data
    ProcessingProductsDto processingProductsDto = AapProductMapper.INSTANCE.mapToProcessingProduct(aapProductEntity);
    assertEquals(processingProductsDto.getType(), faCatchEntity.getTypeCode());
    assertEquals(processingProductsDto.getGear(), faCatchEntity.getGearTypeCode());
    assertEquals(processingProductsDto.getSpecies(), faCatchEntity.getSpeciesCode());
    assertNull(processingProductsDto.getPreservation());
    assertNull(processingProductsDto.getPresentation());
    assertNull(processingProductsDto.getFreshness());
    assertEquals(processingProductsDto.getConversionFactor(), aapProcessEntity.getConversionFactor().doubleValue());
    assertEquals(processingProductsDto.getWeight(), aapProductEntity.getCalculatedWeightMeasure());
    assertEquals(processingProductsDto.getQuantity(), aapProductEntity.getUnitQuantity());
    assertEquals(processingProductsDto.getPackageWeight(), aapProductEntity.getPackagingUnitAvarageWeight());
    assertEquals(processingProductsDto.getPackageQuantity().doubleValue(), aapProductEntity.getPackagingUnitCount().doubleValue());
    assertEquals(processingProductsDto.getPackagingType(), aapProductEntity.getPackagingTypeCode());
}
Also used : FaCatchEntity(eu.europa.ec.fisheries.ers.fa.entities.FaCatchEntity) AAPProduct(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPProduct) AAPProcess(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPProcess) ProcessingProductsDto(eu.europa.ec.fisheries.ers.service.dto.view.ProcessingProductsDto) AapProcessEntity(eu.europa.ec.fisheries.ers.fa.entities.AapProcessEntity) FACatch(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FACatch) AapProductEntity(eu.europa.ec.fisheries.ers.fa.entities.AapProductEntity) Test(org.junit.Test)

Example 3 with AAPProcess

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

the class FaCatchMapper method getAapProcessEntities.

protected Set<AapProcessEntity> getAapProcessEntities(List<AAPProcess> aapProcesses, FaCatchEntity faCatchEntity) {
    if (aapProcesses == null || aapProcesses.isEmpty()) {
        return Collections.emptySet();
    }
    Set<AapProcessEntity> aapProcessEntities = new HashSet<>();
    for (AAPProcess aapProcess : aapProcesses) {
        AapProcessEntity aapProcessEntity = AapProcessMapper.INSTANCE.mapToAapProcessEntity(aapProcess);
        aapProcessEntity.setFaCatch(faCatchEntity);
        aapProcessEntities.add(aapProcessEntity);
    }
    return aapProcessEntities;
}
Also used : AAPProcess(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPProcess) AapProcessEntity(eu.europa.ec.fisheries.ers.fa.entities.AapProcessEntity) HashSet(java.util.HashSet)

Example 4 with AAPProcess

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

the class AapProcessMapperTest method testAapProcessMapper.

@Test
public void testAapProcessMapper() {
    AAPProcess aapProcess = MapperUtil.getAapProcess();
    AapProcessEntity aapProcessEntity = AapProcessMapper.INSTANCE.mapToAapProcessEntity(aapProcess);
    AapProcessCodeEntity entity = aapProcessEntity.getAapProcessCode().iterator().next();
    assertEquals(aapProcess.getTypeCodes().get(0).getValue(), entity.getTypeCode());
    assertEquals(aapProcess.getTypeCodes().get(0).getListID(), entity.getTypeCodeListId());
    assertEquals(aapProcess.getConversionFactorNumeric().getValue().intValue(), aapProcessEntity.getConversionFactor().intValue());
    assertNull(aapProcessEntity.getFaCatch());
    assertNotNull(aapProcessEntity.getAapProducts());
    AapProductEntity aapProductEntity = aapProcessEntity.getAapProducts().iterator().next();
    assertNotNull(aapProductEntity);
    aapProductEntity.getAapProcess().getAapProcessCode().iterator().next();
    assertEquals(aapProcess.getTypeCodes().get(0).getValue(), entity.getTypeCode());
}
Also used : AAPProcess(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPProcess) AapProcessCodeEntity(eu.europa.ec.fisheries.ers.fa.entities.AapProcessCodeEntity) AapProcessEntity(eu.europa.ec.fisheries.ers.fa.entities.AapProcessEntity) AapProductEntity(eu.europa.ec.fisheries.ers.fa.entities.AapProductEntity) Test(org.junit.Test)

Example 5 with AAPProcess

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

the class MapperUtil method getFaCatch.

public static FACatch getFaCatch() {
    CodeType speciesCode = getCodeType("ONBOARD", "FAO_SPECIES");
    QuantityType unitQuantity = getQuantityType(100);
    MeasureType weightMeasure = getMeasureType(123, "C62", "586jhg-5htuf95-5jfit-5jtier8");
    CodeType weighingMeansCode = getCodeType("Weighing means code 1", "5854tt5-gjtdir-5j85tui-589git");
    CodeType usageCode = getCodeType("Usage code 1", "58thft-58fjd8-gt85eje-hjgute8");
    CodeType typeCode = getCodeType("Type code 1", "FA_CATCH_TYPE");
    final List<FishingTrip> relatedFishingTrips = Arrays.asList(getFishingTrip());
    SizeDistribution specifiedSizeDistribution = getSizeDistribution();
    List<AAPStock> relatedAAPStocks = Arrays.asList(getAapStock());
    List<AAPProcess> appliedAAPProcesses = Arrays.asList(getAapProcess());
    List<SalesBatch> relatedSalesBatches = null;
    List<FLUXLocation> specifiedFLUXLocations = Arrays.asList(getFluxLocation());
    List<FishingGear> usedFishingGears = Arrays.asList(getFishingGear());
    List<FLUXCharacteristic> applicableFLUXCharacteristics = Arrays.asList(getFluxCharacteristics());
    List<FLUXLocation> destinationFLUXLocations = Arrays.asList(getFluxLocation());
    FACatch faCatch = new FACatch(speciesCode, unitQuantity, weightMeasure, weighingMeansCode, usageCode, typeCode, relatedFishingTrips, specifiedSizeDistribution, relatedAAPStocks, appliedAAPProcesses, relatedSalesBatches, specifiedFLUXLocations, usedFishingGears, applicableFLUXCharacteristics, destinationFLUXLocations);
    return faCatch;
}
Also used : SizeDistribution(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.SizeDistribution) FishingGear(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear) MeasureType(un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType) AAPStock(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPStock) FLUXCharacteristic(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXCharacteristic) SalesBatch(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.SalesBatch) QuantityType(un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType) FLUXLocation(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation) AAPProcess(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPProcess) 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)

Aggregations

AAPProcess (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPProcess)5 AapProcessEntity (eu.europa.ec.fisheries.ers.fa.entities.AapProcessEntity)3 AapProductEntity (eu.europa.ec.fisheries.ers.fa.entities.AapProductEntity)2 Test (org.junit.Test)2 FACatch (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FACatch)2 CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)2 AapProcessCodeEntity (eu.europa.ec.fisheries.ers.fa.entities.AapProcessCodeEntity)1 FaCatchEntity (eu.europa.ec.fisheries.ers.fa.entities.FaCatchEntity)1 ProcessingProductsDto (eu.europa.ec.fisheries.ers.service.dto.view.ProcessingProductsDto)1 HashSet (java.util.HashSet)1 AAPProduct (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPProduct)1 AAPStock (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPStock)1 FLUXCharacteristic (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXCharacteristic)1 FLUXLocation (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation)1 FishingGear (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear)1 FishingTrip (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingTrip)1 SalesBatch (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.SalesBatch)1 SizeDistribution (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.SizeDistribution)1 MeasureType (un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType)1 NumericType (un.unece.uncefact.data.standard.unqualifieddatatype._20.NumericType)1