Browse Source

企业认证个人认证代码修改。。。

xuxuan 5 years ago
parent
commit
5a964ff98a

+ 1 - 0
core/src/main/java/com/mooctest/crowd/domain/domainobject/EnterpriseAuthentication.java

@@ -13,6 +13,7 @@ import java.sql.Timestamp;
  */
 @Data
 public class EnterpriseAuthentication {
+    private  String isDaOrEa;//是研发机构还是评测机构
     private Long id;
     private Long userId;
     private String IDCardNum;//身份证号码

+ 19 - 14
core/src/main/java/com/mooctest/crowd/domain/model/EnterpriseAuthenticationPO.java

@@ -11,49 +11,54 @@ import java.sql.Timestamp;
  */
 @Data
 @Entity
-@Table(name = "enterprise_authentication")
+@Table(name = "develop_authentication")
 public class EnterpriseAuthenticationPO {
 
     @Id
-    @Column(name = "EA_ID")
+    @Column(name = "DA_ID")
     @GeneratedValue(strategy = GenerationType.IDENTITY)
     private Long id;
 
-    @Column(name = "EA_USER_ID")
+    @Column(name = "DA_USER_ID")
     private Long userId;
 
-    @Column(name = "EA_ENTERPRISE_NAME")
+    @Column(name = "DA_NAME")
     private String enterpriseName;
 
-    @Column(name = "EA_LEGAL_PERSON_NAME")
+    @Column(name = "DA_LEGAL_PERSON_NAME")
     private String legalPersonName;
 
-    @Column(name = "EA_BUSINESS_LICENSE_PHOTO")
+    @Column(name = "DA_BUSINESS_LICENSE_PHOTO")
     private String businessLicensePhoto;
 
-    @Column(name = "EA_UNIFIED_SOCIAL_CREDIT_CODE")
+    @Column(name = "DA_UNIFIED_SOCIAL_CREDIT_CODE")
     private String unifiedSocialCreditCode;
 
-    @Column(name = "EA_BANK_ACCOUNT")
+    @Column(name = "DA_BANK_ACCOUNT")
     private String bankAccount;
 
-    @Column(name = "EA_ADDRESS")
+    @Column(name = "DA_ADDRESS")
     private String address;
 
-    @Column(name = "EA_IS_DELETED")
+    @Column(name = "DA_IS_DELETED")
     private int isDeleted;
 
-    @Column(name = "EA_IS_AUTHENTICATION")
+    @Column(name = "DA_IS_AUTHENTICATION")
     private int isAuthentication;
 
-    @Column(name = "EA_NOT_PASS_EXPLAIN")
+    @Column(name = "DA_NOT_PASS_EXPLAIN")
     private String explain;
 
-    @Column(name = "EA_CHECK_TIME")
+    @Column(name = "DA_CHECK_TIME")
     private Timestamp checkTime;
 
-    @Column(name = "EA_APPLY_TIME")
+    @Column(name = "DA_APPLY_TIME")
     private Timestamp applyTime;
 
 
+    @Column(name = "DA_ID_CARD_BACK_PHOTO")
+    private String IDCardBackPhoto;
+    @Column(name = "DA_ID_CARD_POS_PHOTO")
+    private String IDcardPositivePhoto;
+
 }

+ 6 - 2
core/src/main/java/com/mooctest/crowd/domain/model/PersonalAuthenticationPO.java

@@ -53,16 +53,20 @@ public class PersonalAuthenticationPO {
     private Timestamp checkTime;
 
     @Column(name = "PA_ID_CARD_POS_PHOTO")
-    private String  idCardPositivePhoto;//身份证正面照片
+    private String  IDCardPositivePhoto;//身份证正面照片
 
 
     @Column(name = "PA_ID_CARD_BACK_PHOTO")
-    private String  idCardBackPhoto;//身份证正面照片
+    private String  IDCardBackPhoto;//身份证正面照片
 
 
     @Column(name = "PA_EXPIRE_TIME")
     private Timestamp  IDCardDeadTime;
 
 
+    @Column(name = "PA_Sex")
+    private  String  sex;
+
+
 
 }

+ 14 - 1
core/src/main/java/com/mooctest/crowd/domain/repository/UserRepo.java

@@ -12,6 +12,7 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import javax.security.auth.login.Configuration;
 import java.sql.Timestamp;
 import java.util.ArrayList;
 import java.util.List;
@@ -24,6 +25,8 @@ import java.util.Optional;
 
 @Component
 public class UserRepo implements IUserRepo {
+    @Autowired
+    private  EvaluationAgencyDao agencyDao;
 
     @Autowired
     private UserDao userDao;
@@ -255,13 +258,23 @@ public class UserRepo implements IUserRepo {
 
         /*实名认证保存个人信息*/
         if(user.getPersonalAuthentication() != null){
-            personalAuthenticationDao.save(Converter.convert(PersonalAuthenticationPO.class, user.getPersonalAuthentication()));
+            System.out.println("认证消息为==========="+user.getPersonalAuthentication());
+            PersonalAuthenticationPO authenticationPO = Converter.convert(PersonalAuthenticationPO.class, user.getPersonalAuthentication());
+            System.out.println("认证消息为PO==========="+authenticationPO);
+            personalAuthenticationDao.save(authenticationPO);
         }
 
         /*企业认证保存企业信息*/
         if(user.getEnterpriseAuthentication() != null){
+            if(user.getEnterpriseAuthentication().getIsDaOrEa().equals("研发机构")){
             enterpriseAuthenticationDao.save(Converter.convert(EnterpriseAuthenticationPO.class, user.getEnterpriseAuthentication()));
         }
+            else if(user.getEnterpriseAuthentication().getIsDaOrEa().equals("评测机构")){
+                agencyDao.save(Converter.convert(EvaluationAgencyPO.class,user.getEnterpriseAuthentication()));
+            }
+
+
+            }
 
         return getByID(userPO.getId());
     }

+ 0 - 1
site/src/main/java/com/mooctest/crowd/site/command/ApplyAgencyAuthCommand.java

@@ -5,7 +5,6 @@ import com.mooctest.crowd.domain.domainobject.EvaluationAgencyAbility;
 import com.mooctest.crowd.domain.factory.UserFactory;
 import lombok.Data;
 import org.springframework.beans.BeanUtils;
-
 import javax.validation.constraints.NotNull;
 import java.util.List;
 import java.util.stream.Collectors;

+ 7 - 4
site/src/main/java/com/mooctest/crowd/site/command/ApplyEnterpriseAuthCommand.java

@@ -2,6 +2,7 @@ package com.mooctest.crowd.site.command;
 
 import com.mooctest.crowd.domain.domainobject.EnterpriseAuthentication;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 import org.springframework.beans.BeanUtils;
 
 import javax.validation.constraints.NotNull;
@@ -15,6 +16,8 @@ import java.sql.Timestamp;
 @Data
 public class ApplyEnterpriseAuthCommand {
 
+    @NotNull(message = "请选择认证研发机构或者评测机构")
+    private  String   isDaOrEa;
     @NotNull(message = "企业法人姓名不可为空")
     private String legalPersonName;
     @NotNull(message = "请上传营业执照")
@@ -24,12 +27,12 @@ public class ApplyEnterpriseAuthCommand {
     @NotNull(message = "地址不可为空")
     private String address;
     @NotNull(message = "请选择性别")
-    private String sex;//2.0新加性别
-//    @NotNull(message = "请上传身份证正面照")
+    private String sex;
+    @NotNull(message = "请上传身份证正面照")
     private String IDCardPositivePhoto;//身份证正面照
-//    @NotNull(message = "请上传身份证反面照")
+    @NotNull(message = "请上传身份证反面照")
     private String IDCardBackPhoto;//身份证反面照
-//    @NotNull(message = "请正确填写身份证过期时间")
+    @NotNull(message = "请正确填写身份证过期时间")
     private Timestamp IDCardDeadTime;
 
 

File diff suppressed because it is too large
+ 0 - 0
site/src/main/java/com/mooctest/crowd/site/service/impl/UserServiceImpl.java


Some files were not shown because too many files changed in this diff