Commit 7857657f by huangfusuper

补批和重跑逻辑修改

parent c7e102d4
...@@ -3,6 +3,7 @@ package com.byit.flowservice.impl; ...@@ -3,6 +3,7 @@ package com.byit.flowservice.impl;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.byit.enums.NodePropertyEnum; import com.byit.enums.NodePropertyEnum;
import com.byit.enums.NodeRunStatusPropertyEnum; import com.byit.enums.NodeRunStatusPropertyEnum;
import com.byit.enums.ScheduleTypeEnum;
import com.byit.exceptions.SuperiorNodeRunException; import com.byit.exceptions.SuperiorNodeRunException;
import com.byit.flowservice.NodeVerification; import com.byit.flowservice.NodeVerification;
import com.byit.job.exceptions.BusinessException; import com.byit.job.exceptions.BusinessException;
...@@ -54,6 +55,10 @@ public class NodeVerificationImpl implements NodeVerification { ...@@ -54,6 +55,10 @@ public class NodeVerificationImpl implements NodeVerification {
public boolean superiorNodeStatus(JobTask thisJobTask) { public boolean superiorNodeStatus(JobTask thisJobTask) {
//获取该节点的运行标识 //获取该节点的运行标识
String runId = thisJobTask.getRunId(); String runId = thisJobTask.getRunId();
if(ScheduleTypeEnum.REPEAT.getCode().equals(thisJobTask.getScheduleType())) {
runId = thisJobTask.getReRunId();
}
//查询该节点的依赖节点 //查询该节点的依赖节点
String nodeDepend = thisJobTask.getNodeDepend(); String nodeDepend = thisJobTask.getNodeDepend();
if(StringUtils.isBlank(nodeDepend)){ if(StringUtils.isBlank(nodeDepend)){
......
...@@ -16,6 +16,7 @@ import com.byit.service.mapservice.TaskAndLogServer; ...@@ -16,6 +16,7 @@ import com.byit.service.mapservice.TaskAndLogServer;
import com.byit.service.mapservice.TaskAndScheduleService; import com.byit.service.mapservice.TaskAndScheduleService;
import com.byit.thread.BaseThreadRunHelper; import com.byit.thread.BaseThreadRunHelper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -115,8 +116,12 @@ public class JobTaskThreadRunHelper extends BaseThreadRunHelper { ...@@ -115,8 +116,12 @@ public class JobTaskThreadRunHelper extends BaseThreadRunHelper {
}else { }else {
//普通节点 //普通节点
try { try {
//断定上级节点是否执行成功 //如果是补批节点 而且没有依赖节点的话,按照开始节点处理
if (nodeVerification.superiorNodeStatus(jobTask)) { if(ScheduleTypeEnum.REPAIR.getCode().equals(jobTask.getScheduleType()) &&
StringUtils.isBlank(jobTask.getNodeDepend())){
startNodeOperating(jobTask,jobTaskSchedules);
}else if (nodeVerification.superiorNodeStatus(jobTask)) {
//断定上级节点是否执行成功
runJobTask(jobTask,jobTaskSchedules); runJobTask(jobTask,jobTaskSchedules);
} }
}catch (SuperiorNodeRunException se) { }catch (SuperiorNodeRunException se) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment