use of eu.europa.ec.fisheries.uvms.activity.model.schemas.VesselContactPartyType in project UVMS-ActivityModule-APP by UnionVMS.
the class FishingTripServiceBean method getFishingActivitySummaryList.
/**
* This method creates FishingActivitySummary object from FishingActivityEntity object retrieved from database.
*
* @param uniqueActivityIdList This method helps parent function to collect FishingActivities for all the fishingTrips. In order to avoid duplicate fishing Activities, we need to maintain uniqueActivityIdList
* @param fishingActivityEntityList
* @return
*/
public List<FishingActivitySummary> getFishingActivitySummaryList(List<FishingActivityEntity> fishingActivityEntityList, List<Integer> uniqueActivityIdList) {
List<FishingActivitySummary> fishingActivitySummaryList = new ArrayList<>();
if (CollectionUtils.isEmpty(uniqueActivityIdList)) {
uniqueActivityIdList = new ArrayList<>();
}
for (FishingActivityEntity fishingActivityEntity : fishingActivityEntityList) {
if (fishingActivityEntity != null && uniqueActivityIdList.add(fishingActivityEntity.getId())) {
FishingActivitySummary fishingActivitySummary = FishingActivityMapper.INSTANCE.mapToFishingActivitySummary(fishingActivityEntity);
ContactPartyEntity contactParty = getContactParty(fishingActivityEntity);
if (contactParty != null) {
VesselContactPartyType vesselContactParty = FishingActivityMapper.INSTANCE.mapToVesselContactParty(contactParty);
fishingActivitySummary.setVesselContactParty(vesselContactParty);
}
if (fishingActivitySummary != null) {
fishingActivitySummaryList.add(fishingActivitySummary);
}
}
}
return fishingActivitySummaryList;
}
use of eu.europa.ec.fisheries.uvms.activity.model.schemas.VesselContactPartyType in project UVMS-ActivityModule-APP by UnionVMS.
the class FishingTripIdSearchBuilder method getFishingActivitySummary.
private FishingActivitySummary getFishingActivitySummary(Set<Integer> uniqueFishingActivityIdList, FishingTripEntity entity) {
FishingActivitySummary fishingActivitySummary = null;
FishingActivityEntity fishingActivityEntity = entity.getFishingActivity();
if (fishingActivityEntity != null && uniqueFishingActivityIdList.add(fishingActivityEntity.getId())) {
fishingActivitySummary = FishingActivityMapper.INSTANCE.mapToFishingActivitySummary(entity.getFishingActivity());
ContactPartyEntity contactParty = getContactParty(fishingActivityEntity);
if (contactParty != null) {
VesselContactPartyType vesselContactParty = FishingActivityMapper.INSTANCE.mapToVesselContactParty(contactParty);
fishingActivitySummary.setVesselContactParty(vesselContactParty);
}
}
return fishingActivitySummary;
}
Aggregations