|
@@ -1,6 +1,7 @@
|
|
|
package com.mooctest.crowd.domain.domainobject;
|
|
|
|
|
|
import com.mooctest.crowd.domain.exception.BaseException;
|
|
|
+import com.mooctest.crowd.domain.model.EnterpriseAuthenticationPO;
|
|
|
import lombok.Data;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
@@ -26,6 +27,7 @@ public class EnterpriseAuthentication {
|
|
|
private String explain;
|
|
|
private Timestamp applyTime;
|
|
|
private Timestamp checkTime;
|
|
|
+ private Timestamp IDCardDeadTime;//身份证过期时间
|
|
|
|
|
|
@Override
|
|
|
public String toString() {
|
|
@@ -43,6 +45,17 @@ public class EnterpriseAuthentication {
|
|
|
'}';
|
|
|
}
|
|
|
|
|
|
+ public EnterpriseAuthentication getByPo(EnterpriseAuthenticationPO enterpriseAuthenticationPO) {
|
|
|
+ this.applyTime = enterpriseAuthenticationPO.getApplyTime();
|
|
|
+ this.businessLicensePhoto = enterpriseAuthenticationPO.getBusinessLicensePhoto();
|
|
|
+
|
|
|
+ this.legalPersonName = enterpriseAuthenticationPO.getLegalPersonName();
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
public EnterpriseAuthentication applyAuthentication(Long userId) {
|
|
|
this.setUserId(userId);
|
|
|
this.setIsAuthentication(AuthenticationStatus.isAuthenIng);
|
|
@@ -54,28 +67,27 @@ public class EnterpriseAuthentication {
|
|
|
}
|
|
|
|
|
|
public EnterpriseAuthentication passAuthentication() {
|
|
|
- if(this.getIsAuthentication() == AuthenticationStatus.isNotAuthenticated){
|
|
|
+ if (this.getIsAuthentication() == AuthenticationStatus.isNotAuthenticated) {
|
|
|
throw new BaseException("当前是未通过认证状态,不可通过认证,需对认证信息进行修改后再提交认证申请");
|
|
|
- }else if(this.getIsAuthentication() == AuthenticationStatus.isAuthenticated){
|
|
|
+ } else if (this.getIsAuthentication() == AuthenticationStatus.isAuthenticated) {
|
|
|
throw new BaseException("当前已通过认证,不可再次进行认证");
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.setIsAuthentication(AuthenticationStatus.isAuthenticated);
|
|
|
this.setCheckTime(new Timestamp(System.currentTimeMillis()));
|
|
|
this.setExplain("");
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
public EnterpriseAuthentication rejectAuthentication(String explain) {
|
|
|
- if(this.getIsDeleted() == DeletedStatus.isDeleted){
|
|
|
+ if (this.getIsDeleted() == DeletedStatus.isDeleted) {
|
|
|
throw new BaseException("当前认证信息已被删除,不可做认证状态改变操作");
|
|
|
- }else {
|
|
|
- if(this.getIsAuthentication() == AuthenticationStatus.isNotAuthenticated){
|
|
|
+ } else {
|
|
|
+ if (this.getIsAuthentication() == AuthenticationStatus.isNotAuthenticated) {
|
|
|
throw new BaseException("当前已是未通过认证状态,不可再次拒绝认证");
|
|
|
- }else if(this.getIsAuthentication() == AuthenticationStatus.isAuthenticated){
|
|
|
+ } else if (this.getIsAuthentication() == AuthenticationStatus.isAuthenticated) {
|
|
|
throw new BaseException("当前已通过认证,不可拒绝认证");
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
this.setIsAuthentication(AuthenticationStatus.isNotAuthenticated);
|
|
|
this.setExplain(explain);
|
|
|
this.setCheckTime(new Timestamp(System.currentTimeMillis()));
|
|
@@ -87,7 +99,7 @@ public class EnterpriseAuthentication {
|
|
|
public EnterpriseAuthentication updateAuthInfo(EnterpriseAuthentication modifyAuth) {
|
|
|
modifyAuth.userId = this.userId;
|
|
|
modifyAuth.id = this.id;
|
|
|
- BeanUtils.copyProperties(modifyAuth,this);
|
|
|
+ BeanUtils.copyProperties(modifyAuth, this);
|
|
|
this.setIsAuthentication(AuthenticationStatus.isAuthenIng);
|
|
|
this.setIsDeleted(DeletedStatus.isNotDeleted);
|
|
|
this.setApplyTime(new Timestamp(System.currentTimeMillis()));
|