Search in sources :

Example 1 with RangeCriteria

use of eu.europa.ec.fisheries.schema.movement.search.v1.RangeCriteria in project UVMS-ActivityModule-APP by UnionVMS.

the class MovementModuleServiceBean method addRangeCriteria.

private void addRangeCriteria(Date startDate, Date endDate, MovementQuery movementQuery) {
    RangeCriteria rangeCriteria = new RangeCriteria();
    rangeCriteria.setKey(RangeKeyType.DATE);
    rangeCriteria.setFrom(DateFormatUtils.format(DateUtils.addDays(startDate, -1), "yyyy-MM-dd HH:mm:ss Z"));
    rangeCriteria.setTo(DateFormatUtils.format(DateUtils.addDays(endDate, 1), "yyyy-MM-dd HH:mm:ss Z"));
    movementQuery.getMovementRangeSearchCriteria().add(rangeCriteria);
}
Also used : RangeCriteria(eu.europa.ec.fisheries.schema.movement.search.v1.RangeCriteria)

Example 2 with RangeCriteria

use of eu.europa.ec.fisheries.schema.movement.search.v1.RangeCriteria in project UVMS-Docker by UnionVMS.

the class MovementMovementRestIT method createMovementQueryNumberOfLatestReports.

/**
 * Creates the movement query number of latest reports.
 *
 * @param numberPositions the number positions
 * @return the movement query
 */
private MovementQuery createMovementQueryNumberOfLatestReports(int numberPositions) {
    MovementQuery movementQuery = new MovementQuery();
    movementQuery.setExcludeFirstAndLastSegment(false);
    ListPagination listPagination = new ListPagination();
    listPagination.setListSize(BigInteger.valueOf(1000000));
    listPagination.setPage(BigInteger.valueOf(1));
    movementQuery.setPagination(listPagination);
    ListCriteria listCriteria = new ListCriteria();
    listCriteria.setKey(SearchKey.NR_OF_LATEST_REPORTS);
    listCriteria.setValue("" + numberPositions);
    movementQuery.getMovementSearchCriteria().add(listCriteria);
    RangeCriteria rangeCriteria = new RangeCriteria();
    rangeCriteria.setKey(RangeKeyType.DATE);
    rangeCriteria.setFrom("2017-09-25 15:33:14 +0200");
    rangeCriteria.setTo("2017-10-09 15:33:14 +0200");
    movementQuery.getMovementRangeSearchCriteria().add(rangeCriteria);
    return movementQuery;
}
Also used : MovementQuery(eu.europa.ec.fisheries.schema.movement.search.v1.MovementQuery) RangeCriteria(eu.europa.ec.fisheries.schema.movement.search.v1.RangeCriteria) ListCriteria(eu.europa.ec.fisheries.schema.movement.search.v1.ListCriteria) ListPagination(eu.europa.ec.fisheries.schema.movement.search.v1.ListPagination)

Aggregations

RangeCriteria (eu.europa.ec.fisheries.schema.movement.search.v1.RangeCriteria)2 ListCriteria (eu.europa.ec.fisheries.schema.movement.search.v1.ListCriteria)1 ListPagination (eu.europa.ec.fisheries.schema.movement.search.v1.ListPagination)1 MovementQuery (eu.europa.ec.fisheries.schema.movement.search.v1.MovementQuery)1