From ab0637e981ab4c85120ccde35ee24ec4abbe3e24 Mon Sep 17 00:00:00 2001
From: xin <1099200748@qq.com>
Date: Fri, 17 Oct 2025 17:20:15 +0800
Subject: [PATCH] Merge branch 'refs/heads/master' into xin
---
oying-system/src/main/java/com/oying/modules/rider/rest/WxRiderController.java | 53 +++++++++++++++++++++++++++++++++++++----------------
1 files changed, 37 insertions(+), 16 deletions(-)
diff --git a/oying-system/src/main/java/com/oying/modules/rider/rest/WxRiderController.java b/oying-system/src/main/java/com/oying/modules/rider/rest/WxRiderController.java
index caaee55..e49e0bb 100644
--- a/oying-system/src/main/java/com/oying/modules/rider/rest/WxRiderController.java
+++ b/oying-system/src/main/java/com/oying/modules/rider/rest/WxRiderController.java
@@ -1,21 +1,25 @@
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.utils.PageResult;
-import com.oying.utils.R;
+import com.oying.service.BucketStorageService;
+import com.oying.utils.*;
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;
/**
@@ -38,12 +42,14 @@
private final RiderOrderRecordService riderOrderRecordService;
+ private final RiderDeliveryPhotosService riderDeliveryPhotosService;
+
@GetMapping("getRiderSourceInfo/{riderId}")
@ApiOperation("查询第三方数据骑手信息")
// @PreAuthorize("@el.check('riderInfo:list')")
public ResponseEntity<?> getRiderSourceInfo(@PathVariable Long riderId) {
- RiderInfo riderInfo = riderInfoService.getRiderSourceInfo(riderId);
+ RiderInfo riderInfo = riderInfoService.getRiderSourceInfo(SecurityUtils.getCurrentUserId());
return ResponseEntity.ok(R.success(riderInfo));
}
@@ -51,15 +57,15 @@
@ApiOperation("同步查询第三方骑手信息 LY")
// @PreAuthorize("@el.check('riderInfo:edit')")
public ResponseEntity<?> syncRiderSourceInfo(@PathVariable String sourcePlatform) {
- riderInfoService.syncRiderSourceInfo(sourcePlatform);
- return ResponseEntity.ok(R.success("操作成功"));
+ R result = riderInfoService.syncRiderSourceInfo(sourcePlatform);
+ return ResponseEntity.ok(result);
}
@GetMapping("getRiderWalletInfo/{riderId}")
@ApiOperation("查询骑手钱包信息")
// @PreAuthorize("@el.check('riderWalletInfo:list')")
public ResponseEntity<?> getRiderWalletInfo(@PathVariable String riderId) {
- RiderWalletInfo riderWalletInfo = riderWalletInfoService.getRiderWalletInfo(riderId);
+ RiderWalletInfo riderWalletInfo = riderWalletInfoService.getRiderWalletInfo(SecurityUtils.getCurrentUserId());
return ResponseEntity.ok(R.success(riderWalletInfo));
}
@@ -67,6 +73,7 @@
@ApiOperation("查询骑手订单收入明细分页")
// @PreAuthorize("@el.check('riderIncomeDetail:list')")
public ResponseEntity<?> getRiderIncomeDetail(RiderIncomeDetailQueryCriteria criteria) {
+ criteria.setRiderId(SecurityUtils.getCurrentUserId());
Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize());
PageResult<RiderIncomeDetail> riderIncomeDetails = riderIncomeDetailService.queryAll(criteria, page);
return ResponseEntity.ok(R.success(riderIncomeDetails));
@@ -76,6 +83,7 @@
@ApiOperation("查询骑手提现记录分页")
// @PreAuthorize("@el.check('riderWithdrawalRecord:list')")
public ResponseEntity<?> getRiderWithdrawalRecord(RiderWithdrawalRecordQueryCriteria criteria) {
+ criteria.setRiderId(SecurityUtils.getCurrentUserId());
Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize());
PageResult<RiderWithdrawalRecord> riderIncomeDetails = riderWithdrawalRecordService.queryAll(criteria, page);
return ResponseEntity.ok(R.success(riderIncomeDetails));
@@ -85,6 +93,7 @@
@ApiOperation("查询骑手订单记录分页")
// @PreAuthorize("@el.check('riderOrderRecord:list')")
public ResponseEntity<?> getRiderOrderRecord(RiderOrderRecordQueryCriteria criteria) {
+ criteria.setRiderId(SecurityUtils.getCurrentUserId());
Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize());
PageResult<RiderOrderRecord> riderOrderRecordPageResult = riderOrderRecordService.queryAll(criteria, page);
return ResponseEntity.ok(R.success(riderOrderRecordPageResult));
@@ -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,8 +129,8 @@
// @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));
@@ -130,12 +139,24 @@
@PostMapping("riderOperationOrder")
@ApiOperation("骑手上报到店/取货配送")
// @PreAuthorize("@el.check('riderOrderRecord:list')")
- public ResponseEntity<?> riderOperationOrder(@RequestBody 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));
}
--
Gitblit v1.9.3