Jelajahi Sumber

修复直播问题

yh 6 hari lalu
induk
melakukan
dd31ff0d04

+ 2 - 0
fs-service/src/main/java/com/fs/live/mapper/LiveCouponUserMapper.java

@@ -72,4 +72,6 @@ public interface LiveCouponUserMapper
             " </if>" +
             "</script>")
     List<LiveCouponUser> curCoupon(@Param("coupon") CouponPO coupon);
+
+    int refundCoupon(Long couponUserId);
 }

+ 7 - 0
fs-service/src/main/java/com/fs/live/service/impl/LiveOrderServiceImpl.java

@@ -294,6 +294,8 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
 
     @Autowired
     private FsWxExpressTaskMapper fsWxExpressTaskMapper;
+    @Autowired
+    private LiveCouponUserMapper liveCouponUserMapper;
 
     //ERP 类型到服务的映射
     private Map<Integer, IErpOrderService> erpServiceMap;
@@ -1589,6 +1591,11 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
             }
         }
 
+        // 退优惠卷
+        if(order.getCouponUserId() != null){
+            liveCouponUserMapper.refundCoupon(order.getCouponUserId());
+        }
+
         return R.ok();
     }
 

+ 9 - 0
fs-service/src/main/resources/mapper/live/LiveCouponUserMapper.xml

@@ -108,6 +108,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where id = #{id}
     </update>
 
+    <update id="refundCoupon">
+        UPDATE live_coupon_user
+        SET
+            `status` = 0,
+            `is_fail` = 0
+        WHERE
+            `id` = #{couponUserId}
+    </update>
+
     <delete id="deleteLiveCouponUserById" parameterType="Long">
         delete from live_coupon_user where id = #{id}
     </delete>

+ 3 - 1
fs-service/src/main/resources/mapper/live/LiveOrderMapper.xml

@@ -198,7 +198,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             a.pay_remain,	a.delivery_status,	a.delivery_pay_status,	a.delivery_pay_time,	a.delivery_type,
             a.delivery_pay_money,	a.delivery_import_time,	a.delivery_send_time,	a.is_after_sales,	a.dept_id,
             a.channel,	a.source,	a.bill_price,	a.total_postage,	a.pay_postage,	a.gain_integral,a.coupon_price,
-            a.use_integral,	a.pay_integral,	a.back_integral,	a.is_edit_money,	b.product_info as product_introduce,a.customer_id,a.app_id
+            a.use_integral,	a.pay_integral,	a.back_integral,	a.is_edit_money,	b.product_info as product_introduce,a.customer_id,a.app_id,a.coupon_user_id
         FROM
             live_order a LEFT JOIN fs_store_product_scrm b ON a.product_id = b.product_id
                          left join company_user cu on a.company_user_id = cu.user_id
@@ -281,6 +281,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="customerId != null">customer_id,</if>
             <if test="couponPrice != null">coupon_price,</if>
             <if test="appId != null and appId != ''">app_id,</if>
+            <if test="couponUserId != null and couponUserId != ''">coupon_user_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="liveId != null">#{liveId},</if>
@@ -354,6 +355,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="customerId != null">#{customerId},</if>
             <if test="couponPrice != null">#{couponPrice},</if>
             <if test="appId != null and appId != ''">#{appId},</if>
+            <if test="couponUserId != null and couponUserId != ''">#{couponUserId},</if>
          </trim>
     </insert>
 

+ 1 - 0
fs-service/src/main/resources/mapper/live/LiveUserRedRecordMapper.xml

@@ -26,6 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="liveId != null "> and live_id = #{liveId}</if>
             <if test="userId != null "> and user_id = #{userId}</if>
             <if test="createTime != null "> and create_time = #{createTime}</if>
+            <if test="redId != null"> and red_id = #{redId}</if>
         </where>
 
         order by create_time desc