浏览代码

add:获取认证列表接口,已处理/未处理

xuexiaobo 6 年之前
父节点
当前提交
50014b3d30

+ 5 - 0
core/src/main/java/com/mooctest/crowd/domain/dao/EnterpriseAuthenticationDao.java

@@ -1,5 +1,6 @@
 package com.mooctest.crowd.domain.dao;
 
+import com.mooctest.crowd.domain.domainobject.EnterpriseAuthentication;
 import com.mooctest.crowd.domain.model.EnterpriseAuthenticationPO;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.data.repository.PagingAndSortingRepository;
@@ -17,6 +18,10 @@ public interface EnterpriseAuthenticationDao extends PagingAndSortingRepository<
 
     EnterpriseAuthenticationPO findByUserId(Long userId);
 
+    List<EnterpriseAuthenticationPO> findByIsAuthentication(Integer isAuthentication);
+
+    List<EnterpriseAuthenticationPO> findByIsAuthenticationIsNot(Integer isAuthentication);
+
     EnterpriseAuthenticationPO findByUserIdAndIsDeleted(Long Id, int deletedStatus);
 
     List<EnterpriseAuthenticationPO> findAll();

+ 2 - 0
core/src/main/java/com/mooctest/crowd/domain/dao/EvaluationAgencyDao.java

@@ -19,6 +19,8 @@ public interface EvaluationAgencyDao extends PagingAndSortingRepository<Evaluati
 
     List<EvaluationAgencyPO> findByIsAuthentication(int isAuthentication);
 
+    List<EvaluationAgencyPO> findByIsAuthenticationIsNot(int isAuthentication);
+
     @Override
     Iterable<EvaluationAgencyPO> findAllById(Iterable<Long> iterable);
 

+ 5 - 0
core/src/main/java/com/mooctest/crowd/domain/dao/PersonalAuthenticationDao.java

@@ -1,5 +1,6 @@
 package com.mooctest.crowd.domain.dao;
 
+import com.mooctest.crowd.domain.domainobject.PersonalAuthentication;
 import com.mooctest.crowd.domain.model.PersonalAuthenticationPO;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.data.repository.PagingAndSortingRepository;
@@ -19,6 +20,10 @@ public interface PersonalAuthenticationDao extends PagingAndSortingRepository<Pe
 
     PersonalAuthenticationPO findByUserIdAndIsDeleted(Long userId, int deletedStatus);
 
+    List<PersonalAuthenticationPO> findByIsAuthentication(Integer isAuthentication);
+
+    List<PersonalAuthenticationPO> findByIsAuthenticationIsNot(Integer isAuthentication);
+
     List<PersonalAuthenticationPO> findAll();
 
     PersonalAuthenticationPO save(PersonalAuthenticationPO personalAuthenticationPO);

+ 9 - 0
site/src/main/java/com/mooctest/crowd/site/controller/UserController.java

@@ -5,6 +5,7 @@ import com.mooctest.crowd.site.annotation.LoginRequired;
 import com.mooctest.crowd.site.annotation.SysAdminRequired;
 import com.mooctest.crowd.site.command.*;
 import com.mooctest.crowd.site.data.dto.UserDTO;
+import com.mooctest.crowd.site.data.vo.BaseAuthVO;
 import com.mooctest.crowd.site.data.vo.EnterpriseAuthVO;
 import com.mooctest.crowd.site.data.vo.PersonalAuthVO;
 import com.mooctest.crowd.site.service.UserService;
@@ -209,6 +210,14 @@ public class UserController {
         return userService.rejectEnterpriseAuth(userId);
     }
 
+    @RequestMapping(value = "/user/authentication/handling", method = RequestMethod.GET)
+    public List<BaseAuthVO> getAuthingList(){
+        return userService.getAuthingList();
+    }
 
+    @RequestMapping(value = "/user/authentication/handled", method = RequestMethod.GET)
+    public List<BaseAuthVO> getAuthedList(){
+        return userService.getAuthedList();
+    }
 
 }

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

