zoujiajian 1 年之前
父節點
當前提交
2b2cf561fd

+ 7 - 2
netflix-common/src/main/java/com/cyksj/common/constant/Constant.java

@@ -645,9 +645,14 @@ public interface Constant {
 	String DISTRIBUTE_CLAUDE_CODE_CC_URL = "https://cc.yhlxj.com/claude/dashboard/web?dsCode=%s";
 
 	/**
-	 * 推广claude code优惠券id
+	 * 推广claude code无优惠码的优惠券id
 	 */
-	Long DISTRIBUTE_CLAUDE_CODE_COUPON_ID = 111L;
+	Long DISTRIBUTE_CLAUDE_CODE_NO_CODE_COUPON_ID = 269L;
+
+	/**
+	 * 推广claude code关联优惠券的优惠券id
+	 */
+	Long DISTRIBUTE_CLAUDE_CODE_COUPON_ID = 270L;
 
 	/**
 	 * claude code日卡推广活动

+ 10 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/User.java

@@ -1,6 +1,7 @@
 package com.cyksj.model.entity;
 
 import com.baomidou.mybatisplus.annotation.TableField;
+import com.ejlchina.searcher.bean.DbIgnore;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.experimental.Accessors;
@@ -104,11 +105,20 @@ public class User extends BaseEntity implements Serializable{
     private Date lastTime;
 
     @TableField(exist = false)
+    @DbIgnore
     private Long emailUserId;
 
     @TableField(exist = false)
+    @DbIgnore
     private Long phoneUserId;
 
+    /**
+     * 是否渠道配置了优惠码
+     */
+    @TableField(exist = false)
+    @DbIgnore
+    private Boolean ccCode = false;
+
     /**
      * 是否是谷歌授权登录
      */

+ 5 - 0
netflix-service/src/main/java/com/cyksj/service/user/impl/UserServiceImpl.java

@@ -584,6 +584,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
 			UserDistribute userDistribute = userDistributeMapper.selectOne(Wrappers.lambdaQuery(UserDistribute.class).eq(UserDistribute::getUserId, sharedId).eq(UserDistribute::getDeleted, Boolean.TRUE).last("limit 1"));
 			if (userDistribute != null) {
 				Integer selectCount = couponDistributePopularizeMapper.selectCount(Wrappers.lambdaQuery(CouponDistributePopularize.class).eq(CouponDistributePopularize::getDistributeId, userDistribute.getId()).eq(CouponDistributePopularize::getCouponId, Constant.DISTRIBUTE_CLAUDE_CODE_COUPON_ID));
+				//是否设置claude cod优惠券
 				if (selectCount > 0) {
 					//设置了 直接发送优惠券
 					couponCommonService.sendCouponToUser(user.getId(), Constant.DISTRIBUTE_CLAUDE_CODE_COUPON_ID, 0l, 0l, dsPopularizeId, CouponUser.Channel.manual);
@@ -592,8 +593,12 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
 						if (!claudeCodeService.checkClaudeCodeUser(user.getId())) {
 							//发送claude code 体验卡
 							groupRelationFrontService.getTrialTicketByUserIdAndGoodsId(user.getId(), Constant.DISTRIBUTE_CLAUDE_CODE_TRIAL_SKU_ID, 2);
+							user.setCcCode(Boolean.TRUE);
 						}
 					}
+				} else {
+					//发送无优惠码的 优惠券
+					couponCommonService.sendCouponToUser(user.getId(), Constant.DISTRIBUTE_CLAUDE_CODE_NO_CODE_COUPON_ID, 0l, 0l, dsPopularizeId, CouponUser.Channel.manual);
 				}
 			}
 		}