Search in sources :

Example 1 with FishingActivityWithIdentifiers

use of eu.europa.ec.fisheries.uvms.activity.model.schemas.FishingActivityWithIdentifiers in project UVMS-ActivityModule-APP by UnionVMS.

the class ActivityServiceBean method addToIdsList.

private void addToIdsList(List<FaIdsListWithTripIdMap> responseList, FishingActivityEntity faEntity) {
    Set<FishingTripIdentifierEntity> fishingTripIdentifiers = faEntity.getFishingTrips().iterator().next().getFishingTripIdentifiers();
    List<FishingActivityWithIdentifiers> faIdentifiers = mapToActivityIdsAndType(faEntity.getFishingActivityIdentifiers(), faEntity.getTypeCode());
    for (FishingTripIdentifierEntity tripIdentifEntity : fishingTripIdentifiers) {
        FaIdsListWithTripIdMap existingActWithIdentifiers = getElementWithTripId(responseList, tripIdentifEntity.getTripId());
        if (null != existingActWithIdentifiers) {
            existingActWithIdentifiers.getFaIdentifierLists().addAll(faIdentifiers);
        } else {
            responseList.add(new FaIdsListWithTripIdMap(tripIdentifEntity.getTripId(), tripIdentifEntity.getTripSchemeId(), faIdentifiers));
        }
    }
}
Also used : FaIdsListWithTripIdMap(eu.europa.ec.fisheries.uvms.activity.model.schemas.FaIdsListWithTripIdMap) FishingTripIdentifierEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingTripIdentifierEntity) FishingActivityWithIdentifiers(eu.europa.ec.fisheries.uvms.activity.model.schemas.FishingActivityWithIdentifiers)

Aggregations

FishingTripIdentifierEntity (eu.europa.ec.fisheries.ers.fa.entities.FishingTripIdentifierEntity)1 FaIdsListWithTripIdMap (eu.europa.ec.fisheries.uvms.activity.model.schemas.FaIdsListWithTripIdMap)1 FishingActivityWithIdentifiers (eu.europa.ec.fisheries.uvms.activity.model.schemas.FishingActivityWithIdentifiers)1