|
@@ -80,11 +80,11 @@ public class UserAuthenticationFacade extends UserAuthenticationServiceImpl {
|
|
|
userAuthentication.setCreator(userId.toString());
|
|
|
userAuthentication.setGmtCreate(new Date());
|
|
|
userAuthentication.setUserId(userId);
|
|
|
- } else if (userAuthentication.getStatus().equals("1")) {
|
|
|
+ } else if (userAuthentication.getStatus() == 1) {
|
|
|
userAuthenticationRespDTO.setMsg("用户【" + user.getUsername() + "】已认证,不允许重复认证!");
|
|
|
userAuthenticationRespDTO.setIsSuccess(false);
|
|
|
return userAuthenticationRespDTO;
|
|
|
- } else if (userAuthentication.getStatus().equals("2")) {
|
|
|
+ } else if (userAuthentication.getStatus() == 2) {
|
|
|
userAuthenticationRespDTO.setMsg("认证申请已提交,请耐心等待……");
|
|
|
userAuthenticationRespDTO.setIsSuccess(false);
|
|
|
return userAuthenticationRespDTO;
|
|
@@ -92,14 +92,16 @@ public class UserAuthenticationFacade extends UserAuthenticationServiceImpl {
|
|
|
userAuthentication.setModifier(userId.toString());
|
|
|
userAuthentication.setGmtModified(new Date());
|
|
|
userAuthentication.setPosition(userAuthenticationVO.getPosition());
|
|
|
- userAuthentication.setStatus("2"); //状态设为认证中
|
|
|
+ userAuthentication.setStatus(2); //状态设为认证中
|
|
|
this.saveOrUpdate(userAuthentication);
|
|
|
|
|
|
userAuthenticationRespDTO.setMsg("认证申请已提交成功,请耐心等待1~2个工作日");
|
|
|
userAuthenticationRespDTO.setIsSuccess(true);
|
|
|
- userAuthenticationRespDTO.getUserAuthenticationDTO().setUser(user);
|
|
|
- userAuthenticationRespDTO.getUserAuthenticationDTO().setOrganization(organization);
|
|
|
- userAuthenticationRespDTO.getUserAuthenticationDTO().setUserAuthentication(userAuthentication);
|
|
|
+ UserAuthenticationDTO userAuthenticationDTO = new UserAuthenticationDTO();
|
|
|
+ userAuthenticationDTO.setUser(user);
|
|
|
+ userAuthenticationDTO.setOrganization(organization);
|
|
|
+ userAuthenticationDTO.setUserAuthentication(userAuthentication);
|
|
|
+ userAuthenticationRespDTO.setUserAuthenticationDTO(userAuthenticationDTO);
|
|
|
return userAuthenticationRespDTO;
|
|
|
}
|
|
|
|
|
@@ -120,23 +122,23 @@ public class UserAuthenticationFacade extends UserAuthenticationServiceImpl {
|
|
|
return userAuthenticationDTO;
|
|
|
}
|
|
|
|
|
|
- public Map<String, Object> getUserAuthenticationStatus() {
|
|
|
+ public Map<Integer, Object> getUserAuthenticationStatus() {
|
|
|
Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
|
|
|
UserAuthentication userAuthentication = this.getByUserId(userId);
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
+ Map<Integer, Object> map = new HashMap<>();
|
|
|
if (userAuthentication == null) {
|
|
|
- map.put("msg", "当前用户没有认证信息");
|
|
|
+ map.put(99, "当前用户没有认证信息");
|
|
|
} else {
|
|
|
- String status = userAuthentication.getStatus();
|
|
|
+ Integer status = userAuthentication.getStatus();
|
|
|
String statusName = "";
|
|
|
switch (status) {
|
|
|
- case "0":
|
|
|
+ case 0:
|
|
|
statusName = AuthStatusEnum.Unauthorized.getName();
|
|
|
break;
|
|
|
- case "1":
|
|
|
+ case 1:
|
|
|
statusName = AuthStatusEnum.Authorized.getName();
|
|
|
break;
|
|
|
- case "2":
|
|
|
+ case 2:
|
|
|
statusName = AuthStatusEnum.Authorizing.getName();
|
|
|
break;
|
|
|
default:
|
|
@@ -146,31 +148,31 @@ public class UserAuthenticationFacade extends UserAuthenticationServiceImpl {
|
|
|
}
|
|
|
return map;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public QueryAuthProgressDTO queryAuthProgress() {
|
|
|
- QueryAuthProgressDTO queryAuthProgressDTO = new QueryAuthProgressDTO();
|
|
|
+ QueryAuthProgressDTO queryAuthProgressDTO = new QueryAuthProgressDTO();
|
|
|
Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
|
|
|
UserAuthentication userAuthentication = this.getByUserId(userId);
|
|
|
- String status = userAuthentication.getStatus();
|
|
|
+ Integer status = userAuthentication.getStatus();
|
|
|
String isReject = userAuthentication.getIsReject();
|
|
|
- if(StringUtils.isBlank(isReject)){
|
|
|
- if(status.equals("0")){
|
|
|
- queryAuthProgressDTO.setStatus("1");
|
|
|
- queryAuthProgressDTO.setStatusMessage("未认证");
|
|
|
- }else if(status.equals("2")){
|
|
|
- queryAuthProgressDTO.setStatus("2");
|
|
|
- queryAuthProgressDTO.setStatusMessage("认证中");
|
|
|
- }
|
|
|
- }else if(isReject.equals("N")){
|
|
|
- if(status.equals("0")){
|
|
|
- queryAuthProgressDTO.setStatus("3");
|
|
|
- queryAuthProgressDTO.setStatusMessage("认证未通过");
|
|
|
- }
|
|
|
- }else if(isReject.equals("Y")){
|
|
|
- if(status.equals("1")){
|
|
|
- queryAuthProgressDTO.setStatus("4");
|
|
|
- queryAuthProgressDTO.setStatusMessage("认证通过");
|
|
|
- }
|
|
|
+ if (StringUtils.isBlank(isReject)) {
|
|
|
+ if (status == 1) {
|
|
|
+ queryAuthProgressDTO.setStatus("1");
|
|
|
+ queryAuthProgressDTO.setStatusMessage("未认证");
|
|
|
+ } else if (status == 2) {
|
|
|
+ queryAuthProgressDTO.setStatus("2");
|
|
|
+ queryAuthProgressDTO.setStatusMessage("认证中");
|
|
|
+ }
|
|
|
+ } else if (isReject.equals("N")) {
|
|
|
+ if (status == 0) {
|
|
|
+ queryAuthProgressDTO.setStatus("3");
|
|
|
+ queryAuthProgressDTO.setStatusMessage("认证未通过");
|
|
|
+ }
|
|
|
+ } else if (isReject.equals("Y")) {
|
|
|
+ if (status == 1) {
|
|
|
+ queryAuthProgressDTO.setStatus("4");
|
|
|
+ queryAuthProgressDTO.setStatusMessage("认证通过");
|
|
|
+ }
|
|
|
}
|
|
|
return queryAuthProgressDTO;
|
|
|
}
|