Browse Source

订阅成功不会滴

lyhzzz 1 năm trước cách đây
mục cha
commit
981776e207

+ 4 - 1
src/main/java/com/fdkankan/ucenter/mq/consumer/AutoOrderConsumer.java

@@ -55,10 +55,13 @@ public class AutoOrderConsumer {
             if(order == null){
             if(order == null){
                 return;
                 return;
             }
             }
-            IncrementAutoOrder incrementAutoOrder = autoOrderService.getBySubId(order.getSubscriptionId());
+            IncrementAutoOrder incrementAutoOrder = autoOrderService.getByOrderSn(order.getSubscriptionOrderSn());
             if(incrementAutoOrder == null){
             if(incrementAutoOrder == null){
                 return;
                 return;
             }
             }
+            if(incrementAutoOrder.getSubscriptionId() == null){
+                autoOrderService.subOrder(order.getSubscriptionOrderSn(),order.getSubscriptionId());
+            }
 
 
             switch (order.getEventType()){
             switch (order.getEventType()){
                 case "PAYMENT.SALE.COMPLETED" :     //每日扣款
                 case "PAYMENT.SALE.COMPLETED" :     //每日扣款

+ 1 - 1
src/main/java/com/fdkankan/ucenter/service/IIncrementAutoOrderService.java

@@ -17,7 +17,7 @@ public interface IIncrementAutoOrderService extends IService<IncrementAutoOrder>
 
 
     void addOrder(Long userId, Integer incrementTypeId, Long incrementId, String orderSn);
     void addOrder(Long userId, Integer incrementTypeId, Long incrementId, String orderSn);
 
 
-    void subOrder(PayOrderVo order);
+    void subOrder(String orderSn,String subscriptionId);
 
 
     IncrementAutoOrder getBySubId(String subscriptionId);
     IncrementAutoOrder getBySubId(String subscriptionId);
 
 

+ 3 - 3
src/main/java/com/fdkankan/ucenter/service/impl/IncrementAutoOrderServiceImpl.java

@@ -65,10 +65,10 @@ public class IncrementAutoOrderServiceImpl extends ServiceImpl<IIncrementAutoOrd
     }
     }
 
 
     @Override
     @Override
-    public void subOrder(PayOrderVo order) {
+    public void subOrder(String orderSn,String subscriptionId) {
         LambdaUpdateWrapper<IncrementAutoOrder> wrapper = new LambdaUpdateWrapper<>();
         LambdaUpdateWrapper<IncrementAutoOrder> wrapper = new LambdaUpdateWrapper<>();
-        wrapper.eq(IncrementAutoOrder::getOrderSn,order.getOrderSn());
-        wrapper.set(IncrementAutoOrder::getSubscriptionId,order.getTradeNo());
+        wrapper.eq(IncrementAutoOrder::getOrderSn,orderSn);
+        wrapper.set(IncrementAutoOrder::getSubscriptionId,subscriptionId);
         this.update(wrapper);
         this.update(wrapper);
     }
     }