| | |
| | | if (historicProcessInstance == null) { |
| | | throw exception(PROCESS_INSTANCE_NOT_EXISTS); |
| | | } |
| | | AdminUserRespDTO startUser = adminUserApi.getUser(Long.valueOf(historicProcessInstance.getStartUserId())); |
| | | DeptRespDTO dept = deptApi.getDept(startUser.getDeptId()); |
| | | // 发起人 / 部门可能不存在(历史数据、用户已删除),需做空值保护 |
| | | AdminUserRespDTO startUser = adminUserApi.getUser(NumberUtils.parseLong(historicProcessInstance.getStartUserId())); |
| | | DeptRespDTO dept = startUser != null && startUser.getDeptId() != null |
| | | ? deptApi.getDept(startUser.getDeptId()) : null; |
| | | List<HistoricTaskInstance> tasks = taskService.getFinishedTaskListByProcessInstanceIdWithoutCancel(processInstanceId); |
| | | Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap( |
| | | convertSet(tasks, item -> Long.valueOf(item.getAssignee()))); |
| | | convertSet(tasks, item -> NumberUtils.parseLong(item.getAssignee()))); |
| | | UserSimpleBaseVO startUserVO = new UserSimpleBaseVO(); |
| | | if (startUser != null) { |
| | | startUserVO.setNickname(startUser.getNickname()); |
| | | } |
| | | if (dept != null) { |
| | | startUserVO.setDeptName(dept.getName()); |
| | | } |
| | | BpmProcessPrintDataRespVO printData = BpmProcessInstanceConvert.INSTANCE.buildProcessInstancePrintData( |
| | | historicProcessInstance, |
| | | processDefinitionService.getProcessDefinitionInfo(historicProcessInstance.getProcessDefinitionId()), |
| | | tasks, userMap, |
| | | new UserSimpleBaseVO().setNickname(startUser.getNickname()).setDeptName(dept.getName())); |
| | | tasks, userMap, startUserVO); |
| | | // 填充业务附件配置,实现打印自动展示外部业务信息 |
| | | businessAttachService.fillBusinessForm(printData.getProcessInstance().getProcessDefinition(), |
| | | processDefinitionService.getProcessDefinition(historicProcessInstance.getProcessDefinitionId()).getKey(), |