Commit 554f2b9e by tiger

node job

1 parent d467741e
...@@ -132,6 +132,7 @@ public class SopXxlJobUtil { ...@@ -132,6 +132,7 @@ public class SopXxlJobUtil {
SopInstNodeParam params = new SopInstNodeParam(); SopInstNodeParam params = new SopInstNodeParam();
params.setInstNodeId(node.getInstNodeId()); params.setInstNodeId(node.getInstNodeId());
params.setPreIds(linkPair.getKey()); params.setPreIds(linkPair.getKey());
params.setNextIds(linkPair.getValue());
String paramJson = JSONUtil.toJsonStr(params); String paramJson = JSONUtil.toJsonStr(params);
// 重建job // 重建job
......
...@@ -8,8 +8,10 @@ import com.xxl.job.core.context.XxlJobHelper; ...@@ -8,8 +8,10 @@ import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob; import com.xxl.job.core.handler.annotation.XxlJob;
import cn.com.glsx.process.job.xxljob.core.SopXxlJobUtil; import cn.com.glsx.process.job.xxljob.core.SopXxlJobUtil;
import cn.com.glsx.process.job.xxljob.param.SopInstNodeParam;
import cn.com.glsx.process.modules.model.SopStruct; import cn.com.glsx.process.modules.model.SopStruct;
import cn.com.glsx.process.modules.service.SopService; import cn.com.glsx.process.modules.service.SopService;
import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@Slf4j @Slf4j
...@@ -21,11 +23,14 @@ public class SopInstNodeExecuteJobHandler { ...@@ -21,11 +23,14 @@ public class SopInstNodeExecuteJobHandler {
private SopService sopService; private SopService sopService;
@XxlJob(SopXxlJobUtil.SOP_NODE_EXECUTE_JOB_ID) @XxlJob(SopXxlJobUtil.SOP_NODE_EXECUTE_JOB_ID)
public void handler(String param) throws Exception { public void handler(String param1) throws Exception {
param = XxlJobHelper.getJobParam(); String json = XxlJobHelper.getJobParam();
SopInstNodeParam param = JSONUtil.toBean(json, SopInstNodeParam.class);
SopXxlJobUtil.log(log, "【执行Sop节点】{}", param); SopXxlJobUtil.log(log, "【执行Sop节点】{}", param);
String instId = param;
SopStruct sop = sopService.loadSop(instId); SopStruct sop = sopService.loadSopByInstNodeId(param.getInstNodeId());
// TODO 执行sop里面的instNodeId节点。
// 创建所有节点任务 // 创建所有节点任务
// SopXxlJobUtil.initSopNodeJob(sop); // SopXxlJobUtil.initSopNodeJob(sop);
......
...@@ -18,4 +18,7 @@ public class SopInstNodeParam { ...@@ -18,4 +18,7 @@ public class SopInstNodeParam {
/** 已完成的前置节点,当所有前置节点已完成时,触发本任务 */ /** 已完成的前置节点,当所有前置节点已完成时,触发本任务 */
private Set<Integer> finishedIds = Sets.newHashSet(); private Set<Integer> finishedIds = Sets.newHashSet();
/** 实例节点后置节点id,本节点任务完成时触发后续节点 */
private Set<Integer> nextIds = Sets.newHashSet();
} }
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!