Forráskód Böngészése

Merge branch 'develop/v1.0' into master-test

tangxiangan 2 napja
szülő
commit
be62a35c9d

+ 3 - 2
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/service/OrderService.java

@@ -138,10 +138,11 @@ public interface OrderService extends IService<Order> {
 
     /**
      * 根据第三方id获取订单
-     * @param thirdOrderNo 第三方id
+     *
+     * @param thirdTradeNo 第三方id
      * @return
      */
-    List<OrdersVO> getOrderListByThirdOrderNo(String thirdOrderNo);
+    List<OrdersVO> getOrderListByThirdTradeNo(String thirdTradeNo);
 
     Order getOrderByUserIdAndProductId(String userId, String productId);
 }

+ 5 - 5
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/service/impl/OrderServiceImpl.java

@@ -311,7 +311,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
                 String responseBody = response.body().string();
                 JSONObject jsonResponse = JSON.parseObject(responseBody);
                 String payHref = jsonResponse.getJSONObject("data").getString("payHref");
-                order.setThirdOrderNo(jsonResponse.getJSONObject("data").getString("id"));
+                order.setThirdTradeNo(jsonResponse.getJSONObject("data").getString("id"));
                 order.setPagePayUrl(payHref);
                 this.baseMapper.insert(order);
                 // 订单关闭
@@ -470,7 +470,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
                 String responseBody = response.body().string();
                 JSONObject jsonResponse = JSON.parseObject(responseBody);
                 String payHref = jsonResponse.getJSONObject("data").getString("payHref");
-                order.setThirdOrderNo(jsonResponse.getJSONObject("data").getString("id"));
+                order.setThirdTradeNo(jsonResponse.getJSONObject("data").getString("id"));
                 order.setPagePayUrl(payHref);
                 this.baseMapper.insert(order);
                 // 订单关闭
@@ -652,7 +652,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
                     .readTimeout(300, TimeUnit.SECONDS)
                     .writeTimeout(300, TimeUnit.SECONDS)
                     .build();
-            String url = payCenterConfigProperties.getPayCenterUrl() + payCenterConfigProperties.getCapturePaypalMethod() + "?tradeId=" + order.getThirdOrderNo();
+            String url = payCenterConfigProperties.getPayCenterUrl() + payCenterConfigProperties.getCapturePaypalMethod() + "?tradeId=" + order.getThirdTradeNo();
             Request request = new Request.Builder()
                     .url(url)
                     .method("GET", null)
@@ -824,8 +824,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
     }
 
     @Override
-    public List<OrdersVO> getOrderListByThirdOrderNo(String thirdOrderNo) {
-        return this.baseMapper.selectOrdersByThirdOrderNo(thirdOrderNo);
+    public List<OrdersVO> getOrderListByThirdTradeNo(String thirdTradeNo) {
+        return this.baseMapper.selectOrdersByThirdOrderNo(thirdTradeNo);
     }
 
     @Override

+ 3 - 4
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/service/impl/PayCenterWebhookServiceImpl.java

@@ -50,7 +50,6 @@ import org.springframework.util.StreamUtils;
 import org.springframework.web.client.RestTemplate;
 
 import java.io.IOException;
-import java.math.BigDecimal;
 import java.nio.charset.StandardCharsets;
 import java.text.SimpleDateFormat;
 import java.time.ZoneId;
@@ -126,7 +125,7 @@ public class PayCenterWebhookServiceImpl implements PayCenterWebhookService {
             }
             // 处理回调
             // 根据第三方id获取订单
-            List<OrdersVO> ordersVOList = ordersService.getOrderListByThirdOrderNo(thirdTradeId);
+            List<OrdersVO> ordersVOList = ordersService.getOrderListByThirdTradeNo(thirdTradeId);
             if (CollectionUtils.isEmpty(ordersVOList)) {
                 log.error("根据第三方订单id查询不到订单信息,thirdTradeId:{}", thirdTradeId);
                 // 根据自定义订单号查询
@@ -199,8 +198,8 @@ public class PayCenterWebhookServiceImpl implements PayCenterWebhookService {
                     Order order = new Order();
                     order.setId(ordersVO.getId());
                     order.setSubscriptionId(subscription.getId());
-                    order.setThirdOrderNo(thirdTradeId);
-                    order.setThirdTradeNo(payId);
+                    order.setThirdOrderNo(payId);
+                    order.setThirdTradeNo(thirdTradeId);
                     order.setStatus(OrderConstant.COMPLETED);
                     order.setPayDate(new Date());
                     order.setInvoiceNo(MyDateUtils.getTimeStamp() + (int) ((Math.random() * 9 + 1) * 1000));

+ 1 - 1
pdf-office-payment/src/main/resources/mapper/OrderMapper.xml

@@ -100,7 +100,7 @@
              ,user_id
              ,email,pay_number,discount_type,subscription_type,payment_model
         from `order`
-        where third_order_no = #{thirdOrderNo}
+        where third_trade_no = #{thirdOrderNo}
     </select>
 
     <select id="getOrderByUser" resultType="cn.kdan.cloud.pdf.office.api.payment.vo.OrdersVO">