diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/user/service/ISmUserService.java b/smart-switch-service/src/main/java/com/ruoyi/ss/user/service/ISmUserService.java index 7a04fc26..753a5241 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/user/service/ISmUserService.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/user/service/ISmUserService.java @@ -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); } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/user/service/impl/SmUserServiceImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/user/service/impl/SmUserServiceImpl.java index e0116005..d2ed434c 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/user/service/impl/SmUserServiceImpl.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/user/service/impl/SmUserServiceImpl.java @@ -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); } diff --git a/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppUserController.java b/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppUserController.java index ef2b4b76..4e1db6aa 100644 --- a/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppUserController.java +++ b/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppUserController.java @@ -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("刷新用户实名认证结果")