Browse Source

1、接包时即统计接包

郭超 2 years ago
parent
commit
3826d9e053

+ 2 - 3
site/src/main/java/com/mooctest/crowd/site/controller/CrowdProjectController.java

@@ -226,9 +226,8 @@ public class CrowdProjectController{
      * @return
      */
     @RequestMapping(value = "/api/regionalManager", method = RequestMethod.GET)
-    public List<RegionalManagerVO> getRegionalManagerList(HttpSession session){
-        Long loginUserId = Long.parseLong((String)session.getAttribute("userId"));
-        return projectService.getRegionalManagerList(loginUserId);
+    public List<RegionalManagerVO> getRegionalManagerList(){
+        return projectService.getRegionalManagerList();
     }
 
     /**

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

@@ -68,7 +68,7 @@ public interface ViewMediator {
 
     UserDTO renderUser(User user);
 
-    List<RegionalManagerVO> renderRegionManagerList(Long userId);
+    List<RegionalManagerVO> renderRegionManagerList();
 
     List<EvaluationAgencyVO> renderAgencyList();
 

+ 4 - 3
site/src/main/java/com/mooctest/crowd/site/mediator/impl/WebMediatorImpl.java

@@ -1067,7 +1067,7 @@ public class WebMediatorImpl implements ViewMediator {
     }
 
     @Override
-    public List<RegionalManagerVO> renderRegionManagerList(Long userId) {
+    public List<RegionalManagerVO> renderRegionManagerList() {
 //        List<RegionalManagerVO> regionalManagerVOList = new ArrayList<>();
 //        regionalManagerToRegionalDao.findAll().forEach(regionalManagerPO -> {
 //            RegionalManagerVO regionalManagerVO = new RegionalManagerVO();
@@ -1081,9 +1081,10 @@ public class WebMediatorImpl implements ViewMediator {
         List<UserToRolePO> userToRolePOS = userToRoleDao.findByRoleId(RoleType.REGIONAL_MANAGER.getId());
         userToRolePOS.forEach(userToRolePO -> {
             RegionalManagerVO regionalManagerVO = new RegionalManagerVO();
-            regionalManagerVO.setId(userToRolePO.getUserId());
+            Long userId = userToRolePO.getUserId();
+            regionalManagerVO.setId(userId);
             String name = null;
-            EvaluationAgencyPO evaluationAgencyPO = agencyDao.findByUserIdAndIsDeleted(userToRolePO.getUserId(), DeletedStatus.isNotDeleted);
+            EvaluationAgencyPO evaluationAgencyPO = agencyDao.findByUserIdAndIsDeleted(userId, DeletedStatus.isNotDeleted);
             if (evaluationAgencyPO == null){
                 Optional<UserPO> userPOOptional = userDao.findById(userId);
                 if(userPOOptional.isPresent()){

+ 1 - 1
site/src/main/java/com/mooctest/crowd/site/service/CrowdProjectService.java

@@ -48,7 +48,7 @@ public interface CrowdProjectService {
 
     List<CrowdTestProject> generateProjectByExcelAndUserId(Long userId,MultipartFile file);
 
-    List<RegionalManagerVO> getRegionalManagerList(Long userId);
+    List<RegionalManagerVO> getRegionalManagerList();
 
     ProjectDetailsDTO receiveProject(String projectCode, Long userId);
 

+ 3 - 3
site/src/main/java/com/mooctest/crowd/site/service/impl/CrowdProjectServiceImpl.java

@@ -274,7 +274,7 @@ public class CrowdProjectServiceImpl implements CrowdProjectService {
 
     @Override
     public List<CrowdTestProject> generateProjectByExcelAndUserId(Long userId, MultipartFile file){
-        List<RegionalManagerVO> RegionalManagetList = getRegionalManagerList(userId);
+        List<RegionalManagerVO> RegionalManagetList = getRegionalManagerList();
         for (RegionalManagerVO regionalManagerVO : RegionalManagetList) {
             if(regionalManagerVO.getId() == userId){
                 return transferExcel2Projects(userId, file);
@@ -382,8 +382,8 @@ public class CrowdProjectServiceImpl implements CrowdProjectService {
     }
 
     @Override
-    public List<RegionalManagerVO> getRegionalManagerList(Long userId) {
-        return viewMediator.renderRegionManagerList(userId);
+    public List<RegionalManagerVO> getRegionalManagerList() {
+        return viewMediator.renderRegionManagerList();
     }
 
     @Override

BIN
site/target/classes/com/mooctest/crowd/site/controller/CrowdProjectController.class


BIN
site/target/classes/com/mooctest/crowd/site/mediator/ViewMediator.class


BIN
site/target/classes/com/mooctest/crowd/site/mediator/impl/WebMediatorImpl.class


BIN
site/target/classes/com/mooctest/crowd/site/service/CrowdProjectService.class


BIN
site/target/classes/com/mooctest/crowd/site/service/impl/CrowdProjectServiceImpl.class