fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserSystemCouponMapper.java
@@ -10,6 +10,12 @@ public interface UserSystemCouponMapper extends BaseMapper<UserSystemCoupon> { /** * 激活券 * @param couponId */ void activateCouponByType(@Param("uid") Long uid, @Param("couponId") Long couponId); List<UserSystemCoupon> getUserCouponList(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid); fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponMapper.xml
@@ -90,6 +90,12 @@ </set> where usc_id = #{id,jdbcType=BIGINT} </update> <update id="activateCouponByType"> UPDATE yeshi_ec_user_system_coupon SET usc_state_activate = 1 WHERE usc_uid = #{uid} AND usc_coupon_id = #{couponId} AND (usc_state_activate = 0 OR usc_state_activate is null) </update> <select id="getUserCouponList" resultMap="BaseResultMap"> SELECT * FROM `yeshi_ec_user_system_coupon` uc WHERE uc.`usc_uid`= #{uid} fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
@@ -949,6 +949,24 @@ return userRecordVO; } @Override public void activatedWelfareFreeCoupon(Long uid) { if (uid == null) { return; } // 福利免单券 String welfareFree = CouponTypeEnum.welfareFreeCoupon.name(); SystemCoupon systemCoupon = systemCouponService.getCouponByType(welfareFree); if (systemCoupon == null) { return; } // 激活福利免单券 userSystemCouponMapper.activateCouponByType(uid, systemCoupon.getId()); } @Override public void updateCounponInvalid(Long uid) { fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserSystemCouponService.java
@@ -146,5 +146,11 @@ */ public void sendBackCoupon(Long uid); /** * 激活福利免单券 * @param uid */ public void activatedWelfareFreeCoupon(Long uid); } fanli/src/main/java/com/yeshi/fanli/util/SpringContext.java
@@ -30,6 +30,7 @@ import com.yeshi.fanli.service.inter.push.IOSPushService; import com.yeshi.fanli.service.inter.user.ExtractService; import com.yeshi.fanli.service.inter.user.UserInfoService; import com.yeshi.fanli.service.inter.user.UserSystemCouponService; /** * 系统初始化 @@ -63,6 +64,10 @@ @Resource private QualityFactoryService qualityFactoryService; @Resource private UserSystemCouponService userSystemCouponService; private static boolean isInited = false; @@ -415,11 +420,9 @@ ThreeSale threeSale = map.get(key); if (threeSale != null) { if (threeSale.getState() != null && threeSale.getState() == true) { // 邀请成功 // TODO 券激活生效 // threeSale.getBoss().getId(); // 邀请成功 - 券激活生效 Long bossId = threeSale.getBoss().getId(); userSystemCouponService.activatedWelfareFreeCoupon(bossId); } } ThreeSaleCMQManager.getInstance()