@@ -0,0 +1,46 @@
+package com.mooctest.crowd.site.data.vo;
+
+import com.mooctest.crowd.domain.domainobject.EnterpriseAuthentication;
+import com.mooctest.crowd.domain.domainobject.EvaluationAgency;
+import com.mooctest.crowd.domain.domainobject.PersonalAuthentication;
+import lombok.Data;
+
+import java.sql.Timestamp;
+
+/**
+ * @author: Diors.Po
+ * @Email: 171256175@qq.com
+ * @date 2019-08-28 22:05
+ */
+@Data
+public class BaseAuthVO {
+    private Long userId;
+    private String userName;
+    private StatusVO authStatus;
+    private String type;
+    private Timestamp applytime;
+
+    public BaseAuthVO(PersonalAuthentication personalAuthentication){
+        this.userName = personalAuthentication.getRealName();
+        this.applytime = personalAuthentication.getApplyTime();
+        this.userId = personalAuthentication.getUserId();
+        this.type = "personal";
+        this.authStatus = new StatusVO(personalAuthentication.getIsAuthentication());
+    }
+
+    public BaseAuthVO(EnterpriseAuthentication enterpriseAuthentication){
+        this.userName = enterpriseAuthentication.getEnterpriseName();
+        this.applytime = enterpriseAuthentication.getApplyTime();
+        this.userId = enterpriseAuthentication.getUserId();
+        this.type = "enterprise";
+        this.authStatus = new StatusVO(enterpriseAuthentication.getIsAuthentication());
+    }
+
+    public BaseAuthVO(EvaluationAgency agency){
+        this.userName = agency.getEvaluationAgencyName();
+        this.applytime = agency.getApplyTime();
+        this.userId = agency.getUserId();
+        this.type = "agency";
+        this.authStatus = new StatusVO(agency.getIsAuthentication());
+    }
+}

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

@@ -3,6 +3,7 @@ package com.mooctest.crowd.site.data.vo;
 import com.mooctest.crowd.domain.domainobject.AuthenticationStatus;
 import com.mooctest.crowd.domain.domainobject.User;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 /**
  * @author: Diors.Po
@@ -10,13 +11,18 @@ import lombok.Data;
  * @date 2019-08-27 00:51
  */
 @Data
