use of eu.europa.ec.fisheries.ers.service.dto.view.IdentifierDto in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityTranshipmentViewMapper method populateActivityDetails.
protected ActivityDetailsDto populateActivityDetails(FishingActivityEntity faEntity, ActivityDetailsDto activityDetails) {
Map<String, String> idMap = new HashMap<>();
for (FishingActivityIdentifierEntity idEntity : faEntity.getFishingActivityIdentifiers()) {
idMap.put(idEntity.getFaIdentifierId(), idEntity.getFaIdentifierSchemeId());
}
Set<IdentifierDto> identifierDtos = FishingActivityIdentifierMapper.INSTANCE.mapToIdentifierDTOSet(faEntity.getFishingActivityIdentifiers());
activityDetails.setIdentifiers(identifierDtos);
Set<DelimitedPeriodEntity> delimitedPeriodEntitySet = faEntity.getDelimitedPeriods();
if (!Collections.isEmpty(delimitedPeriodEntitySet)) {
DelimitedPeriodEntity delimitedPeriod = delimitedPeriodEntitySet.iterator().next();
DelimitedPeriodDTO delimitedPeriodDTO = DelimitedPeriodMapper.INSTANCE.mapToDelimitedPeriodDTO(delimitedPeriod);
activityDetails.setTranshipmentTime(delimitedPeriodDTO);
// Override occurrence date from delimited period
activityDetails.setOccurrence(delimitedPeriod.getStartDate());
}
return activityDetails;
}
Aggregations