|
@@ -84,9 +84,9 @@ public class PreExecutionToolClass<R> {
|
|
/**
|
|
/**
|
|
* 根据流程key校验当前流程数据的完整性,是否可以运行
|
|
* 根据流程key校验当前流程数据的完整性,是否可以运行
|
|
*/
|
|
*/
|
|
-// if (!iVerifyExecutionProcess.VerifyProcessData(intoProduction.getTaskProcessKey())) {
|
|
|
|
-// return AjaxResult.error(HttpStatus.EXECUTEPROCESS, "流程数据验证失败!");
|
|
|
|
-// }
|
|
|
|
|
|
+ // if (!iVerifyExecutionProcess.VerifyProcessData(intoProduction.getTaskProcessKey())) {
|
|
|
|
+ // return AjaxResult.error(HttpStatus.EXECUTEPROCESS, "流程数据验证失败!");
|
|
|
|
+ // }
|
|
/**1️⃣1️⃣1️⃣ 得到当前投产需要执行的流程详细信息*/
|
|
/**1️⃣1️⃣1️⃣ 得到当前投产需要执行的流程详细信息*/
|
|
//--得到当前流程的详细信息
|
|
//--得到当前流程的详细信息
|
|
BpmProcess bpmProcess = bpmProcessMapper.selectBpmProcessByProcessKey(
|
|
BpmProcess bpmProcess = bpmProcessMapper.selectBpmProcessByProcessKey(
|
|
@@ -196,8 +196,6 @@ public class PreExecutionToolClass<R> {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- System.err.println("🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀");
|
|
|
|
- System.err.println(script0.toString().toString());
|
|
|
|
// 手动异常触发脚本
|
|
// 手动异常触发脚本
|
|
bpmExecuteNodeMiddle.setTaskArtificialScriptKey(script0.toString().replaceAll("\\[", "").replaceAll("\\]", ""));
|
|
bpmExecuteNodeMiddle.setTaskArtificialScriptKey(script0.toString().replaceAll("\\[", "").replaceAll("\\]", ""));
|
|
// 正常节点自动触发脚本
|
|
// 正常节点自动触发脚本
|
|
@@ -217,7 +215,6 @@ public class PreExecutionToolClass<R> {
|
|
item.setTaskArtificialScriptKey(taskArtificialScriptKey.substring(0, taskArtificialScriptKey.lastIndexOf(",")));
|
|
item.setTaskArtificialScriptKey(taskArtificialScriptKey.substring(0, taskArtificialScriptKey.lastIndexOf(",")));
|
|
endrunBpmExecuteNodeMiddleList.add(item);
|
|
endrunBpmExecuteNodeMiddleList.add(item);
|
|
});
|
|
});
|
|
-
|
|
|
|
runBpmExecuteNodeMiddleMapper.insertBpmExecuteNodeMiddleList(endrunBpmExecuteNodeMiddleList);
|
|
runBpmExecuteNodeMiddleMapper.insertBpmExecuteNodeMiddleList(endrunBpmExecuteNodeMiddleList);
|
|
//**3️⃣⚡️5️⃣ 流程任务当中的所有节点关联的表单信息 得到当前流程的所有节点以及当前节点脚本绑定的异常脚本-》处理当前节点脚本、异常脚本绑定的表单到中间表信息 */
|
|
//**3️⃣⚡️5️⃣ 流程任务当中的所有节点关联的表单信息 得到当前流程的所有节点以及当前节点脚本绑定的异常脚本-》处理当前节点脚本、异常脚本绑定的表单到中间表信息 */
|
|
List<BpmExecuteNodeForm> bpmExecuteNodeFormList = new ArrayList<>();
|
|
List<BpmExecuteNodeForm> bpmExecuteNodeFormList = new ArrayList<>();
|
|
@@ -314,12 +311,9 @@ public class PreExecutionToolClass<R> {
|
|
String taskNodeKey = bpmRunNodeVo.getTaskNodeKey(); // 任务节点编码
|
|
String taskNodeKey = bpmRunNodeVo.getTaskNodeKey(); // 任务节点编码
|
|
// 得到当前节点的所有信息-》用于执行节点前后绑定的自动运行的脚本
|
|
// 得到当前节点的所有信息-》用于执行节点前后绑定的自动运行的脚本
|
|
BpmExecuteNode currentBpmExecuteNode = runBpmExecuteNodeMapper.queryBpmExecuteNodeBytaskNodeKey(taskProcessKey, taskNodeKey);
|
|
BpmExecuteNode currentBpmExecuteNode = runBpmExecuteNodeMapper.queryBpmExecuteNodeBytaskNodeKey(taskProcessKey, taskNodeKey);
|
|
-
|
|
|
|
-
|
|
|
|
// ⚠️⚠️⚠️ 新增节点执行记录
|
|
// ⚠️⚠️⚠️ 新增节点执行记录
|
|
BpmExecuteNodeLog bpmExecuteNodeLog = new BpmExecuteNodeLog(currentBpmExecuteNode);
|
|
BpmExecuteNodeLog bpmExecuteNodeLog = new BpmExecuteNodeLog(currentBpmExecuteNode);
|
|
iBpmExecuteNodeLogService.insertBpmExecuteNodeLog(bpmExecuteNodeLog);
|
|
iBpmExecuteNodeLogService.insertBpmExecuteNodeLog(bpmExecuteNodeLog);
|
|
-
|
|
|
|
// 在执行节时得到除当前节点绑定的正常脚本外,有可能会绑定自动执行的脚本(这些自动执行的脚本参数不能确定,无法传递)
|
|
// 在执行节时得到除当前节点绑定的正常脚本外,有可能会绑定自动执行的脚本(这些自动执行的脚本参数不能确定,无法传递)
|
|
BpmExecuteNodeMiddle bpmExecuteNodeMiddle = runBpmExecuteNodeMiddleMapper.queryBpmExecuteNodeMiddleByTaskNodeKey(taskProcessKey, taskNodeKey);
|
|
BpmExecuteNodeMiddle bpmExecuteNodeMiddle = runBpmExecuteNodeMiddleMapper.queryBpmExecuteNodeMiddleByTaskNodeKey(taskProcessKey, taskNodeKey);
|
|
String script[] = bpmExecuteNodeMiddle.getTaskNodeAroundScriptKey().split(","); // 得到当前节点需要自动执行的脚本
|
|
String script[] = bpmExecuteNodeMiddle.getTaskNodeAroundScriptKey().split(","); // 得到当前节点需要自动执行的脚本
|
|
@@ -385,8 +379,8 @@ public class PreExecutionToolClass<R> {
|
|
//---3️⃣⚡️5️⃣ 添加节点执行记录 -》当前执行的节点详细信息
|
|
//---3️⃣⚡️5️⃣ 添加节点执行记录 -》当前执行的节点详细信息
|
|
// ⚠️⚠️⚠️ 当前节点执行完成新增日志数据,
|
|
// ⚠️⚠️⚠️ 当前节点执行完成新增日志数据,
|
|
// 理论讲当前节点一旦点击运行操作就要新增日志,最后修改日志的状态
|
|
// 理论讲当前节点一旦点击运行操作就要新增日志,最后修改日志的状态
|
|
-// BpmExecuteNodeLog bpmExecuteNodeLog1 = new BpmExecuteNodeLog(currentBpmExecuteNode);
|
|
|
|
-// iBpmExecuteNodeLogService.insertBpmExecuteNodeLog(bpmExecuteNodeLog1);
|
|
|
|
|
|
+ // BpmExecuteNodeLog bpmExecuteNodeLog1 = new BpmExecuteNodeLog(currentBpmExecuteNode);
|
|
|
|
+ // iBpmExecuteNodeLogService.insertBpmExecuteNodeLog(bpmExecuteNodeLog1);
|
|
// 4️⃣4️⃣4️⃣ 校验当前节点是否为结束节点
|
|
// 4️⃣4️⃣4️⃣ 校验当前节点是否为结束节点
|
|
System.err.println("--- 4️⃣4️⃣4️⃣ 校验当前节点是否为结束节点");
|
|
System.err.println("--- 4️⃣4️⃣4️⃣ 校验当前节点是否为结束节点");
|
|
if (bpmExecuteNode.getTaskNodeType().equals("endEvent")) {
|
|
if (bpmExecuteNode.getTaskNodeType().equals("endEvent")) {
|
|
@@ -425,12 +419,16 @@ public class PreExecutionToolClass<R> {
|
|
BpmRunNodeVo bpmRunNodeVo1 = new BpmRunNodeVo();
|
|
BpmRunNodeVo bpmRunNodeVo1 = new BpmRunNodeVo();
|
|
bpmRunNodeVo1.setTaskNodeKey(bpmExecuteNode.getTaskNodeKey());
|
|
bpmRunNodeVo1.setTaskNodeKey(bpmExecuteNode.getTaskNodeKey());
|
|
bpmRunNodeVo1.setTaskProcessKey(bpmExecuteNode.getTaskProcessKey());
|
|
bpmRunNodeVo1.setTaskProcessKey(bpmExecuteNode.getTaskProcessKey());
|
|
|
|
+ bpmRunNodeVo1.setTaskProcessXmlContent(bpmRunNodeVo.getTaskProcessXmlContent());
|
|
// 当前节点的下一个节点的编码
|
|
// 当前节点的下一个节点的编码
|
|
bpmRunNodeVo1.setNextNodeKey(XmlDataParserUtils.getNextNodeKey(bpmRunNodeVo.getTaskProcessXmlContent(), bpmRunNodeVo.getNextNodeKey()));
|
|
bpmRunNodeVo1.setNextNodeKey(XmlDataParserUtils.getNextNodeKey(bpmRunNodeVo.getTaskProcessXmlContent(), bpmRunNodeVo.getNextNodeKey()));
|
|
// 当前节点执行的脚本
|
|
// 当前节点执行的脚本
|
|
BpmExecuteNodeMiddle nextBpmExecuteNodeMiddle = runBpmExecuteNodeMiddleMapper.queryBpmExecuteNodeMiddleByTaskNodeKey(bpmRunNodeVo.getTaskProcessKey(), bpmRunNodeVo.getNextNodeKey());
|
|
BpmExecuteNodeMiddle nextBpmExecuteNodeMiddle = runBpmExecuteNodeMiddleMapper.queryBpmExecuteNodeMiddleByTaskNodeKey(bpmRunNodeVo.getTaskProcessKey(), bpmRunNodeVo.getNextNodeKey());
|
|
- bpmRunNodeVo1.setImplementationName(nextBpmExecuteNodeMiddle.getTaskArtificialScriptKey());
|
|
|
|
|
|
+ // 节点如果是自动的执行方式,那么节点类型一定是正常的(或者单独的节点类型等)
|
|
|
|
+ bpmRunNodeVo1.setTaskNodeType("userTask");
|
|
|
|
+ bpmRunNodeVo1.setImplementationName(nextBpmExecuteNodeMiddle.getTaskAutomaticScriptTriggerType());
|
|
BpmExecuteProcess bpmExecuteProcess = new BpmExecuteProcess();
|
|
BpmExecuteProcess bpmExecuteProcess = new BpmExecuteProcess();
|
|
|
|
+ // bug位置,流程节点执行key
|
|
bpmExecuteProcess.setTaskKey(bpmRunNodeVo.getTaskProcessKey());
|
|
bpmExecuteProcess.setTaskKey(bpmRunNodeVo.getTaskProcessKey());
|
|
bpmExecuteProcess.setTaskNodeKey(bpmRunNodeVo.getTaskNodeKey());
|
|
bpmExecuteProcess.setTaskNodeKey(bpmRunNodeVo.getTaskNodeKey());
|
|
bpmExecuteProcess.setTaskNodeNextKey(bpmRunNodeVo.getNextNodeKey());
|
|
bpmExecuteProcess.setTaskNodeNextKey(bpmRunNodeVo.getNextNodeKey());
|
|
@@ -513,32 +511,12 @@ public class PreExecutionToolClass<R> {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public AjaxResult backProcessNode(BpmBackNodeVo bpmBackNodeVo) {
|
|
public AjaxResult backProcessNode(BpmBackNodeVo bpmBackNodeVo) {
|
|
- /**
|
|
|
|
- *当前流程的任务编码
|
|
|
|
- * 发起操作的节点编码
|
|
|
|
- * 需要回退到的节点编码
|
|
|
|
- *
|
|
|
|
- *
|
|
|
|
- * 发起的操作节点的表单还是操作的当前节点的表单
|
|
|
|
- * 也就是说相当于把当前节点执行后在更改当前任务流程的执行节点
|
|
|
|
- *
|
|
|
|
- * 被回退的节点
|
|
|
|
- */
|
|
|
|
BpmExecuteProcess bpmExecuteProcess = runBpmExecuteProcessMapper.selectBpmExecuteProcessByTaskKey(bpmBackNodeVo.getTaskProcessKey());
|
|
BpmExecuteProcess bpmExecuteProcess = runBpmExecuteProcessMapper.selectBpmExecuteProcessByTaskKey(bpmBackNodeVo.getTaskProcessKey());
|
|
bpmExecuteProcess.getTaskProcessXmlContent(); // 当前流程xml内容
|
|
bpmExecuteProcess.getTaskProcessXmlContent(); // 当前流程xml内容
|
|
Map<String, Object> bpmInfoOrder = XmlDataParserUtils.getAllNodeKey(bpmExecuteProcess.getTaskProcessXmlContent());
|
|
Map<String, Object> bpmInfoOrder = XmlDataParserUtils.getAllNodeKey(bpmExecuteProcess.getTaskProcessXmlContent());
|
|
// 修改流程-> 流程执行的xml文件
|
|
// 修改流程-> 流程执行的xml文件
|
|
bpmExecuteProcess.setTaskProcessXmlContent(XmlDataParserUtils.clearExceptionTask(bpmExecuteProcess.getTaskProcessXmlContent(), bpmBackNodeVo.getTaskBackNodeKey()));
|
|
bpmExecuteProcess.setTaskProcessXmlContent(XmlDataParserUtils.clearExceptionTask(bpmExecuteProcess.getTaskProcessXmlContent(), bpmBackNodeVo.getTaskBackNodeKey()));
|
|
-
|
|
|
|
-
|
|
|
|
// 如果触发回退操作的节点是一个异常节点(需要更改当前流程绑定的执行节点)
|
|
// 如果触发回退操作的节点是一个异常节点(需要更改当前流程绑定的执行节点)
|
|
-// if (bpmBackNodeVo.getTaskNodeType().equals("exceptionTask")) {
|
|
|
|
-//
|
|
|
|
-//
|
|
|
|
-// bpmExecuteProcess.setTaskNodeNextKey(bpmBackNodeVo.getTaskBackNodeKey());
|
|
|
|
-// } else if ((bpmBackNodeVo.getTaskNodeType().equals("userTask"))) {
|
|
|
|
-// bpmExecuteProcess.setTaskNodeNextKey(bpmBackNodeVo.getTaskBackNodeKey());
|
|
|
|
-// }
|
|
|
|
bpmExecuteProcess.setTaskNodeNextKey(bpmBackNodeVo.getTaskBackNodeKey());
|
|
bpmExecuteProcess.setTaskNodeNextKey(bpmBackNodeVo.getTaskBackNodeKey());
|
|
runBpmExecuteProcessMapper.updateBpmExecuteProcess(bpmExecuteProcess);
|
|
runBpmExecuteProcessMapper.updateBpmExecuteProcess(bpmExecuteProcess);
|
|
// 得到当前流程的详细信息
|
|
// 得到当前流程的详细信息
|
|
@@ -574,96 +552,4 @@ public class PreExecutionToolClass<R> {
|
|
return commonEntity;
|
|
return commonEntity;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-// /**
|
|
|
|
-// * 共通执行节点表单模版接口
|
|
|
|
-// */
|
|
|
|
-// public List<Map> getProcessNodeFormTemplate(BpmRunNodePlusVo bpmRunNodeV) {
|
|
|
|
-// //任务流程key
|
|
|
|
-// String taskProcessKey = bpmRunNodeV.getTaskProcessKey();
|
|
|
|
-// //任务节点key
|
|
|
|
-// String taskNodeKey = bpmRunNodeV.getTaskNodeKey();
|
|
|
|
-// //脚本名称
|
|
|
|
-// String taskScriptKey = bpmRunNodeV.getTaskScriptKey();
|
|
|
|
-// //根据流程key和节点key查询节点表单关系表【bpm_execute_node_form】
|
|
|
|
-// BpmExecuteNodeForm bpmExecuteNodeForm = iBpmExecuteNodeFormService.getBpmExecuteNodeForm(taskProcessKey, taskNodeKey, taskScriptKey);
|
|
|
|
-// //存放返回结果
|
|
|
|
-// List<Map> mapList = new ArrayList<>();
|
|
|
|
-// //节点对应的表单信息不能为空
|
|
|
|
-// if (bpmExecuteNodeForm != null) {
|
|
|
|
-// String taskNodeFormContent = bpmExecuteNodeForm.getTaskNodeFromContent();
|
|
|
|
-// //拿到当前节点对应的表单类型
|
|
|
|
-// String taskNodeFormType = bpmExecuteNodeForm.getTaskNodeFromType();
|
|
|
|
-// if (taskNodeFormType.equals("dragForm")) {
|
|
|
|
-// HashMap hashMap = new HashMap();
|
|
|
|
-// //解析存进去的表单信息【task_node_from_content】
|
|
|
|
-// JSONObject taskNodeFromContentJson = JSONObject.parseObject(taskNodeFormContent);
|
|
|
|
-// //得到sqlKey
|
|
|
|
-// String sqlKey = taskNodeFromContentJson.get("sqlKey").toString();
|
|
|
|
-// //根据sqlKey查询表单数据
|
|
|
|
-// if (!sqlKey.isEmpty()) {
|
|
|
|
-// Map<String, String> tableSqlBySqlKey = executeNodeFormMapper.getTableSqlBySqlKey(sqlKey);
|
|
|
|
-// hashMap.put("resultMap", tableSqlBySqlKey);
|
|
|
|
-// }
|
|
|
|
-// //得到【df_form_sql】
|
|
|
|
-// String dfFormSql = taskNodeFromContentJson.get("dfFormSql").toString();
|
|
|
|
-// ObjectMapper objectMapper = new ObjectMapper();
|
|
|
|
-// Map<String, Object> sqlMap = null;
|
|
|
|
-// try {
|
|
|
|
-// sqlMap = objectMapper.readValue(dfFormSql, Map.class);
|
|
|
|
-// //循环得到每一个sql语句返回结果
|
|
|
|
-// for (Map.Entry<String, Object> entry : sqlMap.entrySet()) {
|
|
|
|
-// List<Map<String, Object>> resultMap = executeNodeFormMapper.executeSql(entry.getValue().toString());
|
|
|
|
-// sqlMap.put(entry.getKey(), resultMap);
|
|
|
|
-// }
|
|
|
|
-// //把原来的sql语句替换成下拉框数据
|
|
|
|
-// taskNodeFromContentJson.put("dfFormSql", JSONObject.toJSONString(sqlMap));
|
|
|
|
-// } catch (JsonProcessingException e) {
|
|
|
|
-// e.printStackTrace();
|
|
|
|
-// }
|
|
|
|
-// //表单结构信息
|
|
|
|
-// hashMap.put("template", taskNodeFromContentJson);
|
|
|
|
-// //添加到返回集合中
|
|
|
|
-// mapList.add(hashMap);
|
|
|
|
-// } else if (taskNodeFormType.equals("composeForm")) {
|
|
|
|
-// //参数为一个数组
|
|
|
|
-// JSONArray objects = JSON.parseArray(taskNodeFormContent);
|
|
|
|
-//
|
|
|
|
-// //循环数组元素
|
|
|
|
-// objects.forEach(item -> {
|
|
|
|
-// String s = item.toString();
|
|
|
|
-// JSONObject jsonObject = JSONObject.parseObject(s);
|
|
|
|
-// String tableSql = jsonObject.get("tableSql").toString();
|
|
|
|
-// String conditionArrayJson = jsonObject.get("condition").toString();
|
|
|
|
-// JSONArray jsonArray = JSON.parseArray(conditionArrayJson);
|
|
|
|
-//
|
|
|
|
-// jsonArray.forEach(conditionItem -> {
|
|
|
|
-// //处理下这个条件 去掉 #{ 去掉.
|
|
|
|
-// String conditionString = conditionItem.toString().replace("#{", "").replace(".", "_");
|
|
|
|
-// //转驼峰
|
|
|
|
-// String CamelConditionString = CamelCaseConverterUtil.toCamelCase(conditionString);
|
|
|
|
-// //
|
|
|
|
-// });
|
|
|
|
-//
|
|
|
|
-// Map<String, String> stringHashMap = executeNodeFormMapper.tableSql(tableSql);
|
|
|
|
-// jsonObject.put("tableList", stringHashMap);
|
|
|
|
-// mapList.add(jsonObject);
|
|
|
|
-// });
|
|
|
|
-// } else if (taskNodeFormContent.equals("designForm")) {
|
|
|
|
-// HashMap hashMap = new HashMap();
|
|
|
|
-// hashMap.put("resultMap", "");
|
|
|
|
-// hashMap.put("template", "");
|
|
|
|
-// mapList.add(hashMap);
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// return mapList;
|
|
|
|
-// }
|
|
|
|
-}
|
|
|
|
-/*
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- */
|
|
|
|
|
|
+}
|