+@NoArgsConstructor
 public class StatusVO {
     String text;
     String style;
 
+    public StatusVO(Integer status){
+        initAuthStatus(status);
+    }
+
     public void initAuthStatus(Integer status){
         if (status.equals(AuthenticationStatus.isAuthenticated)){
-            this.setText("已认证");
+            this.setText("认证通过");
             this.setStyle("success");
         } else if (status.equals(AuthenticationStatus.isAuthenIng)){
             this.setText("审核中");

+ 4 - 0
site/src/main/java/com/mooctest/crowd/site/mediator/ViewMediator.java

@@ -9,6 +9,7 @@ import com.mooctest.crowd.domain.exception.AccountNotExistException;
 import com.mooctest.crowd.domain.exception.BadRequestException;
 import com.mooctest.crowd.domain.exception.PasswordErrorException;
 import com.mooctest.crowd.site.data.vo.AgencyVO;
+import com.mooctest.crowd.site.data.vo.BaseAuthVO;
 import com.mooctest.crowd.site.data.vo.EvolutionAgencyVO;
 import com.mooctest.crowd.site.data.vo.RegionalManagerVO;
 
@@ -44,4 +45,7 @@ public interface ViewMediator {
 
     List<EvolutionAgencyVO> renderAgencyList();
 
+    List<BaseAuthVO> renderAuthingList();
+
+    List<BaseAuthVO> renderAuthedList();
 }

+ 54 - 0
site/src/main/java/com/mooctest/crowd/site/mediator/impl/WebMediatorImpl.java

@@ -58,6 +58,12 @@ public class WebMediatorImpl implements ViewMediator {
     @Autowired
     private CrowdTestProjectDao projectDao;
 
+    @Autowired
+    private PersonalAuthenticationDao personalAuthenticationDao;
+
+    @Autowired
+    private EnterpriseAuthenticationDao enterpriseAuthenticationDao;
+
     @Override
     public UserDTO loginByMobileAndPwd(LoginCommand cmd) {
         return null;
@@ -328,6 +334,54 @@ public class WebMediatorImpl implements ViewMediator {
         return agencyList;
     }
 
+    @Override
+    public List<BaseAuthVO> renderAuthingList() {
+        List<BaseAuthVO> authingList = new ArrayList<>();
+        authingList.addAll(personalAuthenticationDao.findByIsAuthentication(AuthenticationStatus.isAuthenIng).stream().map(personalAuthenticationPO -> {
+            PersonalAuthentication personalAuthentication = new PersonalAuthentication();
+            BeanUtils.copyProperties(personalAuthenticationPO, personalAuthentication);
+            return new BaseAuthVO(personalAuthentication);
+        }).collect(Collectors.toList()));
+
+        authingList.addAll(enterpriseAuthenticationDao.findByIsAuthentication(AuthenticationStatus.isAuthenIng).stream().map(enterpriseAuthenticationPO -> {
+            EnterpriseAuthentication enterpriseAuthentication = new EnterpriseAuthentication();
+            BeanUtils.copyProperties(enterpriseAuthenticationPO, enterpriseAuthentication);
+            return new BaseAuthVO(enterpriseAuthentication);
+        }).collect(Collectors.toList()));
+
+        authingList.addAll(agencyDao.findByIsAuthentication(AuthenticationStatus.isAuthenIng).stream().map(evaluationAgencyPO -> {
+            EvaluationAgency agency = new EvaluationAgency();
+            BeanUtils.copyProperties(evaluationAgencyPO, agency);
+            return new BaseAuthVO(agency);
+        }).collect(Collectors.toList()));
+        authingList.sort(Comparator.comparing(BaseAuthVO::getApplytime).reversed());
+        return authingList;
+    }
+
+    @Override
+    public List<BaseAuthVO> renderAuthedList() {
+        List<BaseAuthVO> authingList = new ArrayList<>();
+        authingList.addAll(personalAuthenticationDao.findByIsAuthenticationIsNot(AuthenticationStatus.isAuthenIng).stream().map(personalAuthenticationPO -> {
+            PersonalAuthentication personalAuthentication = new PersonalAuthentication();
+            BeanUtils.copyProperties(personalAuthenticationPO, personalAuthentication);
+            return new BaseAuthVO(personalAuthentication);
+        }).collect(Collectors.toList()));
+
+        authingList.addAll(enterpriseAuthenticationDao.findByIsAuthenticationIsNot(AuthenticationStatus.isAuthenIng).stream().map(enterpriseAuthenticationPO -> {
+            EnterpriseAuthentication enterpriseAuthentication = new EnterpriseAuthentication();
+            BeanUtils.copyProperties(enterpriseAuthenticationPO, enterpriseAuthentication);
+            return new BaseAuthVO(enterpriseAuthentication);
+        }).collect(Collectors.toList()));
+
+        authingList.addAll(agencyDao.findByIsAuthenticationIsNot(AuthenticationStatus.isAuthenIng).stream().map(evaluationAgencyPO -> {
+            EvaluationAgency agency = new EvaluationAgency();
+            BeanUtils.copyProperties(evaluationAgencyPO, agency);
+            return new BaseAuthVO(agency);
+        }).collect(Collectors.toList()));
+        authingList.sort(Comparator.comparing(BaseAuthVO::getApplytime).reversed());
+        return authingList;
+    }
+
     private ProjectOperationControl initProjectPermission(CrowdTestProject project, User user){
         ProjectOperationControl operationControl = new ProjectOperationControl();
         if (user==null)

文件差异内容过多而无法显示
+ 0 - 1
site/src/main/java/com/mooctest/crowd/site/service/UserService.java


文件差异内容过多而无法显示
+ 0 - 0
site/src/main/java/com/mooctest/crowd/site/service/impl/UserServiceImpl.java


部分文件因为文件数量过多而无法显示