|
@@ -269,25 +269,21 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
|
|
|
|
// 结束流程
|
|
// 结束流程
|
|
case REJECT:
|
|
case REJECT:
|
|
- flowExampleCurrentService.remove(q -> q.eq(FlowExampleCurrent::getFlowExampleId, context.getFlowExample().getId()));
|
|
|
|
flowResult = reject(context);
|
|
flowResult = reject(context);
|
|
break;
|
|
break;
|
|
|
|
|
|
// 返回上一节点
|
|
// 返回上一节点
|
|
case RETURN_TO_PREVIOUS:
|
|
case RETURN_TO_PREVIOUS:
|
|
- flowExampleCurrentService.remove(q -> q.eq(FlowExampleCurrent::getFlowExampleId, context.getFlowExample().getId()));
|
|
|
|
flowResult = returnToPrevious(context);
|
|
flowResult = returnToPrevious(context);
|
|
break;
|
|
break;
|
|
|
|
|
|
// 退回到发起人
|
|
// 退回到发起人
|
|
case RETURN_TO_SUBMITTER:
|
|
case RETURN_TO_SUBMITTER:
|
|
- flowExampleCurrentService.remove(q -> q.eq(FlowExampleCurrent::getFlowExampleId, context.getFlowExample().getId()));
|
|
|
|
flowResult = returnToSubmitter(context);
|
|
flowResult = returnToSubmitter(context);
|
|
break;
|
|
break;
|
|
|
|
|
|
// 作废
|
|
// 作废
|
|
case CANCELLATION:
|
|
case CANCELLATION:
|
|
- flowExampleCurrentService.remove(q -> q.eq(FlowExampleCurrent::getFlowExampleId, context.getFlowExample().getId()));
|
|
|
|
flowResult = cancellation(context);
|
|
flowResult = cancellation(context);
|
|
break;
|
|
break;
|
|
//加签
|
|
//加签
|
|
@@ -302,7 +298,6 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
break;
|
|
break;
|
|
// 退回到指定节点
|
|
// 退回到指定节点
|
|
case RETURN_TO_NODE:
|
|
case RETURN_TO_NODE:
|
|
- flowExampleCurrentService.remove(q -> q.eq(FlowExampleCurrent::getFlowExampleId, context.getFlowExample().getId()));
|
|
|
|
flowResult = returnToNode(context, dto);
|
|
flowResult = returnToNode(context, dto);
|
|
break;
|
|
break;
|
|
|
|
|
|
@@ -316,10 +311,17 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
return flowResult;
|
|
return flowResult;
|
|
}
|
|
}
|
|
|
|
|
|
- //删除当前用户待审批数据
|
|
|
|
|
|
+ //删除当前用户待审批数据,【退回、作废、驳回】删除全部待办
|
|
|
|
+ List<HandleTypeEnum> handleTypeEnums = Arrays.asList(
|
|
|
|
+ HandleTypeEnum.REJECT,
|
|
|
|
+ HandleTypeEnum.RETURN_TO_PREVIOUS,
|
|
|
|
+ HandleTypeEnum.RETURN_TO_SUBMITTER,
|
|
|
|
+ HandleTypeEnum.CANCELLATION,
|
|
|
|
+ HandleTypeEnum.RETURN_TO_NODE
|
|
|
|
+ );
|
|
flowExampleCurrentService.remove(q -> q
|
|
flowExampleCurrentService.remove(q -> q
|
|
.eq(FlowExampleCurrent::getFlowExampleId, context.getFlowExample().getId())
|
|
.eq(FlowExampleCurrent::getFlowExampleId, context.getFlowExample().getId())
|
|
- .eq(FlowExampleCurrent::getHandleUserId, SecurityUtils.getUserId())
|
|
|
|
|
|
+ .eq(!handleTypeEnums.contains(context.getHandleType()), FlowExampleCurrent::getHandleUserId, SecurityUtils.getUserId())
|
|
);
|
|
);
|
|
|
|
|
|
flowThreadLocal.setFlowStatusEnum(context.getFlowStatus());
|
|
flowThreadLocal.setFlowStatusEnum(context.getFlowStatus());
|
|
@@ -467,8 +469,6 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
// // 流程结束,则流程节点审批人不存在
|
|
// // 流程结束,则流程节点审批人不存在
|
|
// context.setJumpHandleUserId(null);
|
|
// context.setJumpHandleUserId(null);
|
|
|
|
|
|
- flowExampleCurrentService.remove(q -> q.eq(FlowExampleCurrent::getFlowExampleId, context.getFlowExample().getId()));
|
|
|
|
-
|
|
|
|
for (FlowDefinitionNode flowDefinitionNode : context.getFlowDefinitionNodeList()) {
|
|
for (FlowDefinitionNode flowDefinitionNode : context.getFlowDefinitionNodeList()) {
|
|
if (NodeTypeEnum.END.getKey().equals(flowDefinitionNode.getNodeType())) {
|
|
if (NodeTypeEnum.END.getKey().equals(flowDefinitionNode.getNodeType())) {
|
|
context.setJumpNodeList(new ArrayList<>());
|
|
context.setJumpNodeList(new ArrayList<>());
|
|
@@ -539,8 +539,6 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
// 流程未发起
|
|
// 流程未发起
|
|
context.setFlowStatus(FlowStatusEnum.CANCELLATION);
|
|
context.setFlowStatus(FlowStatusEnum.CANCELLATION);
|
|
|
|
|
|
- flowExampleCurrentService.remove(q -> q.eq(FlowExampleCurrent::getFlowExampleId, context.getFlowExample().getId()));
|
|
|
|
-
|
|
|
|
for (FlowDefinitionNode flowDefinitionNode : context.getFlowDefinitionNodeList()) {
|
|
for (FlowDefinitionNode flowDefinitionNode : context.getFlowDefinitionNodeList()) {
|
|
if (NodeTypeEnum.END.getKey().equals(flowDefinitionNode.getNodeType())) {
|
|
if (NodeTypeEnum.END.getKey().equals(flowDefinitionNode.getNodeType())) {
|
|
// 流程作废,则流程节点审批人不存在
|
|
// 流程作废,则流程节点审批人不存在
|
|
@@ -621,8 +619,9 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
|
|
|
|
// 查找指定节点信息
|
|
// 查找指定节点信息
|
|
FlowDefinitionNode jumpNode = nodeMap.get(handleNodeId);
|
|
FlowDefinitionNode jumpNode = nodeMap.get(handleNodeId);
|
|
|
|
+ List<FlowDefinitionNode> jumpNodeList = Collections.singletonList(jumpNode);
|
|
|
|
|
|
- context.setJumpNodeList(Collections.singletonList(jumpNode));
|
|
|
|
|
|
+ context.setJumpNodeList(jumpNodeList);
|
|
|
|
|
|
// 如果流程回退到开始节点
|
|
// 如果流程回退到开始节点
|
|
if (NodeTypeEnum.START.getKey().equals(jumpNode.getNodeType())) {
|
|
if (NodeTypeEnum.START.getKey().equals(jumpNode.getNodeType())) {
|
|
@@ -633,11 +632,9 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
return new FlowResult(true);
|
|
return new FlowResult(true);
|
|
}
|
|
}
|
|
|
|
|
|
- FlowResult flowResult = getHandleUser(jumpNode, context.getSelectUserList());
|
|
|
|
|
|
+ FlowResult flowResult = setNextHandleNodeHandleUser(jumpNodeList, context.getSelectUserList());
|
|
// 流程进行中
|
|
// 流程进行中
|
|
context.setFlowStatus(FlowStatusEnum.IN_PROGRESS);
|
|
context.setFlowStatus(FlowStatusEnum.IN_PROGRESS);
|
|
- // 赋值流程节点审批人
|
|
|
|
- jumpNode.setJumpHandleUserId(flowResult.getUserId());
|
|
|
|
|
|
|
|
return flowResult;
|
|
return flowResult;
|
|
}
|
|
}
|