|
@@ -8,10 +8,7 @@ import com.flow.entity.Notify;
|
|
import com.flow.entity.node.Node;
|
|
import com.flow.entity.node.Node;
|
|
import com.flow.entity.settings.CancelConfig;
|
|
import com.flow.entity.settings.CancelConfig;
|
|
import com.flow.entity.settings.Settings;
|
|
import com.flow.entity.settings.Settings;
|
|
-import com.flow.enums.ApprovalNobodyEnum;
|
|
|
|
-import com.flow.enums.AssigneeTypeEnum;
|
|
|
|
-import com.flow.enums.NotifyEnum;
|
|
|
|
-import com.flow.enums.ProcessStatus;
|
|
|
|
|
|
+import com.flow.enums.*;
|
|
import com.flow.flowable.event.CustomFlowableEngineEvent;
|
|
import com.flow.flowable.event.CustomFlowableEngineEvent;
|
|
import com.flow.flowable.model.JumpServiceTask;
|
|
import com.flow.flowable.model.JumpServiceTask;
|
|
import com.flow.flowable.utils.ProcessElementUtil;
|
|
import com.flow.flowable.utils.ProcessElementUtil;
|
|
@@ -23,6 +20,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
import org.flowable.bpmn.model.FlowElement;
|
|
import org.flowable.bpmn.model.FlowElement;
|
|
import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent;
|
|
import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent;
|
|
import org.flowable.common.engine.api.delegate.event.FlowableEngineEvent;
|
|
import org.flowable.common.engine.api.delegate.event.FlowableEngineEvent;
|
|
|
|
+import org.flowable.engine.RuntimeService;
|
|
import org.flowable.engine.TaskService;
|
|
import org.flowable.engine.TaskService;
|
|
import org.flowable.engine.delegate.DelegateExecution;
|
|
import org.flowable.engine.delegate.DelegateExecution;
|
|
import org.flowable.engine.delegate.event.AbstractFlowableEngineEventListener;
|
|
import org.flowable.engine.delegate.event.AbstractFlowableEngineEventListener;
|
|
@@ -52,6 +50,8 @@ public class GlobalActivityEventListener extends AbstractFlowableEngineEventList
|
|
@Autowired
|
|
@Autowired
|
|
private TaskService taskService;
|
|
private TaskService taskService;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private RuntimeService runtimeService;
|
|
|
|
+ @Autowired
|
|
private NotifyService notifyService;
|
|
private NotifyService notifyService;
|
|
@Autowired
|
|
@Autowired
|
|
private FlowInstanceService flowInstanceService;
|
|
private FlowInstanceService flowInstanceService;
|
|
@@ -74,12 +74,14 @@ public class GlobalActivityEventListener extends AbstractFlowableEngineEventList
|
|
if (assigneeType.equals(AssigneeTypeEnum.AUTO_PASS.getType())) {
|
|
if (assigneeType.equals(AssigneeTypeEnum.AUTO_PASS.getType())) {
|
|
// 自动通过
|
|
// 自动通过
|
|
flowTaskService.autoComplete(entity.getId());
|
|
flowTaskService.autoComplete(entity.getId());
|
|
|
|
+ return;
|
|
} else if (assigneeType.equals(AssigneeTypeEnum.AUTO_REFUSE.getType())) {
|
|
} else if (assigneeType.equals(AssigneeTypeEnum.AUTO_REFUSE.getType())) {
|
|
// 自动拒绝
|
|
// 自动拒绝
|
|
flowTaskService.autoRefuse(entity.getId());
|
|
flowTaskService.autoRefuse(entity.getId());
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
- return;
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
// 审批人为空方式
|
|
// 审批人为空方式
|
|
if (StringUtils.isBlank(entity.getAssignee()) || "-000000".equals(entity.getAssignee())) {
|
|
if (StringUtils.isBlank(entity.getAssignee()) || "-000000".equals(entity.getAssignee())) {
|
|
entity.setAssignee("admin");
|
|
entity.setAssignee("admin");
|