release- 单个属性提交也能校验是否获取更新个人信息积分

release-2024-04-25
pikaqiudeshujia 1 day ago
parent 25e200a0e6
commit d7e54cc751

@ -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)) {
user.setNickName(nickName);
rabbitTemplate.convertAndSend("userInfoCommentCache", userLoginDto.getUserId());
@ -201,9 +186,25 @@ public class MyController extends BaseController {
if (null != userInfoUpdateDto.getSex()) {
user.setSex(userInfoUpdateDto.getSex());
}
user.setModifyTime(new Date());
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 + "积分" : "更新成功");
}

@ -2,22 +2,13 @@ package com.luoo.user.service;
import api.PageResult;
import client.vo.SimpleUser;
import com.luoo.user.dao.UserBankDao;
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.dao.*;
import com.luoo.user.dto.UserQueryReq;
import com.luoo.user.dto.UserRealNameCheckDto;
import com.luoo.user.dto.UserRealNameFormDto;
import com.luoo.user.dto.bank.UserBankAddDto;
import com.luoo.user.dto.request.LoginReq;
import com.luoo.user.pojo.UserBank;
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.pojo.*;
import com.luoo.user.util.NickNameUtil;
import com.luoo.user.util.NickNameUtil2;
import constants.Constants;
@ -31,7 +22,6 @@ import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
@ -303,7 +293,6 @@ public class UserInfoService {
userInfoDaoByInvitationCode.getId());
userPointLogService.addByTaskDailyAndUserId(TaskPointIdConstants.NEW_USER_INVITE,
userInfo.getId());
}
List<UserPointLog> list = userPointLogDao.findUserPointLogsByUserIdAndTaskPointId(
userInfoDaoByInvitationCode.getId(), TaskPointIdConstants.NEW_USER_INVITE);
@ -320,6 +309,7 @@ public class UserInfoService {
userPointLogService.addByTaskDailyAndUserId(TaskPointIdConstants.INVITE_USER_20,
userInfoDaoByInvitationCode.getId());
}
}
}
}

Loading…
Cancel
Save