|
@@ -65,9 +65,12 @@ public class User {
|
|
|
* @return
|
|
|
*/
|
|
|
public User applyAgencyAuthentication(EvaluationAgency evaluationAgency) {
|
|
|
- if (this.getEvaluationAgency()!=null || this.getPersonalAuthentication()!=null || this.getEnterpriseAuthentication()!=null)
|
|
|
+ if (this.getPersonalAuthentication()!=null || this.getEnterpriseAuthentication()!=null)
|
|
|
throw new BaseException("已有认证信息,不可再次认证");
|
|
|
- this.setEvaluationAgency(evaluationAgency.applyAuthentication(this.id));
|
|
|
+ if (this.getEvaluationAgency()!=null && this.getEvaluationAgency().getIsAuthentication() != AuthenticationStatus.isAuthenticated){
|
|
|
+ evaluationAgency.setId(this.getEvaluationAgency().getId());
|
|
|
+ this.setEvaluationAgency(evaluationAgency.applyAuthentication(this.id));
|
|
|
+ }
|
|
|
return this;
|
|
|
}
|
|
|
|
|
@@ -118,6 +121,7 @@ public class User {
|
|
|
return agencyUser;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -128,7 +132,9 @@ public class User {
|
|
|
public User updateAgencyAuthInfo(EvaluationAgency modifyAuth){
|
|
|
if (this.getEnterpriseAuthentication()!=null || this.getPersonalAuthentication()!=null)
|
|
|
throw new BaseException("已有其他认证信息,不可对认证未企业用户");
|
|
|
-
|
|
|
+ if (this.getEvaluationAgency().getIsAuthentication() == AuthenticationStatus.isAuthenticated){
|
|
|
+ throw new BaseException("已通过认证,不可修改认证信息");
|
|
|
+ }
|
|
|
this.getEvaluationAgency().updateAuthInfo(modifyAuth);
|
|
|
return this;
|
|
|
}
|
|
@@ -138,7 +144,10 @@ public class User {
|
|
|
* @return
|
|
|
*/
|
|
|
public User deleteAgencyAuthInfo() {
|
|
|
- this.getEvaluationAgency().deleteAuth();
|
|
|
+ EvaluationAgency evaluationAgency = this.getEvaluationAgency();
|
|
|
+// RoleConfiguration roleConfiguration = new RoleConfiguration();
|
|
|
+// final Long num = roleConfiguration.getGeneralUser();
|
|
|
+ evaluationAgency.deleteAuth();
|
|
|
return this;
|
|
|
}
|
|
|
|
|
@@ -148,9 +157,12 @@ public class User {
|
|
|
* @return
|
|
|
*/
|
|
|
public User applyPersonalAuthentication(PersonalAuthentication personalAuth) {
|
|
|
- if (this.getEvaluationAgency()!=null || this.getPersonalAuthentication()!=null || this.getEnterpriseAuthentication()!=null)
|
|
|
+ if (this.getEvaluationAgency()!=null || this.getEnterpriseAuthentication()!=null)
|
|
|
throw new BaseException("已有认证信息,不可再次认证");
|
|
|
- this.setPersonalAuthentication(personalAuth.applyAuthentication(this.id));
|
|
|
+ if (this.getPersonalAuthentication()!=null && this.getPersonalAuthentication().getIsAuthentication() != AuthenticationStatus.isAuthenticated){
|
|
|
+ personalAuth.setId(this.getPersonalAuthentication().getId());
|
|
|
+ this.setPersonalAuthentication(personalAuth.applyAuthentication(this.id));
|
|
|
+ }
|
|
|
return this;
|
|
|
}
|
|
|
|
|
@@ -170,11 +182,6 @@ public class User {
|
|
|
}else{
|
|
|
personalAuth.passAuthentication();
|
|
|
return personalUser;
|
|
|
-// List<Role> roleList = this.getRoleList();
|
|
|
-// Role role = new Role();
|
|
|
-// role.setId(1L);
|
|
|
-// roleList.add(role);
|
|
|
-// this.setRoleList(roleList);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -210,7 +217,9 @@ public class User {
|
|
|
public User updatePersonalAuthInfo(PersonalAuthentication modifyAuth){
|
|
|
if (this.getEvaluationAgency()!=null || this.getEnterpriseAuthentication()!=null)
|
|
|
throw new BaseException("已有其他认证信息,不可对个人认证进行操作");
|
|
|
-
|
|
|
+ if (this.getPersonalAuthentication().getIsAuthentication() == AuthenticationStatus.isAuthenticated){
|
|
|
+ throw new BaseException("已通过认证,不可修改认证信息");
|
|
|
+ }
|
|
|
this.getPersonalAuthentication().updateAuthInfo(modifyAuth);
|
|
|
return this;
|
|
|
}
|
|
@@ -231,7 +240,10 @@ public class User {
|
|
|
public User applyEnterpriseAuthentication(EnterpriseAuthentication enterpriseAuth) {
|
|
|
if (this.getEvaluationAgency()!=null || this.getPersonalAuthentication()!=null || this.getEnterpriseAuthentication()!=null)
|
|
|
throw new BaseException("已有认证信息,不可再次认证");
|
|
|
- this.setEnterpriseAuthentication(enterpriseAuth.applyAuthentication(this.id));
|
|
|
+ if (this.getEnterpriseAuthentication()!=null && this.getEnterpriseAuthentication().getIsAuthentication() != AuthenticationStatus.isAuthenticated){
|
|
|
+ enterpriseAuth.setId(this.getEnterpriseAuthentication().getId());
|
|
|
+ this.setEnterpriseAuthentication(enterpriseAuth.applyAuthentication(this.id));
|
|
|
+ }
|
|
|
return this;
|
|
|
}
|
|
|
|
|
@@ -291,7 +303,9 @@ public class User {
|
|
|
public User updateEnterpriseAuthInfo(EnterpriseAuthentication modifyAuth){
|
|
|
if (this.getEvaluationAgency()!=null || this.getPersonalAuthentication()!=null)
|
|
|
throw new BaseException("已有其他认证信息,不可对认证未企业用户");
|
|
|
-
|
|
|
+ if (this.getEnterpriseAuthentication().getIsAuthentication() == AuthenticationStatus.isAuthenticated){
|
|
|
+ throw new BaseException("已通过认证,不可修改认证信息");
|
|
|
+ }
|
|
|
this.getEnterpriseAuthentication().updateAuthInfo(modifyAuth);
|
|
|
return this;
|
|
|
}
|