Przeglądaj źródła

修改 basesearchercontroller里面的一个判断以及企业认证相关,。

xuxuan 5 lat temu
rodzic
commit
328a527797

+ 13 - 18
core/src/main/java/com/mooctest/crowd/domain/domainobject/EnterpriseAuthentication.java

@@ -12,17 +12,15 @@ import java.sql.Timestamp;
  */
 @Data
 public class EnterpriseAuthentication {
-
     private Long id;
     private Long userId;
-    private String sex;
-    private String IDCardPositivePhoto;//身份证正面照片
-   private String IDCardBackPhoto;//身份证反面
+    private String IDCardNum;//身份证号码
     private String legalPersonName;
     private String businessLicensePhoto;
     private String unifiedSocialCreditCode;
-
-    private String address;
+    private String sex;//2.0新加性别
+    private String IDcardPositivePhoto;//身份证正面照
+    private String IDCardBackPhoto;//身份证反面照
     private int isDeleted;
     private int isAuthentication;
     private String explain;
@@ -34,12 +32,9 @@ public class EnterpriseAuthentication {
         return "CompanyAuth{" +
                 "id=" + id +
                 ", userId=" + userId +
-
                 ", legalPersonName='" + legalPersonName + '\'' +
                 ", businessLicensePhoto='" + businessLicensePhoto + '\'' +
                 ", unifiedSocialCreditCode='" + unifiedSocialCreditCode + '\'' +
-
-                ", address='" + address + '\'' +
                 ", isDeleted=" + isDeleted +
                 ", isAuthentication=" + isAuthentication +
                 ", explain=" + explain +
@@ -59,11 +54,11 @@ 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("");
@@ -73,14 +68,14 @@ public class EnterpriseAuthentication {
     }
 
     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()));
@@ -92,7 +87,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()));

+ 12 - 14
site/src/main/java/com/mooctest/crowd/site/command/ApplyEnterpriseAuthCommand.java

