|
@@ -79,17 +79,17 @@ public class UserAuthenticationFacade extends UserAuthenticationServiceImpl {
|
|
userAuthentication.setCreator(userId.toString());
|
|
userAuthentication.setCreator(userId.toString());
|
|
userAuthentication.setGmtCreate(new Date());
|
|
userAuthentication.setGmtCreate(new Date());
|
|
userAuthentication.setUserId(userId);
|
|
userAuthentication.setUserId(userId);
|
|
- } else if (userAuthentication.getStatus() == 1) {
|
|
|
|
|
|
+ } else if (userAuthentication.getStatus().equals(AuthStatusEnum.Authorized.getKey())) {
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
"用户【" + user.getUsername() + "】已认证,不允许重复认证");
|
|
"用户【" + user.getUsername() + "】已认证,不允许重复认证");
|
|
- } else if (userAuthentication.getStatus() == 2) {
|
|
|
|
|
|
+ } else if (userAuthentication.getStatus().equals(AuthStatusEnum.Authorizing.getKey())) {
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
"认证申请已提交,无需重复提交");
|
|
"认证申请已提交,无需重复提交");
|
|
}
|
|
}
|
|
userAuthentication.setModifier(userId.toString());
|
|
userAuthentication.setModifier(userId.toString());
|
|
userAuthentication.setGmtModified(new Date());
|
|
userAuthentication.setGmtModified(new Date());
|
|
userAuthentication.setPosition(userAuthenticationVO.getPosition());
|
|
userAuthentication.setPosition(userAuthenticationVO.getPosition());
|
|
- userAuthentication.setStatus(2); //状态设为认证中
|
|
|
|
|
|
+ userAuthentication.setStatus(AuthStatusEnum.Authorizing.getKey()); //状态设为认证中
|
|
this.saveOrUpdate(userAuthentication);
|
|
this.saveOrUpdate(userAuthentication);
|
|
|
|
|
|
userAuthenticationDTO.setUser(user);
|
|
userAuthenticationDTO.setUser(user);
|
|
@@ -133,20 +133,20 @@ public class UserAuthenticationFacade extends UserAuthenticationServiceImpl {
|
|
map.put(99, "当前用户没有认证信息");
|
|
map.put(99, "当前用户没有认证信息");
|
|
} else {
|
|
} else {
|
|
Integer status = userAuthentication.getStatus();
|
|
Integer status = userAuthentication.getStatus();
|
|
- String statusName = "";
|
|
|
|
- switch (status) {
|
|
|
|
- case 0:
|
|
|
|
- statusName = AuthStatusEnum.Unauthorized.getName();
|
|
|
|
- break;
|
|
|
|
- case 1:
|
|
|
|
- statusName = AuthStatusEnum.Authorized.getName();
|
|
|
|
- break;
|
|
|
|
- case 2:
|
|
|
|
- statusName = AuthStatusEnum.Authorizing.getName();
|
|
|
|
- break;
|
|
|
|
- default:
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
|
|
+ String statusName = AuthStatusEnum.getName(status);
|
|
|
|
+// switch (status) {
|
|
|
|
+// case 0:
|
|
|
|
+// statusName = AuthStatusEnum.Unauthorized.getName();
|
|
|
|
+// break;
|
|
|
|
+// case 1:
|
|
|
|
+// statusName = AuthStatusEnum.Authorized.getName();
|
|
|
|
+// break;
|
|
|
|
+// case 2:
|
|
|
|
+// statusName = AuthStatusEnum.Authorizing.getName();
|
|
|
|
+// break;
|
|
|
|
+// default:
|
|
|
|
+// break;
|
|
|
|
+// }
|
|
map.put(status, statusName);
|
|
map.put(status, statusName);
|
|
}
|
|
}
|
|
return map;
|
|
return map;
|