Search in sources :

Example 1 with StopProblemReportSummaryBean

use of org.onebusaway.transit_data.model.problems.StopProblemReportSummaryBean in project onebusaway-application-modules by camsys.

the class UserReportingServiceImpl method getStopProblemReportSummaries.

@Override
public ListBean<StopProblemReportSummaryBean> getStopProblemReportSummaries(StopProblemReportQueryBean query) {
    List<T2<AgencyAndId, Integer>> records = _userReportingDao.getStopProblemReportSummaries(query.getAgencyId(), query.getTimeFrom(), query.getTimeTo(), query.getStatus());
    List<StopProblemReportSummaryBean> beans = new ArrayList<StopProblemReportSummaryBean>(records.size());
    for (T2<AgencyAndId, Integer> record : records) {
        AgencyAndId stopId = record.getFirst();
        Integer count = record.getSecond();
        StopProblemReportSummaryBean bean = new StopProblemReportSummaryBean();
        bean.setStop(_stopBeanService.getStopForId(stopId));
        bean.setStatus(query.getStatus());
        bean.setCount(count);
        beans.add(bean);
    }
    return new ListBean<StopProblemReportSummaryBean>(beans, false);
}
Also used : StopProblemReportSummaryBean(org.onebusaway.transit_data.model.problems.StopProblemReportSummaryBean) AgencyAndId(org.onebusaway.gtfs.model.AgencyAndId) ArrayList(java.util.ArrayList) ListBean(org.onebusaway.transit_data.model.ListBean) T2(org.onebusaway.collections.tuple.T2)

Aggregations

ArrayList (java.util.ArrayList)1 T2 (org.onebusaway.collections.tuple.T2)1 AgencyAndId (org.onebusaway.gtfs.model.AgencyAndId)1 ListBean (org.onebusaway.transit_data.model.ListBean)1 StopProblemReportSummaryBean (org.onebusaway.transit_data.model.problems.StopProblemReportSummaryBean)1