|
@@ -107,9 +107,9 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
|
// 流程实例
|
|
|
FlowExample flowExample = new FlowExample();
|
|
|
|
|
|
- // 赋值下一个节点处理用户id
|
|
|
+ // 如果下一节点不为结束节点,赋值下一个节点处理用户id
|
|
|
if (!NodeTypeEnum.END.equals(nextNodeType)) {
|
|
|
- // 前端没有返回下一节点处理人
|
|
|
+ // 前端没有传下一节点处理人id
|
|
|
if (dto.getHandleUserId() == null) {
|
|
|
FlowResult handleUser = getHandleUser(nextUserNode);
|
|
|
// 如果下一节点处理用户只有1人,赋值用户id
|
|
@@ -121,7 +121,7 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
|
return handleUser;
|
|
|
}
|
|
|
}
|
|
|
- // 前端返回下一节点处理人
|
|
|
+ // 前端传下一节点处理人id
|
|
|
else {
|
|
|
// 传入用户id
|
|
|
flowExample.setHandleUserId(dto.getHandleUserId());
|
|
@@ -249,13 +249,13 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
|
// 赋值流程所在id
|
|
|
flowExample.setDefinitionNodeId(nextUserNode.getId());
|
|
|
|
|
|
- // 如果下个节点是结束节点
|
|
|
+ // 如果下一节点不为结束节点,赋值下一个节点处理用户id
|
|
|
if (NodeTypeEnum.END.equals(NodeTypeEnum.getEnum(nextUserNode.getNodeType()))) {
|
|
|
// 流程已通过
|
|
|
flowExample.setStatus(FlowStatusEnum.HAVE_PASSED.getKey());
|
|
|
} else {
|
|
|
|
|
|
- // 前端没有返回下一节点处理人
|
|
|
+ // 前端没有传下一节点处理人id
|
|
|
if (dto.getHandleUserId() == null) {
|
|
|
FlowResult handleUser = getHandleUser(nextUserNode);
|
|
|
// 如果下一节点处理用户只有1人,赋值用户id
|
|
@@ -267,7 +267,7 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
|
return handleUser;
|
|
|
}
|
|
|
}
|
|
|
- // 前端返回下一节点处理人
|
|
|
+ // 前端传下一节点处理人id
|
|
|
else {
|
|
|
// 传入用户id
|
|
|
flowExample.setHandleUserId(dto.getHandleUserId());
|
|
@@ -345,6 +345,7 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
|
}
|
|
|
|
|
|
flowExample.setVersion(dto.getVersion());
|
|
|
+
|
|
|
boolean b = flowExampleService.updateById(flowExample);
|
|
|
if (!b) {
|
|
|
throw new ServiceException("流程已被处理");
|
|
@@ -458,22 +459,6 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 校验el表达式
|
|
|
- */
|
|
|
- public boolean expressionResult(Map<String, Object> map, String expression) {
|
|
|
- boolean result;
|
|
|
- try {
|
|
|
- Expression exp = AviatorEvaluator.compile(expression);
|
|
|
- Object execute = exp.execute(map);
|
|
|
- result = Boolean.parseBoolean(String.valueOf(execute));
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("el表达式校验错误", e);
|
|
|
- throw new ServiceException("el表达式校验错误:" + e.getMessage());
|
|
|
- }
|
|
|
- return result;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
* 获取处理用户
|
|
|
*
|
|
|
* @param node 处理节点
|
|
@@ -531,4 +516,20 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
|
return flowResult;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 校验el表达式
|
|
|
+ */
|
|
|
+ public boolean expressionResult(Map<String, Object> map, String expression) {
|
|
|
+ boolean result;
|
|
|
+ try {
|
|
|
+ Expression exp = AviatorEvaluator.compile(expression);
|
|
|
+ Object execute = exp.execute(map);
|
|
|
+ result = Boolean.parseBoolean(String.valueOf(execute));
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("el表达式校验错误", e);
|
|
|
+ throw new ServiceException("el表达式校验错误:" + e.getMessage());
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
}
|