|
@@ -173,6 +173,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
String callback = re.getCk();
|
|
String callback = re.getCk();
|
|
|
String callbackType = re.getCt();
|
|
String callbackType = re.getCt();
|
|
|
String customId = re.getCd();
|
|
String customId = re.getCd();
|
|
|
|
|
+ Boolean isNano = re.getIsNano();
|
|
|
|
|
|
|
|
final String unionid = info.getUnionid();
|
|
final String unionid = info.getUnionid();
|
|
|
if (StrUtil.isEmpty(unionid)) {
|
|
if (StrUtil.isEmpty(unionid)) {
|
|
@@ -255,7 +256,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
equipDistributeService.saveDistributionInvitation(sharedId, isNewUser, user.getId());
|
|
equipDistributeService.saveDistributionInvitation(sharedId, isNewUser, user.getId());
|
|
|
}
|
|
}
|
|
|
//处理特殊推广
|
|
//处理特殊推广
|
|
|
- handlerSpecialPopularize(sharedId, dsPopularizeId, user, isNewUser);
|
|
|
|
|
|
|
+ handlerSpecialPopularize(sharedId, dsPopularizeId, user, isNewUser, isNano);
|
|
|
//每日活跃记录
|
|
//每日活跃记录
|
|
|
userLoginRecordService.saveUserLoginDayRecord(user.getId());
|
|
userLoginRecordService.saveUserLoginDayRecord(user.getId());
|
|
|
//是否是大学生快递站进来的用户
|
|
//是否是大学生快递站进来的用户
|
|
@@ -606,7 +607,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
equipDistributeService.saveDistributionInvitation(sharedId, isNewUser, user.getId());
|
|
equipDistributeService.saveDistributionInvitation(sharedId, isNewUser, user.getId());
|
|
|
}
|
|
}
|
|
|
//查找渠道是否有设置了对应的claude code优惠码
|
|
//查找渠道是否有设置了对应的claude code优惠码
|
|
|
- handlerSpecialPopularize(sharedId, dsPopularizeId, user, isNewUser);
|
|
|
|
|
|
|
+ handlerSpecialPopularize(sharedId, dsPopularizeId, user, isNewUser, loginReq.getIsNano());
|
|
|
|
|
|
|
|
//每日活跃记录
|
|
//每日活跃记录
|
|
|
userLoginRecordService.saveUserLoginDayRecord(user.getId());
|
|
userLoginRecordService.saveUserLoginDayRecord(user.getId());
|
|
@@ -950,7 +951,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
/**
|
|
/**
|
|
|
* 查找渠道是否有设置了对应的claude code优惠码
|
|
* 查找渠道是否有设置了对应的claude code优惠码
|
|
|
*/
|
|
*/
|
|
|
- public void handlerSpecialPopularize(Long sharedId, Long dsPopularizeId, User user, Boolean isNewUser) {
|
|
|
|
|
|
|
+ public void handlerSpecialPopularize(Long sharedId, Long dsPopularizeId, User user, Boolean isNewUser, Boolean isNano) {
|
|
|
if (!isNewUser) {
|
|
if (!isNewUser) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -1002,22 +1003,21 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
Integer selectCount = couponDistributePopularizeMapper.selectCount(Wrappers.lambdaQuery(CouponDistributePopularize.class).eq(CouponDistributePopularize::getDistributeId, userDistribute.getId()).eq(CouponDistributePopularize::getDeleted, Boolean.TRUE).eq(CouponDistributePopularize::getCouponId, Constant.DISTRIBUTE_NANO_COUPON_ID));
|
|
Integer selectCount = couponDistributePopularizeMapper.selectCount(Wrappers.lambdaQuery(CouponDistributePopularize.class).eq(CouponDistributePopularize::getDistributeId, userDistribute.getId()).eq(CouponDistributePopularize::getDeleted, Boolean.TRUE).eq(CouponDistributePopularize::getCouponId, Constant.DISTRIBUTE_NANO_COUPON_ID));
|
|
|
if (selectCount > 0) {
|
|
if (selectCount > 0) {
|
|
|
//设置了 直接发送优惠券
|
|
//设置了 直接发送优惠券
|
|
|
- Boolean b = couponCommonService.sendCouponToUser(user.getId(), Constant.DISTRIBUTE_NANO_COUPON_ID, 0l, 0l, dsPopularizeId, CouponUser.Channel.manual);
|
|
|
|
|
- if (!b) {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- if (redisService.setNx(RedisService.key.NANO_TY_DAY_CARD_KEY.getName() + user.getId(), user.getId(), RedisService.key.NANO_TY_DAY_CARD_KEY.getTimeout())) {
|
|
|
|
|
- Integer receiveRecord = nanoUserTrialReceiveRecordMapper.selectCount(Wrappers.lambdaQuery(NanoUserTrialReceiveRecord.class).eq(NanoUserTrialReceiveRecord::getUserId, user.getId()));
|
|
|
|
|
- if (receiveRecord > 0) {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- //发送nano 体验卡
|
|
|
|
|
- Long relationId = groupRelationFrontService.getTrialTicketByUserIdAndGoodsId(user.getId(), Constant.DISTRIBUTE_NANO_TRIAL_SKU_ID, 1);
|
|
|
|
|
- recordReceiveNanoRecord(user.getId(), relationId);
|
|
|
|
|
- //创建nano user
|
|
|
|
|
- createNanoUser(user.getId(), relationId, goodsDonSkuMapper.selectById(Constant.DISTRIBUTE_NANO_TRIAL_SKU_ID));
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ couponCommonService.sendCouponToUser(user.getId(), Constant.DISTRIBUTE_NANO_COUPON_ID, 0l, 0l, dsPopularizeId, CouponUser.Channel.manual);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (isNano != null && isNano) {
|
|
|
|
|
+ if (redisService.setNx(RedisService.key.NANO_TY_DAY_CARD_KEY.getName() + user.getId(), user.getId(), RedisService.key.NANO_TY_DAY_CARD_KEY.getTimeout())) {
|
|
|
|
|
+ Integer receiveRecord = nanoUserTrialReceiveRecordMapper.selectCount(Wrappers.lambdaQuery(NanoUserTrialReceiveRecord.class).eq(NanoUserTrialReceiveRecord::getUserId, user.getId()));
|
|
|
|
|
+ if (receiveRecord > 0) {
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
|
|
+ //发送nano 体验卡
|
|
|
|
|
+ Long relationId = groupRelationFrontService.getTrialTicketByUserIdAndGoodsId(user.getId(), Constant.DISTRIBUTE_NANO_TRIAL_SKU_ID, 1);
|
|
|
|
|
+ recordReceiveNanoRecord(user.getId(), relationId);
|
|
|
|
|
+ //创建nano user
|
|
|
|
|
+ createNanoUser(user.getId(), relationId, goodsDonSkuMapper.selectById(Constant.DISTRIBUTE_NANO_TRIAL_SKU_ID));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|