|
@@ -67,29 +67,14 @@ public class PreExecutionToolClass<R> {
|
|
|
*/
|
|
|
@Transactional
|
|
|
public int ReadyToExecute(CommonEntity commonEntity) {
|
|
|
- IntoProduction intoProduction = new IntoProduction(); // 启动流程所需参数实体
|
|
|
- commonEntity.getConditionMap().entrySet().forEach(item -> {
|
|
|
- // 得到当前表的主键字段 // 得到当前表的主键值
|
|
|
- intoProduction.setGuid(item.getKey() + "=" + item.getValue().toString());
|
|
|
- });
|
|
|
- // 得到当前表名
|
|
|
- intoProduction.setTableName(commonEntity.getBasicMap().get("tableName").toString());
|
|
|
- // 得到流程别名
|
|
|
- intoProduction.setTaskProcessKey(commonEntity.getCommMap().get("plantaskkey").toString());
|
|
|
- // 得到单前表所需的状态字段,启动流程所需kv
|
|
|
- intoProduction.setStateMap(commonEntity.getConditionMap());
|
|
|
- intoProduction.getStateMap().putAll(commonEntity.getBtnParametersMap());
|
|
|
-
|
|
|
-
|
|
|
- // if (!commonEntity.getConditionMap().isEmpty()) {
|
|
|
- // }
|
|
|
-
|
|
|
-
|
|
|
+ // 获取发起流程所需数据
|
|
|
+ IntoProduction intoProduction = this.obtainData(commonEntity);
|
|
|
/**
|
|
|
* 根据流程key校验当前流程数据的完整性,是否可以运行
|
|
|
*/
|
|
|
// if (!iVerifyExecutionProcess.VerifyProcessData(intoProduction.getTaskProcessKey()))
|
|
|
// return HttpStatus.EXECUTEPROCESS;
|
|
|
+
|
|
|
/**1️⃣1️⃣1️⃣ 得到当前投产需要执行的流程详细信息*/
|
|
|
//--得到当前流程的详细信息
|
|
|
BpmProcess bpmProcess = bpmProcessMapper.selectBpmProcessByProcessKey(intoProduction.getTaskProcessKey());
|
|
@@ -324,7 +309,6 @@ public class PreExecutionToolClass<R> {
|
|
|
bpmRunNodeVo1.setImplementationName(nextBpmExecuteNodeMiddle.getTaskArtificialScriptKey());
|
|
|
|
|
|
|
|
|
-
|
|
|
BpmExecuteProcess bpmExecuteProcess = new BpmExecuteProcess();
|
|
|
bpmExecuteProcess.setTaskKey(bpmRunNodeVo.getTaskProcessKey());
|
|
|
bpmExecuteProcess.setTaskNodeKey(bpmRunNodeVo.getTaskNodeKey());
|
|
@@ -345,6 +329,29 @@ public class PreExecutionToolClass<R> {
|
|
|
return HttpStatus.SUCCESS;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取发起流程数据
|
|
|
+ *
|
|
|
+ * @param commonEntity
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public IntoProduction obtainData(CommonEntity commonEntity) {
|
|
|
+ IntoProduction intoProduction = new IntoProduction(); // 启动流程所需参数实体
|
|
|
+ commonEntity.getConditionMap().entrySet().forEach(item -> {
|
|
|
+ // 得到当前表的主键字段 // 得到当前表的主键值
|
|
|
+ intoProduction.setGuid(item.getKey() + "=" + item.getValue().toString());
|
|
|
+ });
|
|
|
+ // 得到当前表名
|
|
|
+ intoProduction.setTableName(commonEntity.getBasicMap().get("tableName").toString());
|
|
|
+ // 得到需要执行的流程编码
|
|
|
+ intoProduction.setTaskProcessKey(commonEntity.getCommMap().get("process_key").toString());
|
|
|
+ // 得到单前表所需的状态字段,启动流程所需kv
|
|
|
+ intoProduction.setStateMap(commonEntity.getConditionMap());
|
|
|
+ intoProduction.getStateMap().putAll(commonEntity.getBtnParametersMap());
|
|
|
+ return intoProduction;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
// 弃用保留
|
|
|
public int updateNodeState(String taskProcessKey, String taskNodeKey, CommonEntity commonEntity) {
|
|
|
BpmExecuteNode bpmExecuteNode1 = new BpmExecuteNode();
|