瀏覽代碼

修复自动订阅,付款为加会员bug

lyhzzz 1 年之前
父節點
當前提交
9989a99643

+ 4 - 0
src/main/java/com/fdkankan/ucenter/mapper/IIncrementAutoOrderMapper.java

@@ -3,6 +3,7 @@ package com.fdkankan.ucenter.mapper;
 import com.fdkankan.ucenter.entity.IncrementAutoOrder;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * <p>
@@ -15,4 +16,7 @@ import org.apache.ibatis.annotations.Mapper;
 @Mapper
 public interface IIncrementAutoOrderMapper extends BaseMapper<IncrementAutoOrder> {
 
+    IncrementAutoOrder getDelOrder(@Param("orderSn") String subscriptionOrderSn);
+
+    void updateDelStatus(@Param("id")Integer id);
 }

+ 6 - 0
src/main/java/com/fdkankan/ucenter/mq/consumer/AutoOrderConsumer.java

@@ -58,6 +58,12 @@ public class AutoOrderConsumer {
             }
             IncrementAutoOrder incrementAutoOrder = autoOrderService.getByOrderSn(order.getSubscriptionOrderSn());
             if(incrementAutoOrder == null){
+                incrementAutoOrder = autoOrderService.getDelOrder(order.getSubscriptionOrderSn());
+                if(incrementAutoOrder != null){
+                    autoOrderService.updateDelStatus(incrementAutoOrder.getId());
+                }
+            }
+            if(incrementAutoOrder == null){
                 return;
             }
             if(incrementAutoOrder.getSubscriptionId() == null){

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

@@ -34,4 +34,8 @@ public interface IIncrementAutoOrderService extends IService<IncrementAutoOrder>
     void delByIncrementId(Long incrementId);
 
     IncrementAutoOrder getByOrderSn(String orderSn);
+
+    IncrementAutoOrder getDelOrder(String subscriptionOrderSn);
+
+    void updateDelStatus(Integer id);
 }

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

@@ -133,4 +133,14 @@ public class IncrementAutoOrderServiceImpl extends ServiceImpl<IIncrementAutoOrd
         }
         return list.get(0);
     }
+
+    @Override
+    public IncrementAutoOrder getDelOrder(String subscriptionOrderSn) {
+        return getBaseMapper().getDelOrder(subscriptionOrderSn);
+    }
+
+    @Override
+    public void updateDelStatus(Integer id) {
+        getBaseMapper().updateDelStatus(id);
+    }
 }

+ 8 - 0
src/main/resources/mapper/ucenter/IncrementAutoOrderMapper.xml

@@ -2,4 +2,12 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.fdkankan.ucenter.mapper.IIncrementAutoOrderMapper">
 
+
+    <select id="getDelOrder" resultType="com.fdkankan.ucenter.entity.IncrementAutoOrder">
+        select  * from t_increment_auto_order where order_sn = #{orderSn} limit 1
+    </select>
+
+    <update id="updateDelStatus">
+        update  t_increment_auto_order set rec_status = 'A'  where id = #{id}
+    </update>
 </mapper>