Search in sources :

Example 1 with ActivityTableType

use of eu.europa.ec.fisheries.uvms.activity.model.schemas.ActivityTableType 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)

Aggregations

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 List (java.util.List)1 FAReportDocument (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAReportDocument)1 FLUXReportDocument (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXReportDocument)1 IDType (un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)1