|
@@ -661,15 +661,17 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
}
|
|
|
return null;
|
|
|
}).collect(Collectors.toList());
|
|
|
- unfinishedTasks = allTaskOfAgency.stream()
|
|
|
- .filter(crowdTestTask -> crowdTestTask.getStatus() >= CrowdTestTaskStatus.HAS_RELEASED && crowdTestTask.getStatus() < CrowdTestTaskStatus.HAS_FINISHED)
|
|
|
- .sorted(Comparator.comparing(CrowdTestTask::getCreateTime))
|
|
|
- .map(CrowdTaskVO::new).collect(Collectors.toList());
|
|
|
-
|
|
|
- finishedTasks = allTaskOfAgency.stream()
|
|
|
- .filter(crowdTestTask -> crowdTestTask.getStatus() == CrowdTestTaskStatus.HAS_FINISHED)
|
|
|
- .sorted(Comparator.comparing(CrowdTestTask::getCreateTime))
|
|
|
- .map(CrowdTaskVO::new).collect(Collectors.toList());
|
|
|
+ if(allTaskOfAgency != null && allTaskOfAgency.size() > 0){
|
|
|
+ unfinishedTasks = allTaskOfAgency.stream()
|
|
|
+ .filter(crowdTestTask -> crowdTestTask.getStatus() >= CrowdTestTaskStatus.HAS_RELEASED && crowdTestTask.getStatus() < CrowdTestTaskStatus.HAS_FINISHED)
|
|
|
+ .sorted(Comparator.comparing(CrowdTestTask::getCreateTime))
|
|
|
+ .map(CrowdTaskVO::new).collect(Collectors.toList());
|
|
|
+
|
|
|
+ finishedTasks = allTaskOfAgency.stream()
|
|
|
+ .filter(crowdTestTask -> crowdTestTask.getStatus() == CrowdTestTaskStatus.HAS_FINISHED)
|
|
|
+ .sorted(Comparator.comparing(CrowdTestTask::getCreateTime))
|
|
|
+ .map(CrowdTaskVO::new).collect(Collectors.toList());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
myCrowdDTO.setFinishedTasks(finishedTasks);
|
|
@@ -693,34 +695,37 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
if (!AuthCheckServiceImpl.isAgency(user))
|
|
|
return userDataDTO;
|
|
|
List<CrowdTestTask> allTaskOfAgency = null;
|
|
|
- List<CrowdTestTask> unfinishedTasks = null;
|
|
|
- List<CrowdTestTask> finishedTasks = null;
|
|
|
+ List<CrowdTaskDataVO> unfinishedTasks = null;
|
|
|
+ List<CrowdTaskDataVO> finishedTasks = null;
|
|
|
+
|
|
|
if (AuthCheckServiceImpl.isAgency(user)) {
|
|
|
List<TaskToUserPO> taskToUserPOS = taskToUserDao.findByUserId(user.getId());
|
|
|
if (taskToUserPOS != null && taskToUserPOS.size() > 0) {
|
|
|
- allTaskOfAgency = taskToUserPOS.stream().sorted(Comparator.comparing(TaskToUserPO::getAcceptTime))
|
|
|
- .map(taskToUserPO -> {
|
|
|
- CrowdTestTaskPO crowdTestTaskPO = taskDao.findByCodeAndIsDeleted(taskToUserPO.getTaskCode(), DeletedStatus.isNotDeleted);
|
|
|
- if (crowdTestTaskPO != null) {
|
|
|
- CrowdTestTask task = new CrowdTestTask();
|
|
|
- BeanUtils.copyProperties(crowdTestTaskPO, task);
|
|
|
-
|
|
|
- // 测试类型的转换
|
|
|
- String typeName = commonRepo.getTypeNameByCode(task.getType());
|
|
|
- task.setType(typeName);
|
|
|
- CrowdTestTask taskDetail = projectRepo.getTaskDetail(task, user.getId());
|
|
|
- return taskDetail;
|
|
|
- }
|
|
|
- return null;
|
|
|
- }).collect(Collectors.toList());
|
|
|
-
|
|
|
- unfinishedTasks = allTaskOfAgency.stream()
|
|
|
- .filter(crowdTestTask -> crowdTestTask.getStatus() >= CrowdTestTaskStatus.HAS_RELEASED && crowdTestTask.getStatus() < CrowdTestTaskStatus.HAS_FINISHED)
|
|
|
- .collect(Collectors.toList());
|
|
|
-
|
|
|
- finishedTasks = allTaskOfAgency.stream()
|
|
|
- .filter(crowdTestTask -> crowdTestTask.getStatus() == CrowdTestTaskStatus.HAS_FINISHED)
|
|
|
- .collect(Collectors.toList());
|
|
|
+ allTaskOfAgency = taskToUserPOS.stream().map(taskToUserPO -> {
|
|
|
+ CrowdTestTaskPO crowdTestTaskPO = taskDao.findByCodeAndIsDeleted(taskToUserPO.getTaskCode(), DeletedStatus.isNotDeleted);
|
|
|
+ if (crowdTestTaskPO != null) {
|
|
|
+ CrowdTestTask task = new CrowdTestTask();
|
|
|
+ BeanUtils.copyProperties(crowdTestTaskPO, task);
|
|
|
+ // 判断任务是否截止
|
|
|
+ if (task.getDeadTime().getTime() <= System.currentTimeMillis() && task.getStatus() < CrowdTestTaskStatus.HAS_FINISHED) {
|
|
|
+ task.setStatus(CrowdTestTaskStatus.HAS_TIME_OUT);
|
|
|
+ }
|
|
|
+ return task;
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+// System.out.println("userId: " + userId);
|
|
|
+ if(allTaskOfAgency != null && allTaskOfAgency.size() > 0){
|
|
|
+ unfinishedTasks = allTaskOfAgency.stream()
|
|
|
+ .filter(crowdTestTask -> crowdTestTask.getStatus() >= CrowdTestTaskStatus.HAS_RELEASED && crowdTestTask.getStatus() < CrowdTestTaskStatus.HAS_FINISHED)
|
|
|
+ .sorted(Comparator.comparing(CrowdTestTask::getCreateTime))
|
|
|
+ .map(CrowdTaskDataVO::new).collect(Collectors.toList());
|
|
|
+
|
|
|
+ finishedTasks = allTaskOfAgency.stream()
|
|
|
+ .filter(crowdTestTask -> crowdTestTask.getStatus() == CrowdTestTaskStatus.HAS_FINISHED)
|
|
|
+ .sorted(Comparator.comparing(CrowdTestTask::getCreateTime))
|
|
|
+ .map(CrowdTaskDataVO::new).collect(Collectors.toList());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
userDataDTO.setFinishedTasks(finishedTasks);
|
|
@@ -1049,7 +1054,9 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
BeanUtils.copyProperties(evaluationAgencyPO, agency);
|
|
|
return new BaseAuthVO(agency);
|
|
|
}).collect(Collectors.toList()));
|
|
|
- authingList.sort(Comparator.comparing(BaseAuthVO::getApplytime).reversed());
|
|
|
+ if(authingList.size() > 0 && authingList != null) {
|
|
|
+ authingList.sort(Comparator.comparing(BaseAuthVO::getApplytime).reversed());
|
|
|
+ }
|
|
|
return authingList;
|
|
|
}
|
|
|
|
|
@@ -1062,18 +1069,20 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
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(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());
|
|
|
+ if(authingList.size() > 0 && authingList != null){
|
|
|
+ authingList.sort(Comparator.comparing(BaseAuthVO::getApplytime).reversed());
|
|
|
+ }
|
|
|
return authingList;
|
|
|
|
|
|
}
|