| | |
| | | import com.ycl.domain.entity.ProjectInfo; |
| | | import com.ycl.domain.entity.ProjectProcess; |
| | | import com.ycl.domain.form.RejectTaskForm; |
| | | import com.ycl.domain.form.TaskDelegationForm; |
| | | import com.ycl.domain.vo.CustomerTaskVO; |
| | | import com.ycl.domain.vo.ProjectProcessDetailVO; |
| | | import com.ycl.mapper.ProjectInfoMapper; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Result rejectTask(RejectTaskForm form) { |
| | | Task task = taskService.createTaskQuery().taskId(form.getTaskId()).singleResult(); |
| | | taskCommonService.reject(form.getRejectedTaskDefKey(), task.getTaskDefinitionKey(), task.getProcessInstanceId(), form.getTaskId(), form.getAuditOpinion()); |
| | | return Result.ok("驳回成功"); |
| | | public Result taskDelegation(TaskDelegationForm form) { |
| | | Task task = taskService.createTaskQuery().taskId(form.getTaskId()).includeIdentityLinks().singleResult(); |
| | | if (Objects.isNull(task)) { |
| | | throw new RuntimeException("未在运行任务中找到该任务,无法执行转办操作"); |
| | | } |
| | | // 需要先移除之前的处理人 |
| | | for (IdentityLinkInfo identityLink : task.getIdentityLinks()) { |
| | | if (StringUtils.isNotBlank(identityLink.getUserId())) { |
| | | taskService.deleteCandidateUser(task.getId(), identityLink.getUserId()); |
| | | } else if (StringUtils.isNotBlank(identityLink.getGroupId())) { |
| | | taskService.deleteCandidateGroup(task.getId(), identityLink.getGroupId()); |
| | | } |
| | | } |
| | | // 再新增处理人 |
| | | switch (form.getPeopleType()) { |
| | | case FIX_USER: |
| | | // 指定用户的话,只能选一个用户 |
| | | taskService.delegateTask(task.getId(), form.getTargetId()); |
| | | break; |
| | | case USER: |
| | | // 用户组的话,可以选多个用户,严格来说这里的用户组并不是flowable中的组的概念,只是开源框架有这个定义 |
| | | |
| | | } |
| | | |
| | | return Result.ok("转办成功"); |
| | | } |
| | | |
| | | /** |