|
@@ -126,7 +126,7 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
flowExample.setStatus(FlowStatusEnum.IN_PROGRESS.getKey());
|
|
flowExample.setStatus(FlowStatusEnum.IN_PROGRESS.getKey());
|
|
} else {
|
|
} else {
|
|
// 流程已通过
|
|
// 流程已通过
|
|
- flowExample.setStatus(FlowStatusEnum.HAVE_PASSED.getKey());
|
|
|
|
|
|
+ flowExample.setStatus(FlowStatusEnum.PASS.getKey());
|
|
}
|
|
}
|
|
|
|
|
|
// 执行开始流程方法
|
|
// 执行开始流程方法
|
|
@@ -244,12 +244,13 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
// 赋值流程所在id
|
|
// 赋值流程所在id
|
|
flowExample.setDefinitionNodeId(nextUserNode.getId());
|
|
flowExample.setDefinitionNodeId(nextUserNode.getId());
|
|
|
|
|
|
- // 如果下一节点不为结束节点,赋值下一个节点处理用户id
|
|
|
|
|
|
+ // 如果下一节点为结束节点
|
|
if (NodeTypeEnum.END.equals(NodeTypeEnum.getEnum(nextUserNode.getNodeType()))) {
|
|
if (NodeTypeEnum.END.equals(NodeTypeEnum.getEnum(nextUserNode.getNodeType()))) {
|
|
// 流程已通过
|
|
// 流程已通过
|
|
- flowExample.setStatus(FlowStatusEnum.HAVE_PASSED.getKey());
|
|
|
|
- } else {
|
|
|
|
-
|
|
|
|
|
|
+ flowExample.setStatus(FlowStatusEnum.PASS.getKey());
|
|
|
|
+ }
|
|
|
|
+ // 如果下一节点不为结束节点
|
|
|
|
+ else {
|
|
FlowResult handleUser = getHandleUser(nextUserNode, dto.getHandleUserId());
|
|
FlowResult handleUser = getHandleUser(nextUserNode, dto.getHandleUserId());
|
|
|
|
|
|
// 如果下一节点处理用户只有1人,赋值用户id
|
|
// 如果下一节点处理用户只有1人,赋值用户id
|
|
@@ -269,7 +270,7 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
|
|
|
|
// 结束流程
|
|
// 结束流程
|
|
case REJECT:
|
|
case REJECT:
|
|
- flowExample.setStatus(FlowStatusEnum.REJECTED.getKey());
|
|
|
|
|
|
+ flowExample.setStatus(FlowStatusEnum.REJECT.getKey());
|
|
break;
|
|
break;
|
|
|
|
|
|
// 返回上一节点
|
|
// 返回上一节点
|
|
@@ -286,7 +287,7 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
// 如果流程回退到开始节点
|
|
// 如果流程回退到开始节点
|
|
if (NodeTypeEnum.START.getKey().equals(lastOneFlowExampleDetail.getFlowDefinitionNodeType())) {
|
|
if (NodeTypeEnum.START.getKey().equals(lastOneFlowExampleDetail.getFlowDefinitionNodeType())) {
|
|
// 流程未发起
|
|
// 流程未发起
|
|
- flowExample.setStatus(FlowStatusEnum.UNINITIATED.getKey());
|
|
|
|
|
|
+ flowExample.setStatus(FlowStatusEnum.READY_START.getKey());
|
|
} else {
|
|
} else {
|
|
// 流程进行中
|
|
// 流程进行中
|
|
flowExample.setStatus(FlowStatusEnum.IN_PROGRESS.getKey());
|
|
flowExample.setStatus(FlowStatusEnum.IN_PROGRESS.getKey());
|
|
@@ -302,7 +303,7 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
|
|
|
|
flowExample.setHandleUserId(exampleDetail.getCreateUser());
|
|
flowExample.setHandleUserId(exampleDetail.getCreateUser());
|
|
flowExample.setDefinitionNodeId(exampleDetail.getFlowDefinitionNodeId());
|
|
flowExample.setDefinitionNodeId(exampleDetail.getFlowDefinitionNodeId());
|
|
- flowExample.setStatus(FlowStatusEnum.UNINITIATED.getKey());
|
|
|
|
|
|
+ flowExample.setStatus(FlowStatusEnum.READY_START.getKey());
|
|
FlowThreadLocalUtil.setNextHandleUserId(exampleDetail.getCreateUser());
|
|
FlowThreadLocalUtil.setNextHandleUserId(exampleDetail.getCreateUser());
|
|
break;
|
|
break;
|
|
|
|
|
|
@@ -334,7 +335,7 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
flowExampleDetailList.add(nodeExampleDetail);
|
|
flowExampleDetailList.add(nodeExampleDetail);
|
|
|
|
|
|
// 如果流程已结束
|
|
// 如果流程已结束
|
|
- if (FlowStatusEnum.HAVE_PASSED.getKey().equals(flowExample.getStatus())) {
|
|
|
|
|
|
+ if (FlowStatusEnum.PASS.getKey().equals(flowExample.getStatus())) {
|
|
|
|
|
|
// 执行结束方法
|
|
// 执行结束方法
|
|
invokeEndMethod(nextUserNode, flowDelegate);
|
|
invokeEndMethod(nextUserNode, flowDelegate);
|
|
@@ -498,13 +499,16 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
if (sysDept == null) {
|
|
if (sysDept == null) {
|
|
throw new ServiceException("部门为空");
|
|
throw new ServiceException("部门为空");
|
|
}
|
|
}
|
|
|
|
+ // 部门负责人
|
|
if (HandleObjectTypeEnum.DETP_LEADER.equals(handleObjectTypeEnum)) {
|
|
if (HandleObjectTypeEnum.DETP_LEADER.equals(handleObjectTypeEnum)) {
|
|
Long leaderId = sysDept.getLeaderId();
|
|
Long leaderId = sysDept.getLeaderId();
|
|
if (leaderId == null) {
|
|
if (leaderId == null) {
|
|
throw new ServiceException("部门负责人为空");
|
|
throw new ServiceException("部门负责人为空");
|
|
}
|
|
}
|
|
flowResult.setUserId(leaderId);
|
|
flowResult.setUserId(leaderId);
|
|
- } else {
|
|
|
|
|
|
+ }
|
|
|
|
+ // 部门总监
|
|
|
|
+ else {
|
|
Long directorId = sysDept.getDirectorId();
|
|
Long directorId = sysDept.getDirectorId();
|
|
if (directorId == null) {
|
|
if (directorId == null) {
|
|
throw new ServiceException("部门总监为空");
|
|
throw new ServiceException("部门总监为空");
|