| | |
| | | import com.xiaopeng.api.model.order.XpOrder; |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpVehicle; |
| | | import com.xiaopeng.api.vo.automaticPilot.VehiclePosition; |
| | | import com.xiaopeng.api.vo.operation.NearestNextVo; |
| | | import com.xiaopeng.api.vo.operation.RouteVo; |
| | | import com.xiaopeng.api.vo.order.*; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.exception.ServiceException; |
| | | import com.xiaopeng.common.core.utils.StringUtils; |
| | | import com.xiaopeng.common.core.utils.WebUtils; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | |
| | | */ |
| | | @ApiOperation(value = "订单分页列表", tags = {"管理后台-交易管理-订单管理"}) |
| | | @PostMapping("/api/v1/order/pageList") |
| | | public R<PageInfo<XpOrderPageVO>> pageList(@Validated @RequestBody XpOrderPageQuery query) { |
| | | public R<PageInfo<XpOrderPageVO>> pageList( @RequestBody XpOrderPageQuery query) { |
| | | PageInfo<XpOrderPageVO> pageInfo = xpOrderService.pageList(query); |
| | | return R.ok(pageInfo); |
| | | } |
| | |
| | | @ApiOperation(value = "取消/关闭订单", tags = {"管理后台-交易管理-订单管理"}) |
| | | @PostMapping("/api/v1/order/cancelAndCloseById") |
| | | public R<?> cancelAndCloseById(@Validated @RequestBody XpOrderOperateDTO dto) { |
| | | xpOrderService.cancelOrCloseOrder(dto.getOrderId(), dto.getType()); |
| | | xpOrderService.cancelOrCloseOrder(dto.getOrderId(), dto.getType(),dto.getIsFree()); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | * @param dto 改派请求参数 |
| | | * @return 操作结果 |
| | | */ |
| | | @ApiOperation(value = "改派订单", tags = {"管理后台-交易管理-订单管理"}, notes = "车辆列表在vehicleConvoy服务") |
| | | @ApiOperation(value = "改派订单", tags = {"管理后台-交易管理-订单管理"}, notes = "车辆列表在 vehicleConvoy.availableList 服务") |
| | | @PostMapping("/api/v1/order/reassignById") |
| | | public R<?> reassignById(@Validated @RequestBody XpOrderReassignDTO dto) { |
| | | xpOrderService.reassignOrder( |
| | |
| | | // uid已通过拦截器otp校验,可以直接使用 |
| | | String uid = request.getHeader("XP-Uid"); |
| | | return R.ok(xpOrderService.getUserQuickCapsule(uid, startPointId)); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 获取用户快捷胶囊 历史 时段 终点高点 |
| | | */ |
| | | @ApiOperation(value = "获取首页快捷胶囊推荐站点", notes = "根据当前起点和用户近30天有效订单,按场景优先推荐目的地;无匹配时返回空数据", tags = {"小程序-首页快捷胶囊"}, response = XpPointInfoVo.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "startPointId", value = "当前首页起点站点ID", required = true, dataType = "Long", paramType = "query") |
| | | }) |
| | | @GetMapping("/api/v1/mini-program/order/quick-capsule") |
| | | @XpClientCheck(checkToken = false, checkOtpToken = true) |
| | | public R<NearestNextVo> quickCapsule(@RequestParam Long startPointId,HttpServletRequest request) { |
| | | String uid = request.getHeader("XP-Uid"); |
| | | return R.ok(xpOrderService.quickCapsule(uid,startPointId)); |
| | | |
| | | } |
| | | |
| | |
| | | String uid = request.getHeader("XP-Uid"); |
| | | XpOrder xpOrder = xpOrderService.getById(orderId); |
| | | if (!Objects.equals(xpOrder.getAppUserId(), Long.valueOf(uid))) { |
| | | throw new ServiceException("解锁失败"); |
| | | return R.ok(); |
| | | } |
| | | if(!Arrays.asList(4, 5, 6, 7, 8).contains(xpOrder.getStatus())){ |
| | | throw new ServiceException("解锁失败"); |
| | | return R.ok(); |
| | | } |
| | | String token = redisService.getCacheObject("rt:bluetooth:unlock:order:" + orderId); |
| | | if (StringUtils.isBlank(token)) { |
| | | throw new ServiceException("解锁失败"); |
| | | return R.ok(); |
| | | } |
| | | return R.ok(token); |
| | | } |