| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | |
| | | routeVo.setDirection(null != vehiclePosition ? vehiclePosition.getCourse() : 90); |
| | | return R.ok(routeVo); |
| | | } |
| | | /** |
| | | * 订单查询轨迹路线 |
| | | */ |
| | | @ApiOperation(value = "订单查询轨迹路线") |
| | | @PostMapping("/api/v1/mini-program/order/queryOrderTrajectory") |
| | | public R<List<OrderTrajectory>> queryOrderTrajectory(@RequestParam Long orderId, HttpServletRequest request) { |
| | | String uid = request.getHeader("XP-Uid"); |
| | | List<OrderTrajectory> trajectories = mongoTemplate.find( |
| | | new Query(Criteria.where("orderId").is(orderId)) |
| | | .with(Sort.by(Sort.Direction.ASC, "locatetime")), |
| | | OrderTrajectory.class |
| | | ); |
| | | return R.ok(trajectories); |
| | | } |
| | | |
| | | } |