use of eu.europa.ec.fisheries.ers.fa.utils.FishingActivityTypeEnum in project UVMS-ActivityModule-APP by UnionVMS.
the class CatchEvolutionProgressProcessor method process.
public List<CatchEvolutionProgressDTO> process(List<FishingActivityEntity> fishingActivities) {
Map<String, Double> speciesCumulatedWeight = new HashMap<>();
List<CatchEvolutionProgressDTO> catchEvolutionProgressDTOs = new ArrayList<>();
Collections.sort(fishingActivities, new FishingActivityCalculatedDateComparator());
int orderId = 1;
for (FishingActivityEntity fishingActivity : fishingActivities) {
FishingActivityTypeEnum fishingActivityType = EnumUtils.getEnum(FishingActivityTypeEnum.class, fishingActivity.getTypeCode());
if (fishingActivityType != null && catchEvolutionProgressRegistry != null && catchEvolutionProgressRegistry.containsHandler(fishingActivityType)) {
CatchEvolutionProgressHandler catchEvolutionProgressHandler = catchEvolutionProgressRegistry.findHandler(fishingActivityType);
CatchEvolutionProgressDTO catchEvolutionProgressDTO = catchEvolutionProgressHandler.prepareCatchEvolutionProgressDTO(fishingActivity, speciesCumulatedWeight);
if (catchEvolutionProgressDTO != null) {
catchEvolutionProgressDTO.setOrderId(orderId++);
catchEvolutionProgressDTOs.add(catchEvolutionProgressDTO);
}
}
}
return catchEvolutionProgressDTOs;
}
Aggregations