|
@@ -5,6 +5,7 @@ import cn.cslg.pas.common.model.cronModel.Personnel;
|
|
|
import cn.cslg.pas.common.model.cronModel.PersonnelVO;
|
|
|
import cn.cslg.pas.common.model.cronModel.Records;
|
|
|
import cn.cslg.pas.common.model.cronModel.SystemFile;
|
|
|
+import cn.cslg.pas.common.model.projectTask.*;
|
|
|
import cn.cslg.pas.common.model.request.GroupRequest;
|
|
|
import cn.cslg.pas.common.model.request.QueryRequest;
|
|
|
import cn.cslg.pas.common.model.request.StringRequest;
|
|
@@ -30,6 +31,8 @@ import cn.cslg.pas.service.permissions.PermissionService;
|
|
|
import cn.cslg.pas.service.query.FormatQueryService;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -39,6 +42,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
+import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -133,23 +137,23 @@ public class ProjectTaskService extends ServiceImpl<ProjectTaskMapper, ProjectTa
|
|
|
public Object addProjectOpenAuditTask(PatentDigProjectTaskDTO patentDigProjectTaskDTO) {
|
|
|
PatentDigProjectDTO patentDigProjectDTO = patentDigProjectTaskDTO.getPatentDigProjectDTO();
|
|
|
ProjectTaskDTO projectTaskDTO = patentDigProjectTaskDTO.getProjectTaskDTO();
|
|
|
+ TaskFormDTO taskFormDTO = toTaskFormDTO(projectTaskDTO);
|
|
|
+
|
|
|
//如果专利挖掘项目DTO不为空,则需要先建立专利挖掘项目
|
|
|
if (patentDigProjectDTO != null) {
|
|
|
+ patentDigProjectDTO.setId(null);
|
|
|
Integer projectId = (Integer) patentDigProjectService.addMessage(patentDigProjectDTO);
|
|
|
if (projectId != null) {
|
|
|
projectTaskDTO.setProjectId(projectId);
|
|
|
projectTaskDTO.setType(1);
|
|
|
- Integer projectTaskId = this.addTask(projectTaskDTO);
|
|
|
+ ProjectTask projectTask = this.addTaskByTaskFormDTO(taskFormDTO, projectId);
|
|
|
+ Integer projectTaskId = projectTask.getId();
|
|
|
if (projectTaskId != null) {
|
|
|
//将专利挖掘项目状态置为开卷审核
|
|
|
- LambdaQueryWrapper<PatentDigProject> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ LambdaUpdateWrapper<PatentDigProject> queryWrapper = new LambdaUpdateWrapper<>();
|
|
|
queryWrapper.eq(PatentDigProject::getProjectId, projectId);
|
|
|
- List<PatentDigProject> patentDigProjects = patentDigProjectService.list(queryWrapper);
|
|
|
- if (!patentDigProjects.isEmpty()) {
|
|
|
- PatentDigProject patentDigProject = patentDigProjects.get(0);
|
|
|
- patentDigProject.setState(0);
|
|
|
- patentDigProject.updateById();
|
|
|
- }
|
|
|
+ queryWrapper.set(PatentDigProject::getState, 0);
|
|
|
+ patentDigProjectService.update(queryWrapper);
|
|
|
}
|
|
|
return projectTaskId;
|
|
|
} else {
|
|
@@ -166,7 +170,7 @@ public class ProjectTaskService extends ServiceImpl<ProjectTaskMapper, ProjectTa
|
|
|
* @param projectTaskDTO
|
|
|
* @return
|
|
|
*/
|
|
|
- public Integer addTask(ProjectTaskDTO projectTaskDTO) {
|
|
|
+ public Integer addTask(ProjectTaskDTO projectTaskDTO) throws Exception {
|
|
|
//判断专题库id不为空
|
|
|
if (projectTaskDTO.getProjectId() == null) {
|
|
|
throw new XiaoShiException("专题库id不能为空!");
|
|
@@ -192,16 +196,9 @@ public class ProjectTaskService extends ServiceImpl<ProjectTaskMapper, ProjectTa
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (projectTaskDTO.getLastTaskId() != null) {
|
|
|
- ProjectTask projectTask = this.getById(projectTaskDTO.getLastTaskId());
|
|
|
- if (projectTask.getTaskPath() == null) {
|
|
|
- projectTaskDTO.setTaskPath(projectTask.getId().toString());
|
|
|
- } else {
|
|
|
- projectTaskDTO.setTaskPath(projectTask.getTaskPath() + "/" + projectTask.getId().toString());
|
|
|
- }
|
|
|
- }
|
|
|
ProjectTask projectTask = new ProjectTask();
|
|
|
BeanUtils.copyProperties(projectTaskDTO, projectTask);
|
|
|
+ projectTask.setLastTaskId(null);
|
|
|
//任务状态置为处理中
|
|
|
projectTask.setStatus(2);
|
|
|
//获取登录人信息
|
|
@@ -212,13 +209,7 @@ public class ProjectTaskService extends ServiceImpl<ProjectTaskMapper, ProjectTa
|
|
|
//设置任务的发起人
|
|
|
projectTask.setCreateId(personnelVO.getId());
|
|
|
projectTask.insert();
|
|
|
- //如果assoTaskId为空,就设置
|
|
|
- if (projectTask.getAssoTaskId() == null) {
|
|
|
- if (projectTask.getType() == 1 || projectTask.getType() == 6 || projectTask.getType() == 7) {
|
|
|
- projectTask.setAssoTaskId(projectTask.getId());
|
|
|
- projectTask.updateById();
|
|
|
- }
|
|
|
- }
|
|
|
+ Integer taskId = projectTask.getId();
|
|
|
//新增任务可能会上传附件,如果附件不为空,则添加任务与附件关联
|
|
|
if (projectTaskDTO.getFileGuids() != null) {
|
|
|
AssoTaskFileDTO assoTaskFileDTO = new AssoTaskFileDTO();
|
|
@@ -226,16 +217,29 @@ public class ProjectTaskService extends ServiceImpl<ProjectTaskMapper, ProjectTa
|
|
|
assoTaskFileDTO.setFileGuids(projectTaskDTO.getFileGuids());
|
|
|
assoTaskFileService.addTaskFile(assoTaskFileDTO);
|
|
|
}
|
|
|
+
|
|
|
+ if (projectTaskDTO.getLastTaskId() != null) {
|
|
|
+ LambdaQueryWrapper<TaskHandleResult> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(TaskHandleResult::getTaskId, projectTaskDTO.getLastTaskId());
|
|
|
+ TaskHandleResult taskHandleResult = taskHandleResultService.getOne(queryWrapper, false);
|
|
|
+ if (taskHandleResult != null) {
|
|
|
+ Integer resultId = taskHandleResult.getId();
|
|
|
+ LambdaQueryWrapper<AssoHandleResultFile> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper1.eq(AssoHandleResultFile::getTaskHandleResultId, resultId);
|
|
|
+ List<AssoHandleResultFile> assoHandleResultFiles = assoHandleResultFileService.list(queryWrapper1);
|
|
|
+ List<FileDTO> fileDTOS = new ArrayList<>();
|
|
|
+ this.getCopyFileDTOs(assoHandleResultFiles, fileDTOS);
|
|
|
+ FileFormDTO fileFormDTO = new FileFormDTO();
|
|
|
+ fileFormDTO.setFiles(fileDTOS);
|
|
|
+ this.addProjectTaskFileByFormDTO(fileFormDTO, taskId);
|
|
|
+ }
|
|
|
+ }
|
|
|
//根据新增的审核任务的lastTaskId,将上一级任务状态改为审核中
|
|
|
if (projectTask.getLastTaskId() != null && projectTask.getType().equals(5)) {
|
|
|
- LambdaQueryWrapper<ProjectTask> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ LambdaUpdateWrapper<ProjectTask> queryWrapper = new LambdaUpdateWrapper<>();
|
|
|
queryWrapper.eq(ProjectTask::getId, projectTask.getLastTaskId());
|
|
|
- List<ProjectTask> projectTasks = this.list(queryWrapper);
|
|
|
- if (projectTasks != null && projectTasks.size() != 0) {
|
|
|
- ProjectTask projectTask1 = projectTasks.get(0);
|
|
|
- projectTask1.setStatus(1);
|
|
|
- projectTask1.updateById();
|
|
|
- }
|
|
|
+ queryWrapper.set(ProjectTask::getStatus, 1);
|
|
|
+ this.update(queryWrapper);
|
|
|
}
|
|
|
//项目可见人检验
|
|
|
//如果是内部人员
|
|
@@ -968,19 +972,22 @@ public class ProjectTaskService extends ServiceImpl<ProjectTaskMapper, ProjectTa
|
|
|
public Object addReportOpenAuditTask(ReportAuditTaskDTO reportAuditTaskDTO) {
|
|
|
ReportProjectDTO reportProjectDTO = reportAuditTaskDTO.getReportProjectDTO();
|
|
|
ProjectTaskDTO projectTaskDTO = reportAuditTaskDTO.getProjectTaskDTO();
|
|
|
+ TaskFormDTO taskFormDTO = toTaskFormDTO(projectTaskDTO);
|
|
|
+
|
|
|
//如果报告DTO不为空,则需要先建立报告
|
|
|
if (reportProjectDTO != null) {
|
|
|
Integer projectId = (Integer) reportProjectService.addMessage(reportProjectDTO);
|
|
|
if (projectId != null) {
|
|
|
projectTaskDTO.setProjectId(projectId);
|
|
|
- Integer projectTaskId = this.addTask(projectTaskDTO);
|
|
|
+ ProjectTask projectTask = this.addTaskByTaskFormDTO(taskFormDTO, projectId);
|
|
|
+ Integer projectTaskId = projectTask.getId();
|
|
|
if (projectTaskId != null) {
|
|
|
//将侵权分析报告置为开卷审核
|
|
|
- LambdaQueryWrapper<ReportProject> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ LambdaUpdateWrapper<ReportProject> queryWrapper = new LambdaUpdateWrapper<>();
|
|
|
queryWrapper.eq(ReportProject::getProjectId, projectId);
|
|
|
- ReportProject reportProject = reportProjectService.getOne(queryWrapper, false);
|
|
|
- reportProject.setStatus(0);
|
|
|
- reportProject.updateById();
|
|
|
+ queryWrapper.set(ReportProject::getStatus, 0);
|
|
|
+ reportProjectService.update(queryWrapper);
|
|
|
+
|
|
|
}
|
|
|
return projectTaskId;
|
|
|
} else {
|
|
@@ -1352,4 +1359,267 @@ public class ProjectTaskService extends ServiceImpl<ProjectTaskMapper, ProjectTa
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public ProjectTask addTaskByTaskFormDTO(TaskFormDTO taskFormDTO, Integer projectId) {
|
|
|
+ String name = taskFormDTO.getName();
|
|
|
+ Integer handleType = taskFormDTO.getHandlerType();
|
|
|
+ String handleName = taskFormDTO.getHandler();
|
|
|
+ Date deadLineTime = taskFormDTO.getDeadLineTime();
|
|
|
+ Integer lastTaskId = taskFormDTO.getLastTaskId();
|
|
|
+ Integer assoTaskId = taskFormDTO.getAssoTaskId();
|
|
|
+ ProjectTask projectTask = new ProjectTask();
|
|
|
+ projectTask.setName(name);
|
|
|
+ projectTask.setHandlerType(handleType);
|
|
|
+ projectTask.setHandler(handleName);
|
|
|
+ projectTask.setDeadLineTime(deadLineTime);
|
|
|
+ projectTask.setProjectId(projectId);
|
|
|
+ projectTask.setType(taskFormDTO.getTaskType());
|
|
|
+ projectTask.setAssoTaskId(assoTaskId);
|
|
|
+
|
|
|
+ //任务状态置为处理中
|
|
|
+ projectTask.setStatus(2);
|
|
|
+ //获取登录人信息
|
|
|
+ PersonnelVO personnelVO = new PersonnelVO();
|
|
|
+ personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
|
+ if (lastTaskId != null) {
|
|
|
+ ProjectTask projectTask1 = this.getById(lastTaskId);
|
|
|
+ String lastName = projectTask1.getName();
|
|
|
+ projectTask.setLastTaskId(lastTaskId);
|
|
|
+ projectTask.setProjectId(projectTask1.getProjectId());
|
|
|
+ projectTask.setProcessId(projectTask1.getProcessId());
|
|
|
+ projectTask.setType(projectTask1.getType());
|
|
|
+ String lastPath = projectTask1.getTaskPath();
|
|
|
+ if (lastPath == null) {
|
|
|
+ lastPath = projectTask1.getId() + "";
|
|
|
+ } else {
|
|
|
+ lastPath += "/" + projectTask1.getId();
|
|
|
+ }
|
|
|
+ projectTask.setTaskPath(lastPath);
|
|
|
+ Integer b = 1;
|
|
|
+ if (!lastPath.equals("")) {
|
|
|
+ String[] a = lastPath.split("/");
|
|
|
+ b = a.length + 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ String newName = lastName + "-" + b + "级审核";
|
|
|
+ projectTask.setName(newName);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ //设置任务的发起人
|
|
|
+ projectTask.setCreateId(personnelVO.getId());
|
|
|
+ projectTask.insert();
|
|
|
+ return projectTask;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void addProjectTaskFileByFormDTO(FileFormDTO fileFormDTO, Integer taskId) {
|
|
|
+ List<FileDTO> fileDTOS = fileFormDTO.getFiles();
|
|
|
+ List<String> fileGuids = fileDTOS.stream().map(FileDTO::getGuid).collect(Collectors.toList());
|
|
|
+
|
|
|
+ if (fileGuids != null && fileGuids.size() > 0) {
|
|
|
+ AssoTaskFileDTO assoTaskFileDTO = new AssoTaskFileDTO();
|
|
|
+ assoTaskFileDTO.setTaskId(taskId);
|
|
|
+ assoTaskFileDTO.setFileGuids(fileGuids);
|
|
|
+ assoTaskFileService.addTaskFile(fileDTOS, taskId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public Integer addFileExamineTask(AddFileExamineTaskDTO addFileExamineTaskDTO) {
|
|
|
+ FileFormDTO fileFormDTO = addFileExamineTaskDTO.getFileForm();
|
|
|
+ TaskFormDTO taskFormDTO = addFileExamineTaskDTO.getTaskForm();
|
|
|
+ taskFormDTO.setTaskType(taskFormDTO.getTaskType());
|
|
|
+ Integer projectId = fileFormDTO.getProjectId();
|
|
|
+ ProjectTask projectTask = this.addTaskByTaskFormDTO(taskFormDTO, projectId);
|
|
|
+ Integer taskId = projectTask.getId();
|
|
|
+ this.addProjectTaskFileByFormDTO(fileFormDTO, taskId);
|
|
|
+
|
|
|
+ //如果是内部人员
|
|
|
+// if (projectTask.getHandlerType().equals(0)) {
|
|
|
+// this.checkProjectPerson(1, projectTask.getHandler(), projectTask.getProjectId(), projectTask.getId());
|
|
|
+// }
|
|
|
+ return projectTask.getId();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据任务id查询任务详情以及处理结果以及审核历史
|
|
|
+ *
|
|
|
+ * @param getExamineHistoryDTO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<TaskResultVO> getExamineHistory(GetExamineHistoryDTO getExamineHistoryDTO) throws IOException {
|
|
|
+ List<TaskResultVO> taskDetailsVOs = new ArrayList<>();
|
|
|
+ Integer taskId = getExamineHistoryDTO.getTaskId();
|
|
|
+ String fileGuid = getExamineHistoryDTO.getFileGuid();
|
|
|
+ Boolean ifGetLast = getExamineHistoryDTO.getIfGetLast();
|
|
|
+ String rootGuid = fileGuid;
|
|
|
+ if (fileGuid != null && !fileGuid.equals("")) {
|
|
|
+ AssoTaskFile assoTaskFile = assoTaskFileService.getAssoTaskFileByGuid(fileGuid);
|
|
|
+ if (assoTaskFile == null) {
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
+ if (taskId == null) {
|
|
|
+ taskId = assoTaskFile.getTaskId();
|
|
|
+ }
|
|
|
+ if (assoTaskFile.getRootFileGuid() != null) {
|
|
|
+ rootGuid = assoTaskFile.getRootFileGuid();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //根据taskId 查询任务
|
|
|
+
|
|
|
+ LambdaQueryWrapper<ProjectTask> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ ProjectTask projectTask = this.getById(taskId);
|
|
|
+ Integer rootTaskId = projectTask.getAssoTaskId();
|
|
|
+ if (rootTaskId == null) {
|
|
|
+ String path = projectTask.getTaskPath();
|
|
|
+ String key = null;
|
|
|
+ if (path == null) {
|
|
|
+ key = projectTask.getId() + "";
|
|
|
+ } else {
|
|
|
+ String[] paths = path.split("/");
|
|
|
+ key = paths[0];
|
|
|
+ }
|
|
|
+
|
|
|
+ queryWrapper.apply("id=" + key + " or find_in_set(" + key + ",REPLACE(task_path, '/', ',')) ");
|
|
|
+ } else {
|
|
|
+ queryWrapper.eq(ProjectTask::getAssoTaskId, rootTaskId);
|
|
|
+ }
|
|
|
+ List<ProjectTask> projectTasks = new ArrayList<>();
|
|
|
+ if (ifGetLast != null && ifGetLast) {
|
|
|
+ queryWrapper.orderByDesc(ProjectTask::getCreateTime);
|
|
|
+ ProjectTask projectTask1 = this.getOne(queryWrapper, false);
|
|
|
+ if (projectTask1 != null) {
|
|
|
+ projectTasks.add(projectTask1);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ queryWrapper.orderByAsc(ProjectTask::getCreateTime);
|
|
|
+ projectTasks = this.list(queryWrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ List<Integer> taskIds = projectTasks.stream().map(ProjectTask::getId).collect(Collectors.toList());
|
|
|
+
|
|
|
+ if (taskIds == null || taskIds.size() == 0) {
|
|
|
+ return taskDetailsVOs;
|
|
|
+ }
|
|
|
+ LambdaQueryWrapper<TaskHandleResult> resultLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ resultLambdaQueryWrapper.in(TaskHandleResult::getTaskId, taskIds);
|
|
|
+ List<TaskHandleResult> taskHandleResults = taskHandleResultService.list(resultLambdaQueryWrapper);
|
|
|
+ List<AssoHandleResultFile> resultFiles = new ArrayList<>();
|
|
|
+ List<Integer> resultIds = taskHandleResults.stream().map(TaskHandleResult::getId).collect(Collectors.toList());
|
|
|
+ if (resultIds != null && resultIds.size() > 0) {
|
|
|
+ LambdaQueryWrapper<AssoHandleResultFile> resultFileWrapper = new LambdaQueryWrapper<>();
|
|
|
+ resultFileWrapper.in(AssoHandleResultFile::getTaskHandleResultId, resultIds);
|
|
|
+ if (fileGuid != null && !fileGuid.equals("")) {
|
|
|
+ resultFileWrapper.eq(AssoHandleResultFile::getRootFileGuid, rootGuid);
|
|
|
+ }
|
|
|
+ resultFiles = assoHandleResultFileService.list(resultFileWrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ List<String> fileGuids = resultFiles.stream().map(AssoHandleResultFile::getFileGuid).collect(Collectors.toList());
|
|
|
+ List<SystemFile> systemFiles = new ArrayList<>();
|
|
|
+ if (!fileGuids.isEmpty()) {
|
|
|
+ String res = fileManagerService.getSystemFileFromFMS(fileGuids);
|
|
|
+ systemFiles = JSONObject.parseArray(res, SystemFile.class);
|
|
|
+ }
|
|
|
+
|
|
|
+ for (ProjectTask projectTask1 : projectTasks) {
|
|
|
+ TaskResultVO taskResultVO = new TaskResultVO();
|
|
|
+ Integer status = projectTask1.getStatus();
|
|
|
+ Integer taskId1 = projectTask1.getId();
|
|
|
+ Integer handleType = projectTask1.getHandlerType();
|
|
|
+ String handler = projectTask1.getHandler();
|
|
|
+ TaskHandleResult taskHandleResult = taskHandleResults.stream().filter(item -> item.getTaskId().equals(taskId1)).findFirst().orElse(null);
|
|
|
+ if (taskHandleResult != null) {
|
|
|
+ BeanUtils.copyProperties(taskHandleResult, taskResultVO);
|
|
|
+ List<String> temGuids = resultFiles.stream().filter(item -> item.getTaskHandleResultId().equals(taskHandleResult.getId())).map(AssoHandleResultFile::getFileGuid).collect(Collectors.toList());
|
|
|
+ if (temGuids != null && temGuids.size() > 0) {
|
|
|
+ List<SystemFile> systemFileList = systemFiles.stream().filter(item -> temGuids.contains(item.getGuid())).collect(Collectors.toList());
|
|
|
+ taskResultVO.setFiles(systemFileList);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ taskResultVO.setNextAuditor(projectTask1.getCreateId());
|
|
|
+ }
|
|
|
+ if (handleType.equals(0)) {
|
|
|
+ taskResultVO.setCreateId(handler);
|
|
|
+ } else {
|
|
|
+ taskResultVO.setCreateName(handler);
|
|
|
+ }
|
|
|
+ taskResultVO.setStatus(status);
|
|
|
+ taskDetailsVOs.add(taskResultVO);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //装载名称
|
|
|
+ this.loadTaskResultVos(taskDetailsVOs);
|
|
|
+ return taskDetailsVOs;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 装载任务详情的集合
|
|
|
+ *
|
|
|
+ * @param taskResultVOs
|
|
|
+ * @throws IOException
|
|
|
+ */
|
|
|
+ public void loadTaskResultVos(List<TaskResultVO> taskResultVOs) throws IOException {
|
|
|
+ //装载项目名称
|
|
|
+ List<String> createIds = taskResultVOs.stream().map(TaskResultVO::getCreateId).collect(Collectors.toList());
|
|
|
+
|
|
|
+ List<Personnel> personnels = new ArrayList<>();
|
|
|
+ //查询创建人名称
|
|
|
+ if (createIds.size() != 0) {
|
|
|
+ String res = permissionService.getPersonnelByIdsFromPCS(createIds);
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(res);
|
|
|
+ personnels = JSONObject.parseArray(jsonObject.getString("data"), Personnel.class);
|
|
|
+ }
|
|
|
+
|
|
|
+ //装载所有审查历史中的人员name
|
|
|
+ for (TaskResultVO taskResultVO : taskResultVOs) {
|
|
|
+ if (taskResultVO.getCreateName() == null) {
|
|
|
+ Personnel personnel = personnels.stream().filter(item -> item.getId().equals(taskResultVO.getCreateId())).findFirst().orElse(null);
|
|
|
+ if (personnel != null) {
|
|
|
+ taskResultVO.setCreateName(personnel.getPersonnelName());
|
|
|
+ } else {
|
|
|
+ throw new XiaoShiException("未获取到分配任务的负责人id信息");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ public TaskFormDTO toTaskFormDTO(ProjectTaskDTO projectTaskDTO) {
|
|
|
+ TaskFormDTO taskFormDTO = new TaskFormDTO();
|
|
|
+ taskFormDTO.setTaskType(1);
|
|
|
+ taskFormDTO.setHandlerType(projectTaskDTO.getHandlerType());
|
|
|
+ taskFormDTO.setHandler(projectTaskDTO.getHandler());
|
|
|
+ taskFormDTO.setDeadLineTime(projectTaskDTO.getDeadLineTime());
|
|
|
+ taskFormDTO.setName(projectTaskDTO.getName());
|
|
|
+ taskFormDTO.setDescription(projectTaskDTO.getDescription());
|
|
|
+ return taskFormDTO;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 从审核结果文件中,复制文件
|
|
|
+ *
|
|
|
+ * @param assoHandleResultFiles
|
|
|
+ * @param fileDTOS
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ public void getCopyFileDTOs(List<AssoHandleResultFile> assoHandleResultFiles, List<FileDTO> fileDTOS) throws Exception {
|
|
|
+ List<File> files = new ArrayList<>();
|
|
|
+ for (AssoHandleResultFile assoHandleResultFile : assoHandleResultFiles) {
|
|
|
+ String rootFileGuid = assoHandleResultFile.getFileGuid();
|
|
|
+ File file = fileManagerService.getOrgTempFileByGuid(assoHandleResultFile.getFileGuid());
|
|
|
+ files.add(file);
|
|
|
+ if (fileDTOS != null) {
|
|
|
+ List<String> guid2s = fileManagerService.uploadFileGetGuid2(Arrays.asList(file));
|
|
|
+ if (guid2s != null && guid2s.size() > 0) {
|
|
|
+ FileDTO fileDTO = new FileDTO();
|
|
|
+ fileDTO.setGuid(guid2s.get(0));
|
|
|
+ fileDTO.setRootGuid(rootFileGuid);
|
|
|
+ fileDTOS.add(fileDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ files.forEach(item -> item.delete());
|
|
|
+ }
|
|
|
}
|