|
|
@@ -107,7 +107,12 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
this.save(user);
|
|
|
//发放新用户福利
|
|
|
final Long fUid = user.getId();
|
|
|
- TASK_POOL.execute(() -> sendNewUserWelfare(fUid));
|
|
|
+ TASK_POOL.execute(() -> {
|
|
|
+ try {
|
|
|
+ sendNewUserWelfare(fUid);
|
|
|
+ } catch (Exception e) {
|
|
|
+ }
|
|
|
+ });
|
|
|
} else {
|
|
|
if (StrUtil.isEmpty(user.getRegisterEnv())) {
|
|
|
user.setRegisterEnv(registerEnv.name());
|
|
|
@@ -390,7 +395,12 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
}
|
|
|
//发放新用户福利
|
|
|
final Long fUid = user.getId();
|
|
|
- TASK_POOL.execute(() -> sendNewUserWelfare(fUid));
|
|
|
+ TASK_POOL.execute(() -> {
|
|
|
+ try {
|
|
|
+ sendNewUserWelfare(fUid);
|
|
|
+ } catch (Exception e) {
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
if (StrUtil.isEmpty(user.getShowId())) {
|
|
|
user.setShowId(getUserShowId(user.getId()));
|
|
|
@@ -402,10 +412,13 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
/**
|
|
|
* 发放新用户福利
|
|
|
*/
|
|
|
- public void sendNewUserWelfare(Long userId) {
|
|
|
+ public void sendNewUserWelfare(Long userId) throws Exception {
|
|
|
SysConfig newUserWelfareConfig = sysConfigService.getOne(Wrappers.lambdaQuery(SysConfig.class)
|
|
|
.eq(SysConfig::getSysKey, Constant.NEW_USER_WELFARE_KEY).last("limit 1"));
|
|
|
- NewUserWelfareDto newUserWelfareDto = Jsons.parseObject(newUserWelfareConfig, NewUserWelfareDto.class);
|
|
|
+ if (StrUtil.isEmpty(newUserWelfareConfig.getSysValue())) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ NewUserWelfareDto newUserWelfareDto = Jsons.parseObject(newUserWelfareConfig.getSysValue(), NewUserWelfareDto.class);
|
|
|
if (newUserWelfareDto != null) {
|
|
|
List<Long> couponIds = newUserWelfareDto.getCouponIds();
|
|
|
couponIds.forEach(couponId -> couponCommonService.sendCouponToUser(userId, couponId, null, null, null, CouponUser.Channel.new_welfare));
|