|
@@ -858,6 +858,10 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ // 判断项目是否为定向发布,显示定向给的区域管理员信息
|
|
|
+ if(project.getProjectDistributionTypeId().equals(DistributeType.DIRECT.getId())){
|
|
|
+ projectVO.setInstitution(userRepo.getByIDJustInfo(project.getRegionalManagerId()).getName());
|
|
|
+ }
|
|
|
|
|
|
// 项目类型值的转换
|
|
|
projectVO = changeFieldAndApplicationAndTestType(projectVO, applicationMap, fieldMap, testMap);
|
|
@@ -926,10 +930,6 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
|
|
|
@Override
|
|
|
public TaskDetailsDTO renderTaskDetails(String projectCode, String taskCode, Long userId) {
|
|
|
-// Map<String, String> fieldMap = commonRepo.getFieldCodeNameMap();
|
|
|
-// Map<String, String> applicationMap = commonRepo.getApplicationCodeNameMap();
|
|
|
-// Map<String, String> testMap = commonRepo.getTypeCodeNameMap();
|
|
|
-
|
|
|
TaskDetailsDTO taskDetailsDTO = new TaskDetailsDTO();
|
|
|
CrowdTestProject project = projectRepo.getByProjectCode(projectCode);
|
|
|
|
|
@@ -985,6 +985,11 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
}
|
|
|
return taskToUserVO;
|
|
|
}).collect(Collectors.toList());
|
|
|
+
|
|
|
+ // 判断是否为定向发布的任务,如果是则获取定向发布机构/人员的名称信息
|
|
|
+ if(crowdTestTask.getDistributionType().equals(DistributeType.DIRECT.getId())){
|
|
|
+ taskVO.setAgencyName(evaluationAgencyRepo.findAgencyByUserId(crowdTestTask.getEvaluationAgencyId()).getEvaluationAgencyName());
|
|
|
+ }
|
|
|
}
|
|
|
// 测评机构视图
|
|
|
else if (AuthCheckServiceImpl.isAgency(user)) {
|
|
@@ -1686,14 +1691,19 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
Optional<EndPointPO> endPointPOOptional = endPointDao.findByTaskCode(task.getCode());
|
|
|
TaskOperationControl taskOperationControl = new TaskOperationControl();
|
|
|
|
|
|
- if (user.getRoleList().stream().anyMatch(role -> role.getName().equals("SystemAdministrator"))
|
|
|
- || (user.getRegionalManager() != null && user.getId().equals(project.getRegionalManagerId()))) {
|
|
|
- // 不管何时都可以导出任务
|
|
|
- taskOperationControl.setExportTask(true);
|
|
|
- taskOperationControl.setForkTask(true);
|
|
|
+ // 用户未登录,无其他操作权限
|
|
|
+ if (user == null) {
|
|
|
+ return taskOperationControl;
|
|
|
}
|
|
|
|
|
|
- if (user == null || task.getStatus() == CrowdTestTaskStatus.HAS_TIME_OUT) {
|
|
|
+ // 任务时间截止,对于区域管理员可以有导出和fork功能
|
|
|
+ if(task.getStatus() == CrowdTestTaskStatus.HAS_TIME_OUT){
|
|
|
+ if (user.getRoleList().stream().anyMatch(role -> role.getName().equals("SystemAdministrator"))
|
|
|
+ || (user.getRegionalManager() != null && user.getId().equals(project.getRegionalManagerId()))) {
|
|
|
+ // 不管何时都可以导出任务
|
|
|
+ taskOperationControl.setExportTask(true);
|
|
|
+ taskOperationControl.setForkTask(true);
|
|
|
+ }
|
|
|
return taskOperationControl;
|
|
|
}
|
|
|
|