| | |
| | | import com.doumee.core.annotation.LoginDriverRequired; |
| | | import com.doumee.core.annotation.LoginRequired; |
| | | import com.doumee.core.annotation.trace.Trace; |
| | | import com.doumee.config.jwt.JwtTokenUtil; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | |
| | | import com.doumee.dao.dto.DriverActiveOrderDTO; |
| | | import com.doumee.dao.dto.DriverGrabOrderDTO; |
| | | import com.doumee.dao.dto.DriverLoginRequest; |
| | | import com.doumee.dao.dto.DriverDeliverDTO; |
| | | import com.doumee.dao.dto.DriverOrderPageDTO; |
| | | import com.doumee.dao.dto.DriverPickupDTO; |
| | | import com.doumee.dao.dto.DriverRegisterRequest; |
| | | import com.doumee.dao.dto.DriverVerifyRequest; |
| | | import com.doumee.dao.vo.AccountResponse; |
| | | import com.doumee.dao.vo.DriverActiveOrderCountVO; |
| | | import com.doumee.dao.vo.DriverCancelLimitVO; |
| | | import com.doumee.dao.vo.DriverCenterVO; |
| | | import com.doumee.dao.vo.DriverGrabOrderVO; |
| | | import com.doumee.dao.vo.DriverOrderDetailVO; |
| | |
| | | * @author rk |
| | | * @date 2026/04/08 |
| | | */ |
| | | @Api(tags = "司机验证码登录") |
| | | @Api(tags = "司机业务接口") |
| | | @Trace(exclude = true) |
| | | @RestController |
| | | @RequestMapping("/web/driverInfo") |
| | |
| | | |
| | | @LoginDriverRequired |
| | | @Trace |
| | | @ApiOperation(value = "司机累计统计", notes = "累计佣金、待结算佣金、订单总数、钱包余额") |
| | | @GetMapping("/stats") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true) |
| | | }) |
| | | public ApiResponse<com.doumee.dao.vo.DriverStatsVO> stats() { |
| | | return ApiResponse.success("操作成功", driverInfoService.getDriverStats(this.getDriverId())); |
| | | } |
| | | |
| | | @LoginDriverRequired |
| | | @Trace |
| | | @ApiOperation(value = "司机抢单大厅", notes = "分页查询可抢的异地寄存订单") |
| | | @PostMapping("/grabOrderHall") |
| | | @ApiImplicitParams({ |
| | |
| | | @LoginDriverRequired |
| | | @Trace |
| | | @ApiOperation(value = "司机抢单", notes = "对已寄存(status=2)的异地寄存订单发起抢单") |
| | | @PostMapping("/grabOrder") |
| | | @GetMapping("/grabOrder") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "orderId", value = "订单主键", required = true) |
| | |
| | | return ApiResponse.success("操作成功"); |
| | | } |
| | | |
| | | @LoginDriverRequired |
| | | @Trace |
| | | @ApiOperation(value = "司机确认送达", notes = "异地寄存无取件门店订单,派送中(status=4)时确认送达,订单进入已送达(status=5)") |
| | | @PostMapping("/confirmDeliver") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true) |
| | | }) |
| | | public ApiResponse confirmDeliver(@RequestBody @Valid DriverDeliverDTO dto) { |
| | | driverInfoService.confirmDeliver(this.getDriverId(), dto); |
| | | return ApiResponse.success("操作成功"); |
| | | } |
| | | |
| | | @LoginDriverRequired |
| | | @Trace |
| | | @ApiOperation(value = "司机修改密码", notes = "新密码必须同时包含字母和数字,修改成功后需重新登录") |
| | | @GetMapping("/changePassword") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), |
| | | }) |
| | | public ApiResponse changePassword(@RequestParam String newPassword) { |
| | | String token = this.getRequest().getHeader(JwtTokenUtil.HEADER_KEY); |
| | | driverInfoService.changePassword(this.getDriverId(), newPassword, token); |
| | | return ApiResponse.success("密码修改成功,请重新登录"); |
| | | } |
| | | |
| | | @LoginDriverRequired |
| | | @Trace |
| | | @ApiOperation(value = "进行中订单数量", notes = "返回已抢单和派送中的订单数量") |
| | | @GetMapping("/activeOrderCount") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true) |
| | | }) |
| | | public ApiResponse<DriverActiveOrderCountVO> activeOrderCount() { |
| | | return ApiResponse.success("操作成功", driverInfoService.getActiveOrderCount(this.getDriverId())); |
| | | } |
| | | |
| | | @LoginDriverRequired |
| | | @Trace |
| | | @ApiOperation(value = "司机订单分页", notes = "查询司机的全部/待取件/配送中/已完成订单") |
| | | @PostMapping("/orderPage") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true) |
| | | }) |
| | | public ApiResponse<PageData<DriverGrabOrderVO>> orderPage(@RequestBody PageWrap<DriverOrderPageDTO> pageWrap) { |
| | | return ApiResponse.success("操作成功", driverInfoService.driverOrderPage(this.getDriverId(), pageWrap)); |
| | | } |
| | | |
| | | @LoginDriverRequired |
| | | @Trace |
| | | @ApiOperation(value = "今日可取消次数", notes = "返回司机今日取消次数上限、已取消次数、剩余可取消次数") |
| | | @GetMapping("/cancelLimit") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true) |
| | | }) |
| | | public ApiResponse<DriverCancelLimitVO> cancelLimit() { |
| | | return ApiResponse.success("操作成功", driverInfoService.getTodayCancelLimit(this.getDriverId())); |
| | | } |
| | | |
| | | } |