| | |
| | | } |
| | | daoQuery.start = (page - 1) * pageSize; |
| | | daoQuery.count = pageSize; |
| | | daoQuery.sortList= Arrays.asList(new Sort.Order[]{Sort.Order.desc("createTime")}); |
| | | daoQuery.sortList = Arrays.asList(new Sort.Order[]{Sort.Order.desc("createTime")}); |
| | | return locationTravelDao.list(daoQuery); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public void add(LocationTravel locationTravel) throws Exception { |
| | | |
| | | if (locationTravel == null || locationTravel.getUid() == null || locationTravel.getLocation() == null) { |
| | | if (locationTravel == null || locationTravel.getUid() == null || locationTravel.getLocation() == null || locationTravel.getLocation().getLatitude() == null || locationTravel.getLocation().getLongitude() == null) { |
| | | throw new Exception("信息不完整"); |
| | | } |
| | | |
| | |
| | | locationTravelDao.save(locationTravel); |
| | | |
| | | |
| | | UserLatestLocation latest =new UserLatestLocation(); |
| | | UserLatestLocation latest = new UserLatestLocation(); |
| | | latest.setLocation(locationTravel.getLocation()); |
| | | latest.setUid(locationTravel.getUid()); |
| | | userLatestLocationService.add(latest); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<LocationTravel> getTravelList(Long uid, Date startTime, Date endTime) { |
| | | |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | daoQuery.minCreateTime = startTime; |
| | | daoQuery.maxCreateTime = endTime; |
| | | daoQuery.uid = uid; |
| | | List<LocationTravel> travelList = locationTravelDao.list(daoQuery); |
| | | |
| | | |
| | | |
| | | |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public long countTravel(Long uid, Date startTime, Date endTime) { |
| | | DaoQuery daoQuery = new DaoQuery(); |
| | | daoQuery.minCreateTime = startTime; |
| | | daoQuery.maxCreateTime = endTime; |
| | | daoQuery.uid = uid; |
| | | return locationTravelDao.count(daoQuery); |
| | | } |
| | | |
| | | |
| | | } |