This commit is contained in:
磷叶 2024-10-21 14:46:48 +08:00
parent 72c8a68c39
commit 7984840603
3 changed files with 29 additions and 18 deletions

View File

@ -9,7 +9,6 @@ import com.ruoyi.ss.user.domain.dto.UserRealNameDTO;
import com.ruoyi.ss.user.domain.vo.UserRealNameVO;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
/**
@ -252,4 +251,11 @@ public interface ISmUserService
* @param mobileCode 微信手机号临时授权码
*/
int bindWxMobile(Long userId, String mobileCode);
/**
* 风控实名认证
*
* @param userId@return
*/
UserRealNameVO riskRealName(Long userId);
}

View File

@ -354,19 +354,6 @@ public class SmUserServiceImpl implements ISmUserService
public UserRealNameVO realName(UserRealNameDTO dto) {
SmUserVo user = selectSmUserByUserId(dto.getUserId());
ServiceUtil.assertion(user == null, "用户信息不存在");
// 若用户已经实名则需要用户填写一样的实名信息
if (user.getIsReal()) {
if (user.getRealName() != null) {
dto.setRealName(user.getRealName());
}
if (user.getRealPhone() != null) {
dto.setRealPhone(user.getRealPhone());
}
if (user.getRealIdCard() != null) {
dto.setRealIdCard(user.getRealIdCard());
}
}
ServiceUtil.assertion(StringUtils.isBlank(dto.getRealName()), "用户姓名不允许为空");
ServiceUtil.assertion(StringUtils.isBlank(dto.getRealIdCard()), "用户身份证不允许为空");
@ -583,6 +570,27 @@ public class SmUserServiceImpl implements ISmUserService
return result == null ? 0 : result;
}
@Override
public UserRealNameVO riskRealName(Long userId) {
UserRealNameDTO dto = new UserRealNameDTO();
dto.setType(RealNameType.RISK.getType());
dto.setUserId(userId);
SmUserVo user = this.selectSmUserByUserId(dto.getUserId());
if (user.getIsReal()) {
if (user.getRealName() != null) {
dto.setRealName(user.getRealName());
}
if (user.getRealPhone() != null) {
dto.setRealPhone(user.getRealPhone());
}
if (user.getRealIdCard() != null) {
dto.setRealIdCard(user.getRealIdCard());
}
}
return this.realName(dto);
}
private int selectCountByPhone(String phone) {
return smUserMapper.selectCountByPhone(phone);
}

View File

@ -110,10 +110,7 @@ public class AppUserController extends BaseController {
@ApiOperation("用户风控实名认证")
@PutMapping("/riskRealName")
public AjaxResult riskRealName() {
UserRealNameDTO dto = new UserRealNameDTO();
dto.setType(RealNameType.RISK.getType());
dto.setUserId(getUserId());
return success(userService.realName(dto));
return success(userService.riskRealName(getUserId()));
}
@ApiOperation("刷新用户实名认证结果")