use of eu.europa.ec.fisheries.wsdl.subscription.module.SubCriteriaType in project UVMS-ActivityModule-APP by UnionVMS.
the class FAQueryServiceBean method getReportsByCriteria.
@Override
public Object getReportsByCriteria(List<SubscriptionDataCriteria> subscriptionDataCriteria) {
if (CollectionUtils.isNotEmpty(subscriptionDataCriteria)) {
String consolidated = "N";
String tripID = null;
String vesselId = null;
String schemeId = null;
String endDate = null;
String startDate = null;
for (SubscriptionDataCriteria dataCriteria : subscriptionDataCriteria) {
SubCriteriaType subCriteria = dataCriteria.getSubCriteria();
String valueType = dataCriteria.getValueType().value();
String value = dataCriteria.getValue();
if (subCriteria == SubCriteriaType.END_DATE) {
endDate = value;
} else if (subCriteria == SubCriteriaType.START_DATE) {
startDate = value;
} else if (subCriteria == SubCriteriaType.TRIPID) {
tripID = value;
} else if (subCriteria == SubCriteriaType.CONSOLIDATED) {
consolidated = value;
} else if (subCriteria == SubCriteriaType.VESSELID) {
schemeId = valueType;
vesselId = value;
}
}
List<FaReportDocumentEntity> faReportDocumentsForTrip = FAReportDAO.loadReports(tripID, consolidated, vesselId, schemeId, startDate, endDate);
ActivityEntityToModelMapper faReportEntityToModelMapper = new ActivityEntityToModelMapper();
return faReportEntityToModelMapper.mapToFLUXFAReportMessage(faReportDocumentsForTrip);
}
return null;
}
Aggregations