fix: 年度计划各部门主动上报办理BUG

This commit is contained in:
2023-11-01 14:33:29 +08:00
parent e6dc32961e
commit 5b58db29b2
@@ -19,6 +19,7 @@ import com.jero.modules.activiti.process.esAnnualReport.entity.vo.AnnualReportFl
import com.jero.modules.activiti.process.esAnnualReport.mapper.ProcessEsAnnualReportMapper;
import com.jero.modules.activiti.process.esAnnualReport.service.ProcessEsAnnualReportService;
import com.jero.modules.activiti.process.esInitChange.entity.enums.ESPProjectType;
import com.jero.modules.activiti.process.esInitChange.entity.vo.InitChangeFlowUserVO;
import com.jero.modules.activiti.service.ProcessAllService;
import com.jero.modules.activiti.service.ProcessNodeLinkService;
import com.jero.modules.activiti.service.ProcessNodeService;
@@ -237,8 +238,8 @@ public class ProcessEsAnnualReportServiceImpl extends ServiceImpl<ProcessEsAnnua
commonVO.setTaskId(process.getTaskId());
commonVO.setPrcMes(process.getPrcMes());
commonVO.setDueTime(process.getDueTime());
commonVO.setTaskId(taskId);
String processDescription = (String) runtimeService.getVariable(processInstanceId, "processDescription");
boolean distribute = (boolean) runtimeService.getVariable(processInstanceId, "distribute");
commonVO.setProcessDescription(processDescription);
annualReportDataVO.setCommonVO(commonVO);
// 获取流程实例数据
@@ -283,15 +284,19 @@ public class ProcessEsAnnualReportServiceImpl extends ServiceImpl<ProcessEsAnnua
}
private AnnualReportFlowUserVO getProcessUserInfo(String processDefinitionId, String processInstanceId) {
//TODO 每个节点返回的人员信息应该是不同的
List<ProcessNode> nodeList = processNodeService.getNodeList(processDefinitionId, processInstanceId);
AnnualReportFlowUserVO annualReportFlowUserVO = new AnnualReportFlowUserVO();
Map<String, ProcessNode> userMap = nodeList.stream().collect(Collectors.toMap(ProcessNode::getVariableName, node -> node));
annualReportFlowUserVO.setStandardEngineer(userMap.get("standardEngineer").getLinkUserIds());
annualReportFlowUserVO.setContactUserList(userMap.get("contactUserList").getLinkUserIds());
annualReportFlowUserVO.setWorkGroupUserList(userMap.get("workGroupUserList").getLinkUserIds());
annualReportFlowUserVO.setCollectUserLeader(userMap.get("collectUserLeader").getLinkUserIds());
annualReportFlowUserVO.setContactUserLeaderLeader(userMap.get("contactUserLeaderLeader").getLinkUserIds());
Map<String, ProcessNode> userMap = nodeList.stream()
.collect(Collectors.groupingBy(ProcessNode::getVariableName))
.values()
.stream()
.map(nodes -> nodes.get(0)) // 选择每组的第一个元素
.collect(Collectors.toMap(ProcessNode::getVariableName, node -> node));
Optional.ofNullable(userMap.get("standardEngineer")).ifPresent(node -> annualReportFlowUserVO.setStandardEngineer(node.getLinkUserIds()));
Optional.ofNullable(userMap.get("contactUserList")).ifPresent(node -> annualReportFlowUserVO.setContactUserList(node.getLinkUserIds()));
Optional.ofNullable(userMap.get("workGroupUserList")).ifPresent(node -> annualReportFlowUserVO.setWorkGroupUserList(node.getLinkUserIds()));
Optional.ofNullable(userMap.get("collectUserLeader")).ifPresent(node -> annualReportFlowUserVO.setCollectUserLeader(node.getLinkUserIds()));
Optional.ofNullable(userMap.get("contactUserLeaderLeader")).ifPresent(node -> annualReportFlowUserVO.setContactUserLeaderLeader(node.getLinkUserIds()));
return annualReportFlowUserVO;
}