| | |
| | | import com.xiaopeng.common.core.utils.StringUtils; |
| | | import com.xiaopeng.common.core.utils.WebUtils; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.log.annotation.AdminOperationLog; |
| | | import com.xiaopeng.common.log.enums.AdminBusinessType; |
| | | import com.xiaopeng.common.log.enums.AdminOperationType; |
| | | import com.xiaopeng.common.redis.service.RedisService; |
| | | import com.xiaopeng.common.security.service.TokenService; |
| | | import com.xiaopeng.order.config.BluetoothDebugConfig; |
| | | import com.xiaopeng.order.dto.OrderNavigationDto; |
| | | import com.xiaopeng.api.model.order.OrderTrajectory; |
| | | import com.xiaopeng.order.model.dto.XpOrderCommentDto; |
| | |
| | | |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | @Autowired |
| | | private BluetoothDebugConfig bluetoothDebugConfig; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ApiOperation(value = "删除订单", tags = {"管理后台-交易管理-订单管理"}) |
| | | @DeleteMapping("/api/v1/order/deleteById") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.ORDER_MANAGEMENT, |
| | | operationType = AdminOperationType.DELETE, |
| | | contentExpression = "'删除订单,id=' + #p0", |
| | | appendRequestData = false |
| | | ) |
| | | public R<?> deleteById(@ApiParam(value = "订单id", required = true) @RequestParam Long id) { |
| | | xpOrderService.deleteOrder(id); |
| | | return R.ok(); |
| | |
| | | */ |
| | | @ApiOperation(value = "订单导出", tags = {"管理后台-交易管理-订单管理"}) |
| | | @PostMapping("/api/v1/order/exportExcel") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.ORDER_MANAGEMENT, |
| | | operationType = AdminOperationType.EXPORT, |
| | | content = "订单导出", |
| | | appendRequestData = true |
| | | ) |
| | | public void exportExcel(@RequestBody XpOrderExcelQuery query) { |
| | | // 1. 查询导出数据 |
| | | List<XpOrderPageVO> dataList = xpOrderService.exportList(query); |
| | |
| | | */ |
| | | @ApiOperation(value = "取消/关闭订单", tags = {"管理后台-交易管理-订单管理"}) |
| | | @PostMapping("/api/v1/order/cancelAndCloseById") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.ORDER_MANAGEMENT, |
| | | operationType = AdminOperationType.EDIT, |
| | | content = "取消/关闭订单", |
| | | appendRequestData = true |
| | | ) |
| | | public R<?> cancelAndCloseById(@Validated @RequestBody XpOrderOperateDTO dto) { |
| | | xpOrderService.cancelOrCloseOrder(dto.getOrderId(), dto.getType(),dto.getIsFree()); |
| | | return R.ok(); |
| | |
| | | */ |
| | | @ApiOperation(value = "改派订单", tags = {"管理后台-交易管理-订单管理"}, notes = "车辆列表在 vehicleConvoy.availableList 服务") |
| | | @PostMapping("/api/v1/order/reassignById") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.ORDER_MANAGEMENT, |
| | | operationType = AdminOperationType.EDIT, |
| | | content = "改派订单", |
| | | appendRequestData = true |
| | | ) |
| | | public R<?> reassignById(@Validated @RequestBody XpOrderReassignDTO dto) { |
| | | xpOrderService.reassignOrder( |
| | | dto.getOrderId(), |
| | |
| | | @ApiImplicitParam(name = "id", value = "订单ID", required = true, dataType = "Long"), |
| | | @ApiImplicitParam(name = "amount", value = "新的订单金额", required = true, dataType = "BigDecimal") |
| | | }) |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.ORDER_MANAGEMENT, |
| | | operationType = AdminOperationType.EDIT, |
| | | contentExpression = "'订单改价,id=' + #p0 + ',amount=' + #p1", |
| | | appendRequestData = false |
| | | ) |
| | | public R<?> changeAmount(@RequestParam("id") Long id, @RequestParam("amount") BigDecimal amount) { |
| | | xpOrderService.changeAmount(id, amount); |
| | | return R.ok(); |
| | |
| | | @GetMapping("/api/v1/mini-program/bluetooth/getUnlocktToken/{orderId}") |
| | | @XpClientCheck(checkToken = false, checkOtpToken = true) |
| | | public R<BluetoothTokenVo> getBluetoothToken(@PathVariable("orderId") Long orderId, HttpServletRequest request) { |
| | | |
| | | // ========== 联调临时逻辑:通过 Nacos 配置返回固定蓝牙信息(bluetooth-debug.enabled=true 时生效) ========== |
| | | if (bluetoothDebugConfig.isEnabled()) { |
| | | BluetoothTokenVo vo = new BluetoothTokenVo(); |
| | | vo.setToken(bluetoothDebugConfig.getToken()); |
| | | vo.setMacAddress(bluetoothDebugConfig.getMacAddress()); |
| | | vo.setSlaveMacList(bluetoothDebugConfig.getSlaveMacList()); |
| | | return R.ok(vo); |
| | | } |
| | | // ========== 联调临时逻辑结束 ========== |
| | | |
| | | // 原逻辑 |
| | | String uid = request.getHeader("XP-Uid"); |
| | | XpOrder xpOrder = xpOrderService.getById(orderId); |
| | | if (!Objects.equals(xpOrder.getAppUserId(), Long.valueOf(uid))) { |
| | |
| | | XpOrderInfoVo xpOrderInfoVo = BeanUtil.copyProperties(xpOrder, XpOrderInfoVo.class); |
| | | return R.ok(xpOrderInfoVo); |
| | | } |
| | | } |
| | | } |