| | |
| | | taskStatistics.setTodoTaskNum(this.getTodoTaskNum(projectProcess.getProcessInsId())); |
| | | taskStatistics.setRemainingTaskNum(this.getRemainingTaskNum(processDefId, projectProcess.getProcessInsId())); |
| | | // taskStatistics.setCurrentTask(this.getCurrentNodeTaskList(projectProcess.getProcessInstanceId())); |
| | | taskStatistics.setRemainingTaskNum(this.getNotFinishedTaskNum(projectProcess.getProcessInsId())); |
| | | taskStatistics.setRemainingTaskNum(this.getRemainingTaskNum(projectProcess.getProcessDefId(), projectProcess.getProcessInsId())); |
| | | detail.setStatistics(taskStatistics); |
| | | |
| | | Result result = Result.ok(); |
| | |
| | | if (StringUtils.isNotBlank(identityLink.getUserId())) { |
| | | SysUser sysUser = sysUserService.selectUserById(Long.parseLong(identityLink.getUserId())); |
| | | if (Objects.nonNull(sysUser)) { |
| | | taskVO.setHandlerType(HandlerTypeEnum.USER); |
| | | taskVO.setHandlerId(sysUser.getUserId()); |
| | | if (Objects.nonNull(sysUser.getDept())) { |
| | | taskVO.setHandlerUnitId(sysUser.getDept().getDeptId()); |
| | |
| | | // 绑定的是角色或者是部门,需要根据id判断 |
| | | } else if (StringUtils.isNotBlank(identityLink.getGroupId())) { |
| | | if (identityLink.getGroupId().startsWith("dept")) { // 部门的id是加了前缀的如:dept:1 |
| | | taskVO.setHandlerType(HandlerTypeEnum.DEPT); |
| | | String[] split = identityLink.getGroupId().split(":"); |
| | | if (split.length > 1) { |
| | | // 部门 |
| | |
| | | } |
| | | } |
| | | } else { |
| | | taskVO.setHandlerType(HandlerTypeEnum.ROLE); |
| | | SysRole role = sysRoleService.selectRoleById(Long.parseLong(identityLink.getGroupId())); |
| | | if (Objects.nonNull(role)) { |
| | | taskVO.setHandlerUnitId(Long.parseLong(identityLink.getGroupId())); |
| | |
| | | for (IdentityLinkInfo identityLink : identityLinkInfos) { |
| | | // 绑定的是用户,查出用户姓名、部门 |
| | | if (StringUtils.isNotBlank(identityLink.getUserId())) { |
| | | taskVO.setHandlerType(HandlerTypeEnum.USER); |
| | | SysUser sysUser = sysUserService.selectUserById(Long.parseLong(identityLink.getUserId())); |
| | | if (Objects.nonNull(sysUser)) { |
| | | // taskVO.setHandlerId(sysUser.getUserId()); |
| | |
| | | // 绑定的是角色,查出角色名称 |
| | | } else if (StringUtils.isNotBlank(identityLink.getGroupId())) { |
| | | if (identityLink.getGroupId().startsWith("dept")) { |
| | | taskVO.setHandlerType(HandlerTypeEnum.DEPT); |
| | | String[] split = identityLink.getGroupId().split(":"); |
| | | if (split.length > 1) { |
| | | // 部门 |
| | |
| | | taskVO.setHandlerUnitName(dept.getDeptName()); |
| | | } |
| | | } |
| | | } |
| | | SysRole role = sysRoleService.selectRoleById(Long.parseLong(identityLink.getGroupId())); |
| | | if (Objects.nonNull(role)) { |
| | | taskVO.setHandlerUnitId(Long.parseLong(identityLink.getGroupId())); |
| | | taskVO.setHandlerUnitName("由拥有角色:【" + role.getRoleName() + "】的人处理"); |
| | | } else { |
| | | taskVO.setHandlerType(HandlerTypeEnum.ROLE); |
| | | SysRole role = sysRoleService.selectRoleById(Long.parseLong(identityLink.getGroupId())); |
| | | if (Objects.nonNull(role)) { |
| | | taskVO.setHandlerUnitId(Long.parseLong(identityLink.getGroupId())); |
| | | taskVO.setHandlerUnitName("由拥有角色:【" + role.getRoleName() + "】的人处理"); |
| | | // taskVO.setHandlerName(role.getRoleName()); |
| | | // taskVO.setHandlerId(null); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | */ |
| | | private Long getTotalTaskNum(String processDefinitionId) { |
| | | return Long.valueOf(this.getAllUserTaskElement(processDefinitionId).size()); |
| | | } |
| | | |
| | | /** |
| | | * 获取流程剩余未完成的任务数 |
| | | * |
| | | * @param processInstanceId |
| | | * @return |
| | | */ |
| | | private Long getNotFinishedTaskNum(String processInstanceId) { |
| | | return historyService.createHistoricTaskInstanceQuery().processInstanceId(processInstanceId).processUnfinished().count(); |
| | | } |
| | | |
| | | /** |