Compare commits

..

2 Commits

@ -168,21 +168,6 @@ public class MyController extends BaseController {
} }
} }
Integer point = 0;
// 信息是否已完善
if (StringUtils.isNotBlank(userInfoUpdateDto.getBirthDay())
&& StringUtils.isNotBlank(userInfoUpdateDto.getNickName())
&& !Objects.isNull(userInfoUpdateDto.getSex())
&& StringUtils.isNotBlank(userInfoUpdateDto.getBirthDay())
) {
point = userPointLogService.addByTaskNew(TaskPointIdConstants.MODIFY_INFORMATION, authorization);
}
if (StringUtils.isNotBlank(userInfoUpdateDto.getInvitationCode()) && StringUtils.isBlank(user.getInvitationUserId())) {
// 只有没有被邀请过的才会触发,再次修改无效
userInfoService.bindInvitationCode(user, userInfoUpdateDto.getInvitationCode());
}
if (!StringTools.isEmpty(nickName)) { if (!StringTools.isEmpty(nickName)) {
user.setNickName(nickName); user.setNickName(nickName);
rabbitTemplate.convertAndSend("userInfoCommentCache", userLoginDto.getUserId()); rabbitTemplate.convertAndSend("userInfoCommentCache", userLoginDto.getUserId());
@ -201,9 +186,25 @@ public class MyController extends BaseController {
if (null != userInfoUpdateDto.getSex()) { if (null != userInfoUpdateDto.getSex()) {
user.setSex(userInfoUpdateDto.getSex()); user.setSex(userInfoUpdateDto.getSex());
} }
user.setModifyTime(new Date()); user.setModifyTime(new Date());
userInfoService.update(user); userInfoService.update(user);
Integer point = 0;
// 信息是否已完善
if (user.getBirthday() != null
&& StringUtils.isNotBlank(user.getNickName())
&& !Objects.isNull(user.getSex())
&& StringUtils.isNotBlank(user.getSignature())
) {
point = userPointLogService.addByTaskNew(TaskPointIdConstants.MODIFY_INFORMATION, authorization);
}
if (StringUtils.isNotBlank(userInfoUpdateDto.getInvitationCode()) && StringUtils.isBlank(user.getInvitationUserId())) {
// 只有没有被邀请过的才会触发,再次修改无效
userInfoService.bindInvitationCode(user, userInfoUpdateDto.getInvitationCode());
}
return Result.success(point > 0 ? "更新成功,获得" + point + "积分" : "更新成功"); return Result.success(point > 0 ? "更新成功,获得" + point + "积分" : "更新成功");
} }

@ -2,22 +2,13 @@ package com.luoo.user.service;
import api.PageResult; import api.PageResult;
import client.vo.SimpleUser; import client.vo.SimpleUser;
import com.luoo.user.dao.UserBankDao; import com.luoo.user.dao.*;
import com.luoo.user.dao.UserInfoDao;
import com.luoo.user.dao.UserPointLogDao;
import com.luoo.user.dao.UserRealNameDao;
import com.luoo.user.dao.WithdrawDao;
import com.luoo.user.dto.UserInfoUpdateDto;
import com.luoo.user.dto.UserQueryReq; import com.luoo.user.dto.UserQueryReq;
import com.luoo.user.dto.UserRealNameCheckDto; import com.luoo.user.dto.UserRealNameCheckDto;
import com.luoo.user.dto.UserRealNameFormDto; import com.luoo.user.dto.UserRealNameFormDto;
import com.luoo.user.dto.bank.UserBankAddDto; import com.luoo.user.dto.bank.UserBankAddDto;
import com.luoo.user.dto.request.LoginReq; import com.luoo.user.dto.request.LoginReq;
import com.luoo.user.pojo.UserBank; import com.luoo.user.pojo.*;
import com.luoo.user.pojo.UserInfo;
import com.luoo.user.pojo.UserPointLog;
import com.luoo.user.pojo.UserRealName;
import com.luoo.user.pojo.Withdraw;
import com.luoo.user.util.NickNameUtil; import com.luoo.user.util.NickNameUtil;
import com.luoo.user.util.NickNameUtil2; import com.luoo.user.util.NickNameUtil2;
import constants.Constants; import constants.Constants;
@ -31,7 +22,6 @@ import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.RandomStringUtils;
import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
@ -303,22 +293,22 @@ public class UserInfoService {
userInfoDaoByInvitationCode.getId()); userInfoDaoByInvitationCode.getId());
userPointLogService.addByTaskDailyAndUserId(TaskPointIdConstants.NEW_USER_INVITE, userPointLogService.addByTaskDailyAndUserId(TaskPointIdConstants.NEW_USER_INVITE,
userInfo.getId()); userInfo.getId());
}
List<UserPointLog> list = userPointLogDao.findUserPointLogsByUserIdAndTaskPointId( List<UserPointLog> list = userPointLogDao.findUserPointLogsByUserIdAndTaskPointId(
userInfoDaoByInvitationCode.getId(), TaskPointIdConstants.NEW_USER_INVITE); userInfoDaoByInvitationCode.getId(), TaskPointIdConstants.NEW_USER_INVITE);
if (list.size() == 3) { if (list.size() == 3) {
userPointLogService.addByTaskDailyAndUserId(TaskPointIdConstants.INVITE_USER_3, userPointLogService.addByTaskDailyAndUserId(TaskPointIdConstants.INVITE_USER_3,
userInfoDaoByInvitationCode.getId()); userInfoDaoByInvitationCode.getId());
} else if (list.size() == 6) { } else if (list.size() == 6) {
userPointLogService.addByTaskDailyAndUserId(TaskPointIdConstants.INVITE_USER_6, userPointLogService.addByTaskDailyAndUserId(TaskPointIdConstants.INVITE_USER_6,
userInfoDaoByInvitationCode.getId()); userInfoDaoByInvitationCode.getId());
} else if (list.size() == 10) { } else if (list.size() == 10) {
userPointLogService.addByTaskDailyAndUserId(TaskPointIdConstants.INVITE_USER_10, userPointLogService.addByTaskDailyAndUserId(TaskPointIdConstants.INVITE_USER_10,
userInfoDaoByInvitationCode.getId()); userInfoDaoByInvitationCode.getId());
} else if (list.size() == 20) { } else if (list.size() == 20) {
userPointLogService.addByTaskDailyAndUserId(TaskPointIdConstants.INVITE_USER_20, userPointLogService.addByTaskDailyAndUserId(TaskPointIdConstants.INVITE_USER_20,
userInfoDaoByInvitationCode.getId()); userInfoDaoByInvitationCode.getId());
}
} }
} }

Loading…
Cancel
Save