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;
}
Aggregations