use of eu.europa.ec.fisheries.ers.fa.entities.FishingActivityEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class FaReportDocumentMapperTest method testFaReportDocumentMapperNullReturns.
@Test
public void testFaReportDocumentMapperNullReturns() {
Set<FishingActivityEntity> fishingActivityEntities = FaReportDocumentMapper.INSTANCE.getFishingActivityEntities(null, new FaReportDocumentEntity());
assertTrue(fishingActivityEntities.size() == 0);
Set<VesselTransportMeansEntity> vesselTransportMeansEntityList = FaReportDocumentMapper.INSTANCE.getVesselTransportMeansEntity(null, new FaReportDocumentEntity());
assertNull(vesselTransportMeansEntityList);
Set<FishingActivityEntity> fishingActivityEntities1 = FaReportDocumentMapper.INSTANCE.getFishingActivityEntities(null, new FaReportDocumentEntity());
assertTrue(fishingActivityEntities1.size() == 0);
Set<FaReportIdentifierEntity> faReportIdentifierEntities = FaReportDocumentMapper.INSTANCE.mapToFAReportIdentifierEntities(null, new FaReportDocumentEntity());
assertTrue(faReportIdentifierEntities.size() == 0);
}
use of eu.europa.ec.fisheries.ers.fa.entities.FishingActivityEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class FishingTripServiceBean method retrieveCatchEvolutionForFishingTrip.
@Override
public CatchEvolutionDTO retrieveCatchEvolutionForFishingTrip(String fishingTripId) throws ServiceException {
CatchEvolutionDTO catchEvolution = new CatchEvolutionDTO();
List<FishingActivityEntity> fishingActivities = fishingActivityDao.getFishingActivityListForFishingTrip(fishingTripId, null);
List<Object[]> faCatches = faCatchDao.findFaCatchesByFishingTrip(fishingTripId);
catchEvolution.setTripDetails(getTripWidgetDto(fishingActivities.get(0), fishingTripId));
catchEvolution.setCatchEvolutionProgress(prepareCatchEvolutionProgress(fishingActivities));
return catchEvolution;
}
use of eu.europa.ec.fisheries.ers.fa.entities.FishingActivityEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityServiceBean method getNextFishingActivity.
public int getNextFishingActivity(int fishingActivityId) {
log.info(" Retrieve fishing activity from db:" + fishingActivityId);
FishingActivityEntity activityEntity = fishingActivityDao.getFishingActivityById(fishingActivityId, null);
log.info(" activityEntity received from db Id:" + activityEntity.getId() + " typeCode: " + activityEntity.getTypeCode() + " Date:" + DateUtils.parseUTCDateToString(activityEntity.getCalculatedStartTime()));
return fishingActivityDao.getNextFishingActivityId(activityEntity.getId(), activityEntity.getTypeCode(), activityEntity.getCalculatedStartTime());
}
use of eu.europa.ec.fisheries.ers.fa.entities.FishingActivityEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityServiceBean method getPreviousFishingActivity.
public int getPreviousFishingActivity(int fishingActivityId) {
log.info(" Retrieve fishing activity from db:" + fishingActivityId);
FishingActivityEntity activityEntity = fishingActivityDao.getFishingActivityById(fishingActivityId, null);
log.info(" activityEntity received from db Id:" + activityEntity.getId() + " typeCode: " + activityEntity.getTypeCode() + " Date:" + DateUtils.parseUTCDateToString(activityEntity.getCalculatedStartTime()));
return fishingActivityDao.getPreviousFishingActivityId(activityEntity.getId(), activityEntity.getTypeCode(), activityEntity.getCalculatedStartTime());
}
use of eu.europa.ec.fisheries.ers.fa.entities.FishingActivityEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityServiceBean method getFaAndTripIdsFromTripIds.
@Override
public GetFishingActivitiesForTripResponse getFaAndTripIdsFromTripIds(List<FishingActivityForTripIds> faAndTripIds) throws ServiceException {
GetFishingActivitiesForTripResponse response = new GetFishingActivitiesForTripResponse();
List<FaIdsListWithTripIdMap> responseList = new ArrayList<>();
response.setFaWithIdentifiers(responseList);
for (FishingActivityForTripIds faTripId : faAndTripIds) {
List<FishingActivityEntity> fishingActivies = fishingActivityDao.getFishingActivityForTrip(faTripId.getTripId(), faTripId.getTripSchemeId(), faTripId.getFishActTypeCode(), faTripId.getFluxRepDocPurposeCodes());
for (FishingActivityEntity faEntity : fishingActivies) {
addToIdsList(responseList, faEntity);
}
}
return response;
}
Aggregations