|
@@ -10,6 +10,7 @@ import com.aizuda.bpm.engine.FlowLongEngine;
|
|
|
import com.aizuda.bpm.engine.core.FlowCreator;
|
|
|
import com.aizuda.bpm.engine.core.enums.*;
|
|
|
import com.aizuda.bpm.engine.entity.FlwExtInstance;
|
|
|
+import com.aizuda.bpm.engine.entity.FlwInstance;
|
|
|
import com.aizuda.bpm.engine.entity.FlwTask;
|
|
|
import com.aizuda.bpm.engine.entity.FlwTaskActor;
|
|
|
import com.aizuda.bpm.engine.listener.TaskListener;
|
|
@@ -23,6 +24,7 @@ import org.springframework.context.ApplicationEventPublisher;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.List;
|
|
|
+import java.util.Objects;
|
|
|
import java.util.Optional;
|
|
|
import java.util.function.Supplier;
|
|
|
|
|
@@ -47,9 +49,16 @@ public class FlowTaskListener implements TaskListener {
|
|
|
// 获取当前节点信息
|
|
|
NodeModel currentNodeModel = this.getNodeModel(flwTask, nodeModel);
|
|
|
if (null != flwTask) {
|
|
|
- if (NodeSetType.initiatorThemselves.eq(currentNodeModel.getSetType())) {
|
|
|
- // 发起人自己,自动跳过
|
|
|
- if (NodeApproveSelf.AutoSkip.eq(currentNodeModel.getApproveSelf())) {
|
|
|
+ // 发起人自己,自动跳过
|
|
|
+ if (NodeApproveSelf.AutoSkip.eq(currentNodeModel.getApproveSelf())) {
|
|
|
+ boolean autoSkip = false;
|
|
|
+ if (NodeSetType.initiatorThemselves.eq(currentNodeModel.getSetType())) {
|
|
|
+ autoSkip = true;
|
|
|
+ } else {
|
|
|
+ final FlwInstance instance = flowLongEngine.queryService().getInstance(flwTask.getInstanceId());
|
|
|
+ autoSkip = nodeModel.getNodeAssigneeList().stream().anyMatch(t -> Objects.equals(t.getId(), instance.getCreateId()));
|
|
|
+ }
|
|
|
+ if (autoSkip) {
|
|
|
// 执行自动跳转逻辑
|
|
|
flowLongEngine.autoJumpTask(flwTask.getId(), flowCreator);
|
|
|
}
|
|
@@ -102,6 +111,7 @@ public class FlowTaskListener implements TaskListener {
|
|
|
// 其它
|
|
|
String opinion = FlowHelper.getProcessApprovalOpinion();
|
|
|
if (StringUtils.hasLength(opinion)) {
|
|
|
+ FlowHelper.removeProcessApprovalOpinion();
|
|
|
content.setOpinion(opinion);
|
|
|
saveContent = true;
|
|
|
}
|