|
@@ -746,6 +746,21 @@ public class WebMediatorImpl implements ViewMediator {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
+ public CrowdTaskVO changeTypeByProjectAndTaskVO(CrowdTestProject project, CrowdTaskVO task, Map<String, String> applicationMap
|
|
|
|
+ , Map<String, String> fieldMap, Map<String, String> testMap) {
|
|
|
|
+ // 获取项目的领域、应用类型赋值给任务
|
|
|
|
+ task.setFieldType(project.getFieldType());
|
|
|
|
+ task.setApplicationType(project.getApplicationType());
|
|
|
|
+ // 领域类型值的转换
|
|
|
|
+ task.setFieldType(fieldMap.get(task.getFieldType()));
|
|
|
|
+ // 应用类型值的转换
|
|
|
|
+ task.setApplicationType(applicationMap.get(task.getApplicationType()));
|
|
|
|
+ // 测试类型值的转换
|
|
|
|
+ task.setServiceType(testMap.get(task.getServiceType()));
|
|
|
|
+ return task;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
public CrowdTestTask changeTypeByProjectAndTask(CrowdTestProject project, CrowdTestTask task) {
|
|
public CrowdTestTask changeTypeByProjectAndTask(CrowdTestProject project, CrowdTestTask task) {
|
|
// 获取领域、应用、测试类型code 和 name 的map
|
|
// 获取领域、应用、测试类型code 和 name 的map
|
|
Map<String, String> fieldMap = commonRepo.getFieldCodeNameMap();
|
|
Map<String, String> fieldMap = commonRepo.getFieldCodeNameMap();
|
|
@@ -808,8 +823,6 @@ public class WebMediatorImpl implements ViewMediator {
|
|
saveFlag = true;
|
|
saveFlag = true;
|
|
}
|
|
}
|
|
|
|
|
|
- // 类型的转换
|
|
|
|
- this.changeTypeByProjectAndTask(project, crowdTestTask, applicationMap, fieldMap, testMap);
|
|
|
|
CrowdTaskVO crowdTaskVO = new CrowdTaskVO(crowdTestTask);
|
|
CrowdTaskVO crowdTaskVO = new CrowdTaskVO(crowdTestTask);
|
|
if (crowdTestTask.getDistributionType() == 0) {
|
|
if (crowdTestTask.getDistributionType() == 0) {
|
|
EvaluationAgencyPO agencyPO = agencyDao.findByUserId(crowdTestTask.getEvaluationAgencyId());
|
|
EvaluationAgencyPO agencyPO = agencyDao.findByUserId(crowdTestTask.getEvaluationAgencyId());
|
|
@@ -834,6 +847,18 @@ public class WebMediatorImpl implements ViewMediator {
|
|
progress.add(new PieChartDataVO("进行中", crowdTestTaskList
|
|
progress.add(new PieChartDataVO("进行中", crowdTestTaskList
|
|
.stream().filter(task -> task.getStatus() > CrowdTestTaskStatus.HAS_CREATED && task.getStatus() < CrowdTestTaskStatus.HAS_FINISHED).count()));
|
|
.stream().filter(task -> task.getStatus() > CrowdTestTaskStatus.HAS_CREATED && task.getStatus() < CrowdTestTaskStatus.HAS_FINISHED).count()));
|
|
|
|
|
|
|
|
+ if (saveFlag) {
|
|
|
|
+ // 项目或者任务中的状态需要变更
|
|
|
|
+ projectRepo.saveCrowdTestProject(project);
|
|
|
|
+ }else{
|
|
|
|
+ // 状态不需要变更则进行类型转换
|
|
|
|
+ for (CrowdTaskVO crowdTaskVO : taskVOList) {
|
|
|
|
+ // 类型的转换
|
|
|
|
+ this.changeTypeByProjectAndTaskVO(project, crowdTaskVO, applicationMap, fieldMap, testMap);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
// 项目类型值的转换
|
|
// 项目类型值的转换
|
|
projectVO = changeFieldAndApplicationAndTestType(projectVO, applicationMap, fieldMap, testMap);
|
|
projectVO = changeFieldAndApplicationAndTestType(projectVO, applicationMap, fieldMap, testMap);
|
|
|
|
|
|
@@ -843,9 +868,6 @@ public class WebMediatorImpl implements ViewMediator {
|
|
projectDetailsDTO.setProjectOperationControl(initProjectPermission(project, user));
|
|
projectDetailsDTO.setProjectOperationControl(initProjectPermission(project, user));
|
|
projectDetailsDTO.setProgress(progress);
|
|
projectDetailsDTO.setProgress(progress);
|
|
|
|
|
|
- if (saveFlag) {
|
|
|
|
- projectRepo.saveCrowdTestProject(project);
|
|
|
|
- }
|
|
|
|
return projectDetailsDTO;
|
|
return projectDetailsDTO;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1675,12 +1697,19 @@ public class WebMediatorImpl implements ViewMediator {
|
|
taskOperationControl.setTaskDemonstrate(true);
|
|
taskOperationControl.setTaskDemonstrate(true);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if (user.getRoleList().stream().anyMatch(role -> role.getName().equals("SystemAdministrator"))
|
|
|
|
+ || (user.getRegionalManager() != null && user.getId().equals(project.getRegionalManagerId()))) {
|
|
|
|
+ // 不管何时都可以导出任务
|
|
|
|
+ taskOperationControl.setExportTask(true);
|
|
|
|
+ taskOperationControl.setForkTask(true);
|
|
|
|
+ }
|
|
}else{
|
|
}else{
|
|
//区域管理员或系统管理员视角
|
|
//区域管理员或系统管理员视角
|
|
if (user.getRoleList().stream().anyMatch(role -> role.getName().equals("SystemAdministrator"))
|
|
if (user.getRoleList().stream().anyMatch(role -> role.getName().equals("SystemAdministrator"))
|
|
|| (user.getRegionalManager() != null && user.getId().equals(project.getRegionalManagerId()))) {
|
|
|| (user.getRegionalManager() != null && user.getId().equals(project.getRegionalManagerId()))) {
|
|
// 不管何时都可以导出任务
|
|
// 不管何时都可以导出任务
|
|
taskOperationControl.setExportTask(true);
|
|
taskOperationControl.setExportTask(true);
|
|
|
|
+ taskOperationControl.setForkTask(true);
|
|
// 刚发布时,可修改,可查看推荐,可跳转看报告链接是否正确
|
|
// 刚发布时,可修改,可查看推荐,可跳转看报告链接是否正确
|
|
if (task.getStatus() < CrowdTestTaskStatus.HAS_RECEIVED) {
|
|
if (task.getStatus() < CrowdTestTaskStatus.HAS_RECEIVED) {
|
|
taskOperationControl.setUpdate(true);
|
|
taskOperationControl.setUpdate(true);
|
|
@@ -1788,9 +1817,6 @@ public class WebMediatorImpl implements ViewMediator {
|
|
return taskOperationControl;
|
|
return taskOperationControl;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
System.out.println(taskOperationControl);
|
|
System.out.println(taskOperationControl);
|
|
return taskOperationControl;
|
|
return taskOperationControl;
|
|
}
|
|
}
|