Browse Source

feat : 对接调试修改

bilingfeng 2 years ago
parent
commit
af3bddace7

+ 6 - 6
game-module/game-sdk/src/main/java/com/zanxiang/sdk/service/Impl/OrderPayServiceImpl.java

@@ -48,8 +48,12 @@ public class OrderPayServiceImpl implements OrderPayService {
 
     @Override
     public PayParamVO getPayParam(String code, Long orderId, HttpServletRequest request) {
+        Order order = orderService.getById(orderId);
+        if (order == null) {
+            throw new BaseException("参数错误, 订单信息不存在");
+        }
         OrderPayParam orderPayParam = orderPayParamService.getOne(new LambdaQueryWrapper<OrderPayParam>()
-                .eq(OrderPayParam::getOrderId, orderId));
+                .eq(OrderPayParam::getOrderId, order.getOrderId()));
         if (orderPayParam != null) {
             return PayParamVO.builder()
                     .orderId(orderPayParam.getOrderId())
@@ -59,10 +63,6 @@ public class OrderPayServiceImpl implements OrderPayService {
                     .payParam(orderPayParam.getPayParam())
                     .build();
         }
-        Order order = orderService.getById(orderId);
-        if (order == null) {
-            throw new BaseException("参数错误, 订单信息不存在");
-        }
         //创建支付参数
         ProductPayParamBO bo = ProductPayParamBO.builder()
                 .gameId(order.getGameId().toString())
@@ -80,7 +80,7 @@ public class OrderPayServiceImpl implements OrderPayService {
         service.payCreate(bo);
         //重新查询
         orderPayParam = orderPayParamService.getOne(new LambdaQueryWrapper<OrderPayParam>()
-                .eq(OrderPayParam::getOrderId, orderId));
+                .eq(OrderPayParam::getOrderId, order.getOrderId()));
         if (orderPayParam == null) {
             throw new BaseException("支付参数获取失败");
         }