Commit 6e512373 authored by hezhen's avatar hezhen

修改实名认证

parent aaaee09f
......@@ -38,6 +38,7 @@ public interface UserFeign {
*/
@RequestMapping(value = "/api/app/user/authentication", method = RequestMethod.POST)
public ObjectRestResponse authentication( @RequestParam(value="userId")Integer userId,
@RequestParam(value="name")String name,
@RequestParam(value="idNumber")String idNumber,
@RequestParam(value="status")Integer status);
......
......@@ -42,12 +42,12 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
}
@Override
@CacheClear(pre="user{1.username}")
@CacheClear(pre="user{1.id}")
public void updateSelectiveById(AppUserLogin entity) {
super.updateSelectiveById(entity);
}
@CacheClear(pre="user{1.username}")
@CacheClear(pre="user{1.id}")
public void updatePasswordById(AppUserLogin entity) {
String password = new BCryptPasswordEncoder(UserConstant.PW_ENCORDER_SALT).encode(entity.getPassword());
entity.setPassword(password);
......
......@@ -164,10 +164,11 @@ public class AppUserRest {
@RequestMapping(value = "/user/authentication", method = RequestMethod.POST)
public @ResponseBody ObjectRestResponse authentication(
@RequestParam(value="userId",defaultValue="0")Integer userId,
@RequestParam(value="name",defaultValue="")String name,
@RequestParam(value="idNumber",defaultValue="")String idNumber,
@RequestParam(value="status",defaultValue="0")Integer status
){
return appPermissionService.upAuthentication(userId,idNumber,status);
return appPermissionService.upAuthentication(userId,name,idNumber,status);
}
......
......@@ -543,26 +543,28 @@ public class AppPermissionService {
//实名认证
@Transactional
public ObjectRestResponse upAuthentication(Integer userid, String idNumber, Integer status) {
if (userid == null || userid == 0 || (status == 1 && StringUtils.isBlank(idNumber))) {
public ObjectRestResponse upAuthentication(Integer userid, String name,String idNumber, Integer status) {
if (userid == null || userid == 0 || (status == 1 && StringUtils.isBlank(idNumber)&& StringUtils.isBlank(name))) {
return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE, "参数为空");
}
try {
AppUserLogin user = appUserLoginBiz.getUserById(userid);
if (user == null) {
AppUserVo userVo = appUserDetailBiz.getUserInfoById(userid);
if (userVo == null) {
return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE, "用户不存在");
}
if (user.getCertificationStatus() == 1) {
return ObjectRestResponse.createFailedResultWithObj(ResultCode.EXIST_CODE, "用户已认证", user.getIdNumber());
if (userVo.getCertificationStatus() == 1) {
return ObjectRestResponse.createFailedResultWithObj(ResultCode.EXIST_CODE, "用户已认证", userVo.getIdNumber());
}
if (status == 1) {
String username = user.getUsername();
user = new AppUserLogin();
AppUserLogin user = new AppUserLogin();
user.setId(userid);
user.setUsername(username);
user.setIdNumber(idNumber);
user.setCertificationStatus(1);
appUserLoginBiz.updateSelectiveById(user);
userVo=new AppUserVo();
userVo.setId(userVo.getId());
userVo.setRealname(name);
appUserDetailBiz.updUuserInfoById(userVo);
}
return ObjectRestResponse.succ();
} catch (Exception e) {
......
......@@ -19,7 +19,7 @@ import java.util.Date;
/**
* 证件信息表
*/
@Table(name = "app_user_login")
@Table(name = "id_information")
@Data
public class IdInformation implements Serializable {
......
......@@ -68,7 +68,7 @@ public class CertificationController {
//获取用户认证信息
ObjectRestResponse orr = userFeign.authentication(idInformation.getUserLonginId(), null, 0);
ObjectRestResponse orr = userFeign.authentication(idInformation.getUserLonginId(), null,null, 0);
if (orr==null) {
return ObjectRestResponse.createFailedResult(ResultCode.GET_AUTH_INFO_FAILED_CODE,"获取用户认证信息失败");
......
......@@ -474,7 +474,7 @@ public class CertificationService {
//认证成功后修改用户,用户认证状态
ObjectRestResponse authentication = userFeign.authentication(idInformation.getUserLonginId(), idInformation.getIdNumber(), 1);
ObjectRestResponse authentication = userFeign.authentication(idInformation.getUserLonginId(), idInformation.getName(),idInformation.getIdNumber(), 1);
return authentication.getRel();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment