Merge remote-tracking branch 'origin/main'

This commit is contained in:
attiya 2026-01-06 13:29:07 +08:00
commit 1e0a912845
3 changed files with 55 additions and 39 deletions

View File

@ -1,7 +1,5 @@
package com.cdzy.user.controller;
import com.cdzy.common.enums.Code;
import com.cdzy.common.ex.EbikeException;
import com.cdzy.common.model.request.PageParam;
import com.cdzy.common.model.response.JsonResult;
import com.cdzy.user.model.dto.EbikeUserCyclingDto;
@ -11,10 +9,8 @@ import com.cdzy.user.model.vo.EbikeBikeInfoVo;
import com.cdzy.user.model.vo.EbikeRevenueStatisticsVo;
import com.cdzy.user.model.vo.EbikeUserAllOrdersVo;
import com.cdzy.user.service.EbikeOrderService;
import com.ebike.feign.clients.PaymentFeignClient;
import com.ebike.feign.model.dto.FeignEbikeDto;
import com.ebike.feign.model.vo.FeignEbikeBikeRadiusVo;
import com.ebike.feign.model.vo.FeignEbikeWxHandleNotifyVo;
import com.mybatisflex.core.paginate.Page;
import jakarta.annotation.Resource;
import jakarta.validation.constraints.NotNull;
@ -43,9 +39,6 @@ public class EbikeOrderController {
@Resource
private EbikeOrderService ebikeOrderService;
@Resource
private PaymentFeignClient paymentFeignClient;
/**
* 车辆列表
*
@ -143,18 +136,4 @@ public class EbikeOrderController {
List<EbikeRevenueStatisticsVo> revenueStatistics = ebikeOrderService.getRevenueStatistics();
return JsonResult.success(revenueStatistics);
}
/**
* 通过商户(骑行)订单订单号查询支付订单状态
*
* @param orderId 订单id
*/
@GetMapping("/queryOrderStatus/{orderId}")
public JsonResult<?> queryOrderStatusById(@PathVariable(name = "orderId") Long orderId) {
JsonResult<FeignEbikeWxHandleNotifyVo> jsonResult = paymentFeignClient.queryOrderStatusById(orderId);
if (jsonResult.getCode() != Code.SUCCESS) {
throw new EbikeException(jsonResult.getMessage());
}
return JsonResult.success(jsonResult.getData());
}
}

View File

@ -1,12 +1,8 @@
package com.cdzy.user.controller;
import com.cdzy.common.enums.Code;
import com.cdzy.common.ex.EbikeException;
import com.cdzy.common.model.response.JsonResult;
import com.cdzy.user.model.entity.EbikePayment;
import com.cdzy.user.service.EbikePaymentService;
import com.ebike.feign.clients.PaymentFeignClient;
import com.fasterxml.jackson.databind.JsonNode;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@ -27,9 +23,6 @@ public class EbikePaymentController {
@Resource
private EbikePaymentService ebikePaymentService;
@Resource
private PaymentFeignClient paymentFeignClient;
/**
* 根据订单号获取支付订单
*
@ -42,15 +35,4 @@ public class EbikePaymentController {
return JsonResult.success(ebikePayment);
}
/**
* 用户支付下单
*/
@GetMapping("/prepay")
public JsonResult<?> prepay(@RequestParam("orderId") Long orderId) {
JsonResult<JsonNode> jsonResult = paymentFeignClient.prepay(orderId);
if (jsonResult.getCode() != Code.SUCCESS) {
throw new EbikeException(jsonResult.getMessage());
}
return JsonResult.success(jsonResult.getData());
}
}

View File

@ -0,0 +1,55 @@
package com.cdzy.user.controller;
import com.cdzy.common.enums.Code;
import com.cdzy.common.ex.EbikeException;
import com.cdzy.common.model.response.JsonResult;
import com.ebike.feign.clients.PaymentFeignClient;
import com.ebike.feign.model.vo.FeignEbikeWxHandleNotifyVo;
import com.fasterxml.jackson.databind.JsonNode;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* @author yanglei
* @since 2026-01-06 11:00
*/
@Slf4j
@RestController
@RequestMapping("/wxPayment")
public class EbikeWxPaymentController {
@Resource
private PaymentFeignClient paymentFeignClient;
/**
* 通过商户(骑行)订单订单号查询支付订单状态
*
* @param orderId 订单id
*/
@GetMapping("/queryOrderStatus/{orderId}")
public JsonResult<?> queryOrderStatusById(@PathVariable(name = "orderId") Long orderId) {
JsonResult<FeignEbikeWxHandleNotifyVo> jsonResult = paymentFeignClient.queryOrderStatusById(orderId);
if (jsonResult.getCode() != Code.SUCCESS) {
throw new EbikeException(jsonResult.getMessage());
}
return JsonResult.success(jsonResult.getData());
}
/**
* 用户支付下单
*/
@GetMapping("/prepay")
public JsonResult<?> prepay(@RequestParam("orderId") Long orderId) {
JsonResult<JsonNode> jsonResult = paymentFeignClient.prepay(orderId);
if (jsonResult.getCode() != Code.SUCCESS) {
throw new EbikeException(jsonResult.getMessage());
}
return JsonResult.success(jsonResult.getData());
}
}