| | |
| | | } |
| | | |
| | | @Override |
| | | public Boolean taskIsWait(String taskId, String processInsId) { |
| | | List<ProcessLog> list = new LambdaQueryChainWrapper<>(baseMapper) |
| | | .eq(ProcessLog::getProcessInsId, processInsId) |
| | | .eq(ProcessLog::getTaskId, taskId) |
| | | .list(); |
| | | return list.stream().anyMatch(log -> ProcessLogEventTypeEnum.WAIT.equals(log.getEventType())) |
| | | && list.stream().filter(log -> ProcessLogEventTypeEnum.FINISHED.equals(log.getEventType())).count() < 1; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean taskIsJump(String taskId, String processInsId) { |
| | | List<ProcessLog> list = new LambdaQueryChainWrapper<>(baseMapper) |
| | | .eq(ProcessLog::getProcessInsId, processInsId) |
| | | .eq(ProcessLog::getTaskId, taskId) |
| | | .eq(ProcessLog::getEventType, ProcessLogEventTypeEnum.JUMP) |
| | | .list(); |
| | | return list.size() > 0; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean taskIsTeamwork(String taskId, String processInsId) { |
| | | ProcessLog log = new LambdaQueryChainWrapper<>(baseMapper) |
| | | .eq(ProcessLog::getProcessInsId, processInsId) |
| | |
| | | log.setEventDataObj(delegateData); |
| | | } else if (ProcessLogEventTypeEnum.JUMP.equals(log.getEventType())) { |
| | | log.setEventDataObj(JSON.parseObject(log.getEventDataJson(), JumpData.class)); |
| | | } else if (ProcessLogEventTypeEnum.WAIT.equals(log.getEventType())) { |
| | | log.setEventDataObj(JSON.parseObject(log.getEventDataJson(), WaitData.class)); |
| | | } else if (ProcessLogEventTypeEnum.REJECT.equals(log.getEventType())) { |
| | | log.setEventDataObj(JSON.parseObject(log.getEventDataJson(), RejectData.class)); |
| | | } else if (ProcessLogEventTypeEnum.SUPERVISE.equals(log.getEventType())) { |
| | | SuperviseData superviseData = JSON.parseObject(log.getEventDataJson(), SuperviseData.class); |
| | | SysUser user = userService.selectUserById(Long.parseLong(superviseData.getSenderId())); |
| | | if (Objects.nonNull(user)) { |
| | | superviseData.setSenderName(user.getNickName() + "(" + (Objects.nonNull(user.getDept()) ? user.getDept().getDeptName() : "无部门") + ")"); |
| | | List<SuperviseData> superviseDataList = JSON.parseArray(log.getEventDataJson(), SuperviseData.class); |
| | | if (CollectionUtils.isNotEmpty(superviseDataList)) { |
| | | SysUser user = userService.selectUserById(Long.parseLong(superviseDataList.get(0).getSenderId())); |
| | | if (Objects.nonNull(user)) { |
| | | superviseDataList.get(0).setSenderName(user.getNickName() + "(" + (Objects.nonNull(user.getDept()) ? user.getDept().getDeptName() : "无部门") + ")"); |
| | | } |
| | | log.setEventDataObj(superviseDataList.get(0)); |
| | | } |
| | | log.setEventDataObj(superviseData); |
| | | |
| | | } else if (ProcessLogEventTypeEnum.HANGUP.equals(log.getEventType())) { |
| | | log.setEventDataObj(JSON.parseObject(log.getEventDataJson(), HangupData.class)); |
| | | } |
| | |
| | | } |
| | | } else if (HandlerTypeEnum.USER.equals(handlerType)) { |
| | | List<SysUser> users = userService.selectUserByIds(ids); |
| | | names = users.stream().map(user -> user.getNickName() + "(" + (Objects.nonNull(user.getDept()) ? user.getDept().getDeptName() : "无部门") + ")").collect(Collectors.toList()); |
| | | names.addAll(users.stream().map(user -> user.getNickName() + "(" + (Objects.nonNull(user.getDept()) ? user.getDept().getDeptName() : "无部门") + ")").collect(Collectors.toList())); |
| | | } else if (HandlerTypeEnum.DEPT.equals(handlerType)) { |
| | | List<SysDept> depts = deptService.selectDeptByIds(ids); |
| | | names = depts.stream().map(SysDept::getDeptName).collect(Collectors.toList()); |
| | | names.addAll(depts.stream().map(SysDept::getDeptName).collect(Collectors.toList())); |
| | | } else if (HandlerTypeEnum.ROLE.equals(handlerType)) { |
| | | List<SysRole> roles = roleService.selectRoleByIds(ids); |
| | | names = roles.stream().map(SysRole::getRoleName).collect(Collectors.toList()); |
| | | names.addAll(roles.stream().map(SysRole::getRoleName).collect(Collectors.toList())); |
| | | } |
| | | } |
| | | } |