|
|
@@ -48,7 +48,7 @@ import com.wflow.mapper.WflowCcTasksMapper; |
|
|
|
import com.wflow.mapper.WflowModelHistorysMapper; |
|
|
|
import com.wflow.service.OrgRepositoryService; |
|
|
|
import com.wflow.utils.CodeUtil; |
|
|
|
import com.wflow.workflow.bean.process.OrgUser; |
|
|
|
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; |
|
|
|
import com.wflow.workflow.bean.process.ProcessNode; |
|
|
|
import com.wflow.workflow.bean.process.enums.ApprovalModeEnum; |
|
|
|
import com.wflow.workflow.bean.process.enums.NodeTypeEnum; |
|
|
@@ -56,7 +56,6 @@ import com.wflow.workflow.bean.process.form.Form; |
|
|
|
import com.wflow.workflow.bean.process.props.ApprovalProps; |
|
|
|
import com.wflow.workflow.bean.vo.ProcessInstanceVo; |
|
|
|
import com.wflow.workflow.bean.vo.ProcessTaskVo; |
|
|
|
import com.wflow.workflow.bean.vo.UserInfoVO; |
|
|
|
import com.wflow.workflow.config.WflowGlobalVarDef; |
|
|
|
import com.wflow.workflow.enums.ProcessHandlerEnum; |
|
|
|
import com.wflow.workflow.service.FormService; |
|
|
@@ -177,12 +176,14 @@ public class TodoCenterManage { |
|
|
|
// 从待办任务列表中取出当前登录用户及项目实例对应的任务 |
|
|
|
Task task = taskMap.get(d.getInstCode()); |
|
|
|
HistoricProcessInstance instance = instanceMap.get(task.getProcessInstanceId()); |
|
|
|
|
|
|
|
//HashSet<String> userSet = new HashSet<>(); |
|
|
|
//userSet.add(instance.getStartUserId()) ; |
|
|
|
//Map<Long, UserInfoVO> userMap = userInfoService.getUserMapByIds(userSet); |
|
|
|
//res.setOwner(userMap.get(Long.valueOf(instance.getStartUserId()))); |
|
|
|
UserInfoVO owner = new UserInfoVO(); |
|
|
|
owner.setUserId(Long.valueOf(instance.getStartUserId())); |
|
|
|
//Map<String, ProcessInstanceUserDto> userMap = userInfoService.getUserMapByIds(userSet); |
|
|
|
//res.setOwner(userMap.get((instance.getStartUserId()))); |
|
|
|
|
|
|
|
ProcessInstanceUserDto owner = new ProcessInstanceUserDto(); |
|
|
|
owner.setUserId(instance.getStartUserId()); |
|
|
|
res.setOwner(owner); |
|
|
|
// 从缓存取 |
|
|
|
staterUsers.add(String.valueOf(userId)); |
|
|
@@ -210,7 +211,7 @@ public class TodoCenterManage { |
|
|
|
// 取用户信息,减少数据库查询,一次构建 |
|
|
|
List<ResToBeProcessedDTO> result = null; |
|
|
|
if (isNotEmpty(staterUsers)) { |
|
|
|
//Map<Long, UserInfoVO> userMap = userInfoService.getUserMapByIds(staterUsers); |
|
|
|
//Map<String, ProcessInstanceUserDto> userMap = userInfoService.getUserMapByIds(staterUsers); |
|
|
|
//result = resVos.stream() |
|
|
|
// .peek(v -> v.getProcessTaskInfo().setStartUser(userMap.get(Long.valueOf(v.getProcessTaskInfo().getOwnerId())))) |
|
|
|
// .collect(Collectors.toList()); |
|
|
@@ -910,7 +911,6 @@ public class TodoCenterManage { |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询流程表单数据及审批的进度步骤 |
|
|
|
* @param nodeId 当前获取流程人员关联的流程节点ID |
|
|
|
* @param instanceId 流程实例ID |
|
|
|
* @return 流程进度及表单详情 |
|
|
|
*/ |
|
|
@@ -953,6 +953,7 @@ public class TodoCenterManage { |
|
|
|
Map<String, Object> nodePropsValue = (Map<String, Object>) nodeProps.getValue(); |
|
|
|
|
|
|
|
ProcessNode<?> currentNode = null; |
|
|
|
|
|
|
|
//if (StrUtil.isNotBlank(nodeId)) { |
|
|
|
// // 搜索当前版本流程的配置 |
|
|
|
// WflowModelHistorys modelHistory = modelHistorysMapper.selectOne(new QueryWrapper<>(WflowModelHistorys.builder() |
|
|
@@ -962,16 +963,20 @@ public class TodoCenterManage { |
|
|
|
// currentNode = nodeCatchService.reloadProcessByStr(modelHistory.getProcess()).get(nodeId); |
|
|
|
//} |
|
|
|
// 搜索当前版本流程的配置 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WflowModelHistorys modelHistory = modelHistorysMapper.selectOne(new QueryWrapper<>(WflowModelHistorys.builder() |
|
|
|
.processDefId(instance.getProcessDefinitionId()) |
|
|
|
.version(instance.getProcessDefinitionVersion()) |
|
|
|
.build())); |
|
|
|
currentNode = nodeCatchService.reloadProcessByStr(modelHistory.getProcess()).get("undefined"); |
|
|
|
|
|
|
|
//UserInfo userInfo = userInfoService.getById(Long.valueOf(instance.getStartUserId())); |
|
|
|
//HashSet<String> userSet = new HashSet<>(); |
|
|
|
//userSet.add(String.valueOf(userInfo.getId())); |
|
|
|
//Map<Long, UserInfoVO> userMap = userInfoService.getUserMapByIds(userSet); |
|
|
|
//UserInfoVO userInfoVO = userMap.get(userInfo.getId()); |
|
|
|
//Map<String, ProcessInstanceUserDto> userMap = userInfoService.getUserMapByIds(userSet); |
|
|
|
//ProcessInstanceUserDto startUser = userMap.get(String.valueOf(userInfo.getId())); |
|
|
|
List<ProgressNode> taskRecords = getHisTaskRecords(instanceId, nodePropsValue); |
|
|
|
// 获取添加抄送任务 |
|
|
|
taskRecords.addAll(getCcTaskRecords(instanceId)); |
|
|
@@ -1004,7 +1009,7 @@ public class TodoCenterManage { |
|
|
|
.startTime(instance.getStartTime()) |
|
|
|
.progress(taskRecords) |
|
|
|
.build(); |
|
|
|
//res.setStartUser(userInfoVO); |
|
|
|
//res.setStartUser(startUser); |
|
|
|
Project project = projectService.getById(projectId); |
|
|
|
res.setStatus(ProcessStatusEnum.getDescByCode(project.getProcessStatus())); |
|
|
|
return res; |
|
|
@@ -1025,13 +1030,13 @@ public class TodoCenterManage { |
|
|
|
ccUsers.add(task.getUserId()); |
|
|
|
return ProgressNode.builder().nodeId(task.getNodeId()).nodeType(NodeTypeEnum.CC) |
|
|
|
.name(task.getNodeName()) |
|
|
|
.user(UserInfoVO.builder().userId(Long.valueOf(task.getUserId())).build()) |
|
|
|
.user(ProcessInstanceUserDto.builder().userId(task.getUserId()).build()) |
|
|
|
.startTime(task.getCreateTime()) |
|
|
|
.finishTime(task.getCreateTime()) |
|
|
|
.build(); |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
if (isNotEmpty(ccUsers)) { |
|
|
|
Map<Long, UserInfoVO> userMap = userInfoService.getUserMapByIds(ccUsers); |
|
|
|
Map<String, ProcessInstanceUserDto> userMap = userInfoService.getUserMapByIds(ccUsers); |
|
|
|
ccList.stream().peek(v -> v.setUser(userMap.get(v.getUser().getUserId()))).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
return ccList; |
|
|
@@ -1066,7 +1071,7 @@ public class TodoCenterManage { |
|
|
|
.commentType(comment.getType()) |
|
|
|
.type("COMMENT") |
|
|
|
.createTime(comment.getTime()) |
|
|
|
.user(UserInfoVO.builder().userId(Long.valueOf(comment.getUserId())).build()) |
|
|
|
.user(ProcessInstanceUserDto.builder().userId(comment.getUserId()).build()) |
|
|
|
.build(); |
|
|
|
ProcessComment processComment = JSONObject.parseObject(comment.getFullMessage(), ProcessComment.class); |
|
|
|
progressNodeAuditInfoVo.setText(processComment.getText()); |
|
|
@@ -1094,7 +1099,7 @@ public class TodoCenterManage { |
|
|
|
.nodeId(his.getActivityId()) |
|
|
|
.name(his.getActivityName()) |
|
|
|
.nodeType(NodeTypeEnum.APPROVAL) |
|
|
|
.user(UserInfoVO.builder().userId(Long.valueOf(his.getAssignee())).build()) |
|
|
|
.user(ProcessInstanceUserDto.builder().userId(his.getAssignee()).build()) |
|
|
|
.startTime(his.getStartTime()) |
|
|
|
.finishTime(his.getEndTime()) |
|
|
|
.taskId(his.getTaskId()) |
|
|
@@ -1103,7 +1108,7 @@ public class TodoCenterManage { |
|
|
|
.result(varMap.get("approve_" + his.getTaskId())).build(); |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
if (isNotEmpty(userSet)) { |
|
|
|
Map<Long, UserInfoVO> userMap = userInfoService.getUserMapByIds(userSet); |
|
|
|
Map<String, ProcessInstanceUserDto> userMap = userInfoService.getUserMapByIds(userSet); |
|
|
|
progressNodes.stream().peek(v -> v.setUser(userMap.get(v.getUser().getUserId()))).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
return progressNodes; |
|
|
@@ -1187,10 +1192,10 @@ public class TodoCenterManage { |
|
|
|
HistoricProcessInstance instance = instanceMap.get(task.getProcessInstanceId()); |
|
|
|
//HashSet<String> userSet = new HashSet<>(); |
|
|
|
//userSet.add(instance.getStartUserId()) ; |
|
|
|
//Map<Long, UserInfoVO> userMap = userInfoService.getUserMapByIds(userSet); |
|
|
|
//res.setOwner(userMap.get(Long.valueOf(instance.getStartUserId()))); |
|
|
|
UserInfoVO owner = new UserInfoVO(); |
|
|
|
owner.setUserId(Long.valueOf(instance.getStartUserId())); |
|
|
|
//Map<String, ProcessInstanceUserDto> userMap = userInfoService.getUserMapByIds(userSet); |
|
|
|
//res.setOwner(userMap.get(instance.getStartUserId())); |
|
|
|
ProcessInstanceUserDto owner = new ProcessInstanceUserDto(); |
|
|
|
owner.setUserId(instance.getStartUserId()); |
|
|
|
res.setOwner(owner); |
|
|
|
// 从缓存取 |
|
|
|
staterUsers.add(instance.getStartUserId()); |
|
|
@@ -1210,9 +1215,9 @@ public class TodoCenterManage { |
|
|
|
// 取用户信息,减少数据库查询,一次构建 |
|
|
|
List<ResToBeProcessedDTO> result = null; |
|
|
|
if (isNotEmpty(staterUsers)) { |
|
|
|
//Map<Long, UserInfoVO> userMap = userInfoService.getUserMapByIds(staterUsers); |
|
|
|
//Map<String, ProcessInstanceUserDto> userMap = userInfoService.getUserMapByIds(staterUsers); |
|
|
|
//result = resVos.stream().peek(v -> v.getProcessTaskInfo() |
|
|
|
// .setStartUser(userMap.get(Long.valueOf(v.getProcessTaskInfo().getOwnerId())))) |
|
|
|
// .setStartUser(userMap.get(v.getProcessTaskInfo().getOwnerId()))) |
|
|
|
// .collect(Collectors.toList()); |
|
|
|
} |
|
|
|
// return PageVo.of(result, total); |
|
|
@@ -1369,11 +1374,11 @@ public class TodoCenterManage { |
|
|
|
HistoricProcessInstance ist = instanceMap.get(d.getInstCode()); |
|
|
|
staterUsers.add(ist.getStartUserId()); |
|
|
|
//HashSet<String> userSet = new HashSet<>(); |
|
|
|
//userSet.add(instance.getStartUserId()) ; |
|
|
|
//Map<Long, UserInfoVO> userMap = userInfoService.getUserMapByIds(userSet); |
|
|
|
//res.setOwner(userMap.get(Long.valueOf(ist.getStartUserId()))); |
|
|
|
UserInfoVO owner = new UserInfoVO(); |
|
|
|
owner.setUserId(Long.valueOf(ist.getStartUserId())); |
|
|
|
//userSet.add(ist.getStartUserId()) ; |
|
|
|
//Map<String, ProcessInstanceUserDto> userMap = userInfoService.getUserMapByIds(userSet); |
|
|
|
//res.setOwner(userMap.get(ist.getStartUserId())); |
|
|
|
ProcessInstanceUserDto owner = new ProcessInstanceUserDto(); |
|
|
|
owner.setUserId(ist.getStartUserId()); |
|
|
|
res.setOwner(owner); |
|
|
|
ProcessInstanceVo processInstanceVo = getProcessInstanceVos(ist); |
|
|
|
res.setProcessInstanceInfo(processInstanceVo); |
|
|
@@ -1386,9 +1391,9 @@ public class TodoCenterManage { |
|
|
|
// 取用户信息,减少数据库查询,一次构建 |
|
|
|
List<ResToBeProcessedDTO> result = null; |
|
|
|
if (isNotEmpty(staterUsers)) { |
|
|
|
//Map<Long, UserInfoVO> userMap = userInfoService.getUserMapByIds(staterUsers); |
|
|
|
//Map<String, ProcessInstanceUserDto> userMap = userInfoService.getUserMapByIds(staterUsers); |
|
|
|
//result = resVos.stream() |
|
|
|
// .peek(v -> v.getProcessTaskInfo().setStartUser(userMap.get(Long.valueOf(v.getProcessTaskInfo().getOwnerId())))) |
|
|
|
// .peek(v -> v.getProcessTaskInfo().setStartUser(userMap.get(v.getProcessTaskInfo().getOwnerId()))) |
|
|
|
// .collect(Collectors.toList()); |
|
|
|
} |
|
|
|
// return PageVo.of(result, total); |
|
|
@@ -1592,11 +1597,11 @@ public class TodoCenterManage { |
|
|
|
HistoricProcessInstance ist = instanceMap.get(d.getInstCode()); |
|
|
|
staterUsers.add(ist.getStartUserId()); |
|
|
|
//HashSet<String> userSet = new HashSet<>(); |
|
|
|
//userSet.add(instance.getStartUserId()) ; |
|
|
|
//Map<Long, UserInfoVO> userMap = userInfoService.getUserMapByIds(userSet); |
|
|
|
//res.setOwner(userMap.get(Long.valueOf(ist.getStartUserId()))); |
|
|
|
UserInfoVO owner = new UserInfoVO(); |
|
|
|
owner.setUserId(Long.valueOf(ist.getStartUserId())); |
|
|
|
//userSet.add(ist.getStartUserId()) ; |
|
|
|
//Map<String, ProcessInstanceUserDto> userMap = userInfoService.getUserMapByIds(userSet); |
|
|
|
//res.setOwner(userMap.get(ist.getStartUserId())); |
|
|
|
ProcessInstanceUserDto owner = new ProcessInstanceUserDto(); |
|
|
|
owner.setUserId(ist.getStartUserId()); |
|
|
|
res.setOwner(owner); |
|
|
|
ProcessInstanceVo processInstanceVo = getProcessInstanceVos(ist); |
|
|
|
res.setProcessInstanceInfo(processInstanceVo); |
|
|
@@ -1608,9 +1613,9 @@ public class TodoCenterManage { |
|
|
|
// 取用户信息,减少数据库查询,一次构建 |
|
|
|
List<ResToBeProcessedDTO> result = null; |
|
|
|
if (isNotEmpty(staterUsers)) { |
|
|
|
//Map<Long, UserInfoVO> userMap = userInfoService.getUserMapByIds(staterUsers); |
|
|
|
//Map<String, ProcessInstanceUserDto> userMap = userInfoService.getUserMapByIds(staterUsers); |
|
|
|
//result = resVos.stream() |
|
|
|
// .peek(v -> v.getProcessTaskInfo().setStartUser(userMap.get(Long.valueOf(v.getProcessTaskInfo().getOwnerId())))) |
|
|
|
// .peek(v -> v.getProcessTaskInfo().setStartUser(userMap.get(v.getProcessTaskInfo().getOwnerId()))) |
|
|
|
// .collect(Collectors.toList()); |
|
|
|
} |
|
|
|
// return PageVo.of(result, total); |
|
|
|