需求审核人为发起人时,默认通过

This commit is contained in:
wangliwen 2022-07-07 10:04:06 +08:00
parent ec7da281e6
commit 03129a13c2
1 changed files with 10 additions and 0 deletions

View File

@ -21,6 +21,8 @@ import org.activiti.engine.TaskService;
import org.activiti.engine.delegate.*;
import org.activiti.engine.delegate.event.ActivitiEvent;
import org.activiti.engine.delegate.event.ActivitiEventListener;
import org.activiti.engine.task.Task;
import org.apache.commons.lang3.StringUtils;
import org.codehaus.jackson.map.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -156,6 +158,14 @@ public class DemandDataListener implements TaskListener, ExecutionListener, Acti
}
}
Task task = taskService.createTaskQuery().taskId(delegateTask.getId()).active().singleResult();
if (task != null && StringUtils.isNotEmpty(task.getAssignee())
&& StringUtils.isNotEmpty(demandDataDTO.getApplyUserId())
&& demandDataDTO.getApplyUserId().equals(task.getAssignee())) {
taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "发起人为审批人,默认通过");
taskService.complete(delegateTask.getId(), delegateTask.getVariables());
}
}
private void complete(DelegateTask delegateTask) {