彭雪彬
2025-09-04 657466e3e83fced373dc4a501766a844c15fa9d6
oying-system/src/main/java/com/oying/modules/rider/rest/WxRiderController.java
@@ -1,21 +1,28 @@
package com.oying.modules.rider.rest;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.oying.domain.BucketStorage;
import com.oying.exception.BadRequestException;
import com.oying.modules.rider.domain.*;
import com.oying.modules.rider.domain.dto.RiderIncomeDetailQueryCriteria;
import com.oying.modules.rider.domain.dto.RiderOrderRecordQueryCriteria;
import com.oying.modules.rider.domain.dto.RiderWithdrawalRecordQueryCriteria;
import com.oying.modules.rider.domain.vo.OrderDeliveryPhotosVo;
import com.oying.modules.rider.domain.vo.OrderRiderOperationVo;
import com.oying.modules.rider.service.*;
import com.oying.modules.rider.utils.Constants;
import com.oying.service.BucketStorageService;
import com.oying.utils.FileUtil;
import com.oying.utils.PageResult;
import com.oying.utils.R;
import com.oying.utils.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
/**
@@ -37,6 +44,8 @@
    private final RiderInfoService riderInfoService;
    private final RiderOrderRecordService riderOrderRecordService;
    private final RiderDeliveryPhotosService riderDeliveryPhotosService;
    @GetMapping("getRiderSourceInfo/{riderId}")
@@ -96,8 +105,8 @@
    // @PreAuthorize("@el.check('riderOrderRecord:list')")
    public ResponseEntity<?> riderGrabOrder(@PathVariable String orderNum) {
        // 订单号不能为空
        if (orderNum == null || orderNum.equals("")) {
            return ResponseEntity.ok(R.fail(Constants.HTTP_CODE_FAIL, "订单号不能为空"));
        if (StringUtils.isBlank(orderNum)) {
            throw new BadRequestException("订单号不能为空");
        }
        R result = riderOrderRecordService.riderGrabOrder(orderNum);
        return ResponseEntity.ok(result);
@@ -108,8 +117,8 @@
    // @PreAuthorize("@el.check('riderOrderRecord:list')")
    public ResponseEntity<?> riderCancelOrder(@PathVariable String orderNum) {
        // 订单号不能为空
        if (orderNum == null || orderNum.equals("")) {
            return ResponseEntity.ok(R.fail(Constants.HTTP_CODE_FAIL, "订单号不能为空"));
        if (StringUtils.isBlank(orderNum)) {
            throw new BadRequestException("订单号不能为空");
        }
        R result = riderOrderRecordService.riderCancelOrder(orderNum);
        return ResponseEntity.ok(R.success(result));
@@ -120,22 +129,34 @@
    // @PreAuthorize("@el.check('riderOrderRecord:list')")
    public ResponseEntity<?> riderCompleteOrder(@PathVariable String orderNum) {
        // 订单号不能为空
        if (orderNum == null || orderNum.equals("")) {
            return ResponseEntity.ok(R.fail(Constants.HTTP_CODE_FAIL, "订单号不能为空"));
        if (StringUtils.isBlank(orderNum)) {
            throw new BadRequestException("订单号不能为空");
        }
        R result = riderOrderRecordService.riderCompleteOrder(orderNum);
        return ResponseEntity.ok(R.success(result));
    }
    @GetMapping("riderOperationOrder")
    @PostMapping("riderOperationOrder")
    @ApiOperation("骑手上报到店/取货配送")
    // @PreAuthorize("@el.check('riderOrderRecord:list')")
    public ResponseEntity<?> riderOperationOrder(OrderRiderOperationVo orderRiderOperation) {
    public ResponseEntity<?> riderOperationOrder(@RequestBody OrderRiderOperationVo orderRiderOperationVo) {
        // 订单号不能为空
        if (orderRiderOperation.getOrderNum() == null || orderRiderOperation.getOrderNum().equals("")) {
            return ResponseEntity.ok(R.fail(Constants.HTTP_CODE_FAIL, "订单号不能为空"));
        if (StringUtils.isBlank(orderRiderOperationVo.getOrderNum())) {
            throw new BadRequestException("订单号不能为空");
        }
        R result = riderOrderRecordService.riderOperationOrder(orderRiderOperation);
        R result = riderOrderRecordService.riderOperationOrder(orderRiderOperationVo);
        return ResponseEntity.ok(R.success(result));
    }
    @PostMapping("riderDeliveryPhotos")
    @ApiOperation("骑手上传图片")
    // @PreAuthorize("@el.check('riderOrderRecord:list')")
    public ResponseEntity<?> riderDeliveryPhotos(OrderDeliveryPhotosVo orderDeliveryPhotosVo) {
        // 订单号不能为空
        if (StringUtils.isBlank(orderDeliveryPhotosVo.getOrderNum())) {
            throw new BadRequestException("订单号不能为空");
        }
        RiderDeliveryPhotos result = riderDeliveryPhotosService.riderDeliveryPhotos(orderDeliveryPhotosVo);
        return ResponseEntity.ok(R.success(result));
    }