Search in sources :

Example 6 with FLUXReportDocument

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

the class ActivityEventServiceBean method collectAllIdsFromMessage.

private Map<ActivityTableType, List<IDType>> collectAllIdsFromMessage(FLUXFAReportMessage faRepMessage) {
    Map<ActivityTableType, List<IDType>> idsmap = new EnumMap<>(ActivityTableType.class);
    idsmap.put(ActivityTableType.RELATED_FLUX_REPORT_DOCUMENT_ENTITY, new ArrayList<IDType>());
    if (faRepMessage == null) {
        return idsmap;
    }
    List<FAReportDocument> faReportDocuments = faRepMessage.getFAReportDocuments();
    if (CollectionUtils.isNotEmpty(faReportDocuments)) {
        for (FAReportDocument faRepDoc : faReportDocuments) {
            FLUXReportDocument relatedFLUXReportDocument = faRepDoc.getRelatedFLUXReportDocument();
            if (relatedFLUXReportDocument != null) {
                List<IDType> idTypes = new ArrayList<>();
                idTypes.addAll(relatedFLUXReportDocument.getIDS());
                idTypes.add(relatedFLUXReportDocument.getReferencedID());
                idTypes.removeAll(Collections.singletonList(null));
                idsmap.get(ActivityTableType.RELATED_FLUX_REPORT_DOCUMENT_ENTITY).addAll(idTypes);
            }
        }
    }
    return idsmap;
}
Also used : FLUXReportDocument(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXReportDocument) ArrayList(java.util.ArrayList) ActivityTableType(eu.europa.ec.fisheries.uvms.activity.model.schemas.ActivityTableType) ActivityUniquinessList(eu.europa.ec.fisheries.uvms.activity.model.schemas.ActivityUniquinessList) List(java.util.List) ArrayList(java.util.ArrayList) EnumMap(java.util.EnumMap) ActivityIDType(eu.europa.ec.fisheries.uvms.activity.model.schemas.ActivityIDType) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType) FAReportDocument(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAReportDocument)

Example 7 with FLUXReportDocument

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

the class MapperUtil method getFluxReportDocument.

public static FLUXReportDocument getFluxReportDocument() {
    List<IDType> ids = Arrays.asList(getIdType("flux_report_doc_1", "fhty58-gh586t-5tjf8-t58rjewe"));
    IDType referencedID = getIdType("Ref ID 1", "fhty58-gh586t-5tjf8-t58rjewe");
    DateTimeType creationDateTime = getDateTimeType("2016-07-01 11:15:00");
    CodeType purposeCode = getCodeType("5", "FLUX_GP_PURPOSE");
    final TextType purpose = getTextType("Purpose Text");
    CodeType typeCode = getCodeType("FluxReportTypeCode", "fhty58-gh586t-5tjf8-t58rjewe");
    FLUXParty ownerFLUXParty = new FLUXParty(Arrays.asList(getIdType("Owner flux party id 1", "58fjrut-tjfuri-586jte-5jfur")), Arrays.asList(getTextType("This is sample text for owner flux party")));
    FLUXReportDocument fluxReportDocument = new FLUXReportDocument(ids, referencedID, creationDateTime, purposeCode, purpose, typeCode, ownerFLUXParty);
    return fluxReportDocument;
}
Also used : FLUXReportDocument(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXReportDocument) DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType) FLUXParty(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXParty) TextType(un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)

Example 8 with FLUXReportDocument

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

the class MapperUtil method getFaReportDocument.

public static FAReportDocument getFaReportDocument() {
    CodeType typeCode = getCodeType("DECLARATION", "FLUX_FA_REPORT_TYPE");
    CodeType fmcMarkerCode = getCodeType("Fmz marker 1", "h49rh-fhrus33-fj84hjs82-4h84hw82");
    List<IDType> relatedReportIDs = Arrays.asList(getIdType("ID 1", "47rfh-5hry4-thfur75-4hf743"));
    DateTimeType acceptanceDateTime = getDateTimeType("2016-07-01 11:15:00");
    FLUXReportDocument relatedFLUXReportDocument = getFluxReportDocument();
    List<FishingActivity> specifiedFishingActivities = Arrays.asList(getFishingActivity());
    VesselTransportMeans specifiedVesselTransportMeans = getVesselTransportMeans();
    FAReportDocument faReportDocument = new FAReportDocument(typeCode, fmcMarkerCode, relatedReportIDs, acceptanceDateTime, relatedFLUXReportDocument, specifiedFishingActivities, specifiedVesselTransportMeans);
    return faReportDocument;
}
Also used : FLUXReportDocument(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXReportDocument) FishingActivity(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity) DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType) FAReportDocument(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAReportDocument) VesselTransportMeans(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselTransportMeans)

Aggregations

FLUXReportDocument (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXReportDocument)7 IDType (un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)6 CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)4 DateTimeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType)4 FAReportDocument (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAReportDocument)3 FLUXParty (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXParty)3 TextType (un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)3 FluxReportDocumentEntity (eu.europa.ec.fisheries.ers.fa.entities.FluxReportDocumentEntity)2 FluxPartyEntity (eu.europa.ec.fisheries.ers.fa.entities.FluxPartyEntity)1 FluxReportIdentifierEntity (eu.europa.ec.fisheries.ers.fa.entities.FluxReportIdentifierEntity)1 ActivityIDType (eu.europa.ec.fisheries.uvms.activity.model.schemas.ActivityIDType)1 ActivityTableType (eu.europa.ec.fisheries.uvms.activity.model.schemas.ActivityTableType)1 ActivityUniquinessList (eu.europa.ec.fisheries.uvms.activity.model.schemas.ActivityUniquinessList)1 ArrayList (java.util.ArrayList)1 EnumMap (java.util.EnumMap)1 HashSet (java.util.HashSet)1 List (java.util.List)1 SneakyThrows (lombok.SneakyThrows)1 Test (org.junit.Test)1 FLUXFAReportMessage (un.unece.uncefact.data.standard.fluxfareportmessage._3.FLUXFAReportMessage)1