Search in sources :

Example 6 with FAReportDocument

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

the class ActivityEntityToModelMapper method mapAcceptanceDateTime.

private void mapAcceptanceDateTime(FAReportDocument target, Date source) {
    if (ObjectUtils.allNotNull(target, source)) {
        DateTimeType dateTimeType = new DateTimeType();
        dateTimeType.setDateTime(DateUtils.dateToXmlGregorian(source));
        target.setAcceptanceDateTime(dateTimeType);
    }
}
Also used : DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType)

Example 7 with FAReportDocument

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

the class ActivityEntityToModelMapper method mapRelatedReportIDs.

private void mapRelatedReportIDs(FAReportDocument target, Set<FaReportIdentifierEntity> faReportIdentifiers) {
    if (CollectionUtils.isNotEmpty(faReportIdentifiers)) {
        List<IDType> idTypeList = new ArrayList<>();
        for (FaReportIdentifierEntity source : faReportIdentifiers) {
            IDType idType = new IDType();
            String faReportIdentifierId = source.getFaReportIdentifierId();
            String faReportIdentifierSchemeId = source.getFaReportIdentifierSchemeId();
            idType.setSchemeID(faReportIdentifierSchemeId);
            idType.setValue(faReportIdentifierId);
            idTypeList.add(idType);
        }
        target.setRelatedReportIDs(idTypeList);
    }
}
Also used : ArrayList(java.util.ArrayList) FaReportIdentifierEntity(eu.europa.ec.fisheries.ers.fa.entities.FaReportIdentifierEntity) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)

Example 8 with FAReportDocument

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

the class ActivityEntityToModelMapper method mapFMCMarkerCode.

private void mapFMCMarkerCode(FAReportDocument target, String fmcMarkerValue, String fmcMarkerListId) {
    if (ObjectUtils.allNotNull(target) && (StringUtils.isNotEmpty(fmcMarkerValue) || StringUtils.isNotEmpty(fmcMarkerListId))) {
        CodeType codeType = new CodeType();
        if (StringUtils.isNotEmpty(fmcMarkerValue)) {
            codeType.setValue(fmcMarkerValue);
        }
        if (StringUtils.isNotEmpty(fmcMarkerListId)) {
            codeType.setListID(fmcMarkerListId);
        }
        target.setFMCMarkerCode(codeType);
    }
}
Also used : CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)

Example 9 with FAReportDocument

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

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

the class ActivityEntityToModelMapper method mapFAReportDocuments.

private void mapFAReportDocuments(FLUXFAReportMessage target, List<FaReportDocumentEntity> faReportDocuments) {
    List<FAReportDocument> faReportDocumentList = new ArrayList<>();
    for (FaReportDocumentEntity faReportDocumentEntity : faReportDocuments) {
        FAReportDocument faReportDocument = new FAReportDocument();
        mapFAReportDocument(faReportDocument, faReportDocumentEntity);
        faReportDocumentList.add(faReportDocument);
    }
    target.setFAReportDocuments(faReportDocumentList);
}
Also used : FaReportDocumentEntity(eu.europa.ec.fisheries.ers.fa.entities.FaReportDocumentEntity) ArrayList(java.util.ArrayList) FAReportDocument(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAReportDocument)

Aggregations

FAReportDocument (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAReportDocument)9 ArrayList (java.util.ArrayList)5 FaReportDocumentEntity (eu.europa.ec.fisheries.ers.fa.entities.FaReportDocumentEntity)4 IDType (un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)4 FLUXReportDocument (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXReportDocument)3 CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)3 FaReportIdentifierEntity (eu.europa.ec.fisheries.ers.fa.entities.FaReportIdentifierEntity)2 FishingActivityEntity (eu.europa.ec.fisheries.ers.fa.entities.FishingActivityEntity)2 ActivityUniquinessList (eu.europa.ec.fisheries.uvms.activity.model.schemas.ActivityUniquinessList)2 FishingActivity (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity)2 VesselTransportMeans (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselTransportMeans)2 DateTimeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType)2 VesselTransportMeansEntity (eu.europa.ec.fisheries.ers.fa.entities.VesselTransportMeansEntity)1 FaReportStatusType (eu.europa.ec.fisheries.ers.fa.utils.FaReportStatusType)1 ActivityModelMarshallException (eu.europa.ec.fisheries.uvms.activity.model.exception.ActivityModelMarshallException)1 ActivityIDType (eu.europa.ec.fisheries.uvms.activity.model.schemas.ActivityIDType)1 ActivityTableType (eu.europa.ec.fisheries.uvms.activity.model.schemas.ActivityTableType)1 GetNonUniqueIdsRequest (eu.europa.ec.fisheries.uvms.activity.model.schemas.GetNonUniqueIdsRequest)1 GetNonUniqueIdsResponse (eu.europa.ec.fisheries.uvms.activity.model.schemas.GetNonUniqueIdsResponse)1 EnumMap (java.util.EnumMap)1