@@ -14,26 +14,24 @@ import java.sql.Timestamp;
  */
 @Data
 public class ApplyEnterpriseAuthCommand {
-    @NotNull(message = "用户ID不可为空")
-    private Long userId;
 
-    @NotNull(message = "企业名称不可为空")
-    private String enterpriseName;
-
-    @NotNull(message = "企业法人不可为空")
+    @NotNull(message = "企业法人姓名不可为空")
     private String legalPersonName;
-
     @NotNull(message = "请上传营业执照")
     private String businessLicensePhoto;
-
-    @NotNull(message = "请填写社会统一信用代码")
-    private String unifiedSocialCreditCode;
-
-    @NotNull(message = "请填写对公账户")
-    private String bankAccount;
-
+    @NotNull(message = "身份证号不可为空")
+    private String IDCardNum;
     @NotNull(message = "地址不可为空")
     private String address;
+    @NotNull(message = "请选择性别")
+    private String sex;//2.0新加性别
+    @NotNull(message = "请上传身份证正面照")
+    private String IDCardPositivePhoto;//身份证正面照
+    @NotNull(message = "请上传身份证反面照")
+    private String IDCardBackPhoto;//身份证反面照
+    @NotNull(message = "请正确填写身份证过期时间")
+    private Timestamp IDCardDeadTime;
+
 
     public EnterpriseAuthentication toEnterpriseAuth() {
         EnterpriseAuthentication enterpriseAuthentication = new EnterpriseAuthentication();

+ 6 - 4
site/src/main/java/com/mooctest/crowd/site/controller/BaseSearchController.java

@@ -20,10 +20,12 @@ public abstract class BaseSearchController extends BaseController{
     Pageable getPageable(SearchConditionVO searchConditionVO){
         int activePage = searchConditionVO.getActivePage() == 0?1:searchConditionVO.getActivePage();
         Sort sort = new Sort(Sort.Direction.DESC,"id");
-        for (ColumnFilter columnFilter:searchConditionVO.getColumnFilters()) {
-            if (ColumnFilterType.SORT.getName().equals(columnFilter.getType()) && columnFilter.getValue() != null) {
-                sort = new Sort(Sort.Direction.fromString(columnFilter.getValue()),columnFilter.getField());
-                break;
+        if(searchConditionVO.getColumnFilters() != null){
+            for (ColumnFilter columnFilter:searchConditionVO.getColumnFilters()) {
+                if (ColumnFilterType.SORT.getName().equals(columnFilter.getType()) && columnFilter.getValue() != null) {
+                    sort = new Sort(Sort.Direction.fromString(columnFilter.getValue()),columnFilter.getField());
+                    break;
+                }
             }
         }
         return new PageRequest(activePage-1, CommonConstant.DEFAULT_ROWS_ON_PAGE, sort);

+ 5 - 5
site/src/main/java/com/mooctest/crowd/site/controller/CrowTestSquareController.java

@@ -30,7 +30,7 @@ import java.util.Map;
 
 @RestController
 @RequestMapping("/api/square")
-public class CrowTestSquareController extends BaseSearchController{
+public class CrowTestSquareController extends BaseSearchController {
 
     @Autowired
     private CrowdProjectService crowdProjectService;
@@ -59,9 +59,9 @@ public class CrowTestSquareController extends BaseSearchController{
     /**
      * 众测项目分页查询接口
      */
-    @GetMapping("/project/list")
+    @PostMapping("/project/list")
     public ResponseVO findAllprojectByPage(@RequestBody SearchConditionVO searchConditionVO) {
-        Map<String, String> extraCondition = searchConditionVO.getColumnFilters() == null ? new HashMap<>() : super.getExtraCondition(searchConditionVO);
+//        Map<String, String> extraCondition = searchConditionVO.getColumnFilters() == null ? new HashMap<>() : super.getExtraCondition(searchConditionVO);
         Pageable pageable = this.getPageable(searchConditionVO);
         List<CrowdTestProjectVO> list = crowdProjectService.findAll(pageable);
         Page<CrowdTestProjectVO> page = DataUtils.listToPage(list, pageable);
@@ -73,7 +73,7 @@ public class CrowTestSquareController extends BaseSearchController{
      */
     @GetMapping("/task/list")
     public ResponseVO<Page<CrowdTaskVO>> getAllTaskByPage(@RequestBody SearchConditionVO searchConditionVO) {
-        Map<String, String> extraCondition = searchConditionVO.getColumnFilters() == null ? new HashMap<>() : super.getExtraCondition(searchConditionVO);
+//        Map<String, String> extraCondition = searchConditionVO.getColumnFilters() == null ? new HashMap<>() : super.getExtraCondition(searchConditionVO);
         Pageable pageable = this.getPageable(searchConditionVO);
         Page<CrowdTaskVO> page = commonService.getTaskinfo(pageable, null, 0);
         return new ResponseVO<>(ServerCode.SUCCESS, page);
@@ -99,7 +99,7 @@ public class CrowTestSquareController extends BaseSearchController{
         Page<ProjectAndTaskDTO> projectAndTaskDTOPage = DataUtils.listToPage(projectAndTaskDTOList, pageable);
         Page<CrowdTestProjectVO> projectVOPage = DataUtils.listToPage(list, pageable);
         Page<CrowdTaskVO> crowdTaskVOPage = DataUtils.listToPage(taskVOList, pageable);
-        if (searchConditionVO.getColumnFilters().get(0).getType().equals("项目")) {
+        if (searchConditionVO.getColumnFilters().get(0).getType().equals("项目")){
             return new ResponseVO<>(ServerCode.SUCCESS, projectVOPage);
         } else if (searchConditionVO.getColumnFilters().get(0).getType().equals("任务")) {
             return new ResponseVO(ServerCode.SUCCESS, crowdTaskVOPage);

+ 1 - 1
site/src/main/java/com/mooctest/crowd/site/data/vo/BaseAuthVO.java

@@ -29,7 +29,7 @@ public class BaseAuthVO {
     }
 
     public BaseAuthVO(EnterpriseAuthentication enterpriseAuthentication){
-        this.userName = enterpriseAuthentication.getEnterpriseName();
+
         this.applytime = enterpriseAuthentication.getApplyTime();
         this.userId = enterpriseAuthentication.getUserId();
         this.type = "enterprise";

+ 10 - 6
site/src/main/java/com/mooctest/crowd/site/data/vo/EnterpriseAuthVO.java

@@ -13,15 +13,16 @@ import java.sql.Timestamp;
  */
 @Data
 public class EnterpriseAuthVO {
-
+    private Long id;
+    private Long userId;
 
     private String legalPersonName;
-
-    private String  sex;
-    private String IDCardPositivePhoto;
-    private String IDCardBackPhoto;
+    private String businessLicensePhoto;
     private String unifiedSocialCreditCode;
     private String bankAccount;
+    private String sex;//2.0新加性别
+    private  String  IDcardPositivePhoto;//身份证正面照
+    private   String IDCardBackPhoto;//身份证反面照
     private String address;
     private int isDeleted;
     private Integer isAuthentication;
@@ -29,10 +30,13 @@ public class EnterpriseAuthVO {
     private Timestamp applyTime;
     private Timestamp checkTime;
     private StatusVO authStatus;
+   private Timestamp  IDCardDeadTime;//身份证过期时间
+
+
 
     public EnterpriseAuthVO(EnterpriseAuthentication authentication){
         BeanUtils.copyProperties(authentication, this);
         this.authStatus = new StatusVO();
         authStatus.initAuthStatus(this.isAuthentication);
     }
-}
+}

+ 1 - 1
site/src/main/java/com/mooctest/crowd/site/data/vo/StatusVO.java

@@ -27,7 +27,7 @@ public class StatusVO {
         } else if (status.equals(AuthenticationStatus.isAuthenIng)){
             this.setText("审核中");
             this.setStyle("warning");
-        } else if (status.equals(AuthenticationStatus.isNotAuthenticated)) {
+        } else if (status.equals(AuthenticationStatus.isNotAuthenticated)){
             this.setText("认证失败");
             this.setStyle("info");
         }