| | |
| | | @GetMapping("/getOrderHistoryTrajectory/{orderId}") |
| | | @ApiOperation(value = "根据订单号查询实际行驶路径", notes = "客服系统对接") |
| | | @ApiImplicitParam(name = "orderId", value = "订单ID", required = true, dataType = "Long", paramType = "path") |
| | | public R<List<TrajectoryVo>> getOrderHistoryTrajectory(@PathVariable Long orderId){ |
| | | public R<OrderHistoryTrajectoryVo> getOrderHistoryTrajectory(@PathVariable Long orderId){ |
| | | List<OrderTrajectory> orderTrajectoryList = mongoTemplate.find(Query.query(Criteria.where("orderId").is(orderId)), OrderTrajectory.class); |
| | | List<TrajectoryVo> collect = orderTrajectoryList.stream().map(trajectory -> { |
| | | String[] split = trajectory.getLocation().split(","); |
| | |
| | | jsonObject.setLat(Double.parseDouble(split[1])); |
| | | return jsonObject; |
| | | }).collect(Collectors.toList()); |
| | | return R.ok(collect); |
| | | OrderHistoryTrajectoryVo vo = new OrderHistoryTrajectoryVo(); |
| | | vo.setActualPath(collect); |
| | | return R.ok(vo); |
| | | } |
| | | |
| | | |