|
|
|
@ -32,7 +32,6 @@ import org.apache.dolphinscheduler.dao.entity.TaskDefinition;
|
|
|
|
|
import org.apache.dolphinscheduler.dao.entity.TaskDefinitionLog; |
|
|
|
|
import org.apache.dolphinscheduler.dao.entity.User; |
|
|
|
|
import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper; |
|
|
|
|
import org.apache.dolphinscheduler.dao.mapper.ProcessTaskRelationLogMapper; |
|
|
|
|
import org.apache.dolphinscheduler.dao.mapper.ProcessTaskRelationMapper; |
|
|
|
|
import org.apache.dolphinscheduler.dao.mapper.ProjectMapper; |
|
|
|
|
import org.apache.dolphinscheduler.dao.mapper.TaskDefinitionLogMapper; |
|
|
|
@ -72,9 +71,6 @@ public class ProcessTaskRelationServiceImpl extends BaseServiceImpl implements P
|
|
|
|
|
@Autowired |
|
|
|
|
private ProcessTaskRelationMapper processTaskRelationMapper; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private ProcessTaskRelationLogMapper processTaskRelationLogMapper; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private TaskDefinitionLogMapper taskDefinitionLogMapper; |
|
|
|
|
|
|
|
|
@ -116,7 +112,8 @@ public class ProcessTaskRelationServiceImpl extends BaseServiceImpl implements P
|
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
updateProcessDefiniteVersion(loginUser, result, processDefinition); |
|
|
|
|
List<ProcessTaskRelation> processTaskRelations = processTaskRelationMapper.queryByProcessCode(projectCode, processDefinitionCode); |
|
|
|
|
List<ProcessTaskRelation> processTaskRelationList = processTaskRelationMapper.queryByProcessCode(projectCode, processDefinitionCode); |
|
|
|
|
List<ProcessTaskRelation> processTaskRelations = Lists.newArrayList(processTaskRelationList); |
|
|
|
|
if (!processTaskRelations.isEmpty()) { |
|
|
|
|
Map<Long, ProcessTaskRelation> preTaskCodeMap = processTaskRelations.stream().filter(r -> r.getPostTaskCode() == postTaskCode) |
|
|
|
|
.collect(Collectors.toMap(ProcessTaskRelation::getPreTaskCode, processTaskRelation -> processTaskRelation)); |
|
|
|
@ -210,7 +207,8 @@ public class ProcessTaskRelationServiceImpl extends BaseServiceImpl implements P
|
|
|
|
|
putMsg(result, Status.TASK_DEFINE_NOT_EXIST, taskCode); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
List<ProcessTaskRelation> processTaskRelationList = processTaskRelationMapper.queryByProcessCode(projectCode, processDefinitionCode); |
|
|
|
|
List<ProcessTaskRelation> processTaskRelations = processTaskRelationMapper.queryByProcessCode(projectCode, processDefinitionCode); |
|
|
|
|
List<ProcessTaskRelation> processTaskRelationList = Lists.newArrayList(processTaskRelations); |
|
|
|
|
if (CollectionUtils.isEmpty(processTaskRelationList)) { |
|
|
|
|
putMsg(result, Status.DATA_IS_NULL, "processTaskRelationList"); |
|
|
|
|
return result; |
|
|
|
@ -295,7 +293,8 @@ public class ProcessTaskRelationServiceImpl extends BaseServiceImpl implements P
|
|
|
|
|
putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, upstreamList.get(0).getProcessDefinitionCode()); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
List<ProcessTaskRelation> processTaskRelationList = processTaskRelationMapper.queryByProcessCode(projectCode, processDefinition.getCode()); |
|
|
|
|
List<ProcessTaskRelation> processTaskRelations = processTaskRelationMapper.queryByProcessCode(projectCode, processDefinition.getCode()); |
|
|
|
|
List<ProcessTaskRelation> processTaskRelationList = Lists.newArrayList(processTaskRelations); |
|
|
|
|
List<ProcessTaskRelation> processTaskRelationWaitRemove = Lists.newArrayList(); |
|
|
|
|
for (ProcessTaskRelation processTaskRelation : processTaskRelationList) { |
|
|
|
|
if (preTaskCodeList.size() > 1) { |
|
|
|
@ -356,7 +355,8 @@ public class ProcessTaskRelationServiceImpl extends BaseServiceImpl implements P
|
|
|
|
|
putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, downstreamList.get(0).getProcessDefinitionCode()); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
List<ProcessTaskRelation> processTaskRelationList = processTaskRelationMapper.queryByProcessCode(projectCode, processDefinition.getCode()); |
|
|
|
|
List<ProcessTaskRelation> processTaskRelations = processTaskRelationMapper.queryByProcessCode(projectCode, processDefinition.getCode()); |
|
|
|
|
List<ProcessTaskRelation> processTaskRelationList = Lists.newArrayList(processTaskRelations); |
|
|
|
|
processTaskRelationList.removeIf(processTaskRelation -> postTaskCodeList.contains(processTaskRelation.getPostTaskCode()) && processTaskRelation.getPreTaskCode() == taskCode); |
|
|
|
|
updateProcessDefiniteVersion(loginUser, result, processDefinition); |
|
|
|
|
updateRelation(loginUser, result, processDefinition, processTaskRelationList); |
|
|
|
@ -459,7 +459,8 @@ public class ProcessTaskRelationServiceImpl extends BaseServiceImpl implements P
|
|
|
|
|
putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, processDefinitionCode); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
List<ProcessTaskRelation> processTaskRelationList = processTaskRelationMapper.queryByProcessCode(projectCode, processDefinitionCode); |
|
|
|
|
List<ProcessTaskRelation> processTaskRelations = processTaskRelationMapper.queryByProcessCode(projectCode, processDefinitionCode); |
|
|
|
|
List<ProcessTaskRelation> processTaskRelationList = Lists.newArrayList(processTaskRelations); |
|
|
|
|
if (CollectionUtils.isEmpty(processTaskRelationList)) { |
|
|
|
|
putMsg(result, Status.DATA_IS_NULL, "processTaskRelationList"); |
|
|
|
|
return result; |
|
|
|
|