|
|
|
@ -54,6 +54,7 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.Collections; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.List; |
|
|
|
@ -272,6 +273,7 @@ public class TaskDefinitionServiceImpl extends BaseServiceImpl implements TaskDe
|
|
|
|
|
/** |
|
|
|
|
* delete task definition |
|
|
|
|
* Only offline and no downstream dependency can be deleted |
|
|
|
|
* |
|
|
|
|
* @param loginUser login user |
|
|
|
|
* @param projectCode project code |
|
|
|
|
* @param taskCode task code |
|
|
|
@ -449,7 +451,10 @@ public class TaskDefinitionServiceImpl extends BaseServiceImpl implements TaskDe
|
|
|
|
|
} |
|
|
|
|
List<ProcessTaskRelation> upstreamTaskRelations = processTaskRelationMapper.queryUpstreamByCode(projectCode, taskCode); |
|
|
|
|
Set<Long> upstreamCodeSet = upstreamTaskRelations.stream().map(ProcessTaskRelation::getPreTaskCode).collect(Collectors.toSet()); |
|
|
|
|
Set<Long> upstreamTaskCodes = Arrays.stream(upstreamCodes.split(Constants.COMMA)).map(Long::parseLong).collect(Collectors.toSet()); |
|
|
|
|
Set<Long> upstreamTaskCodes = Collections.emptySet(); |
|
|
|
|
if (StringUtils.isNotEmpty(upstreamCodes)) { |
|
|
|
|
upstreamTaskCodes = Arrays.stream(upstreamCodes.split(Constants.COMMA)).map(Long::parseLong).collect(Collectors.toSet()); |
|
|
|
|
} |
|
|
|
|
if (CollectionUtils.isEqualCollection(upstreamCodeSet, upstreamTaskCodes) && taskDefinitionToUpdate == null) { |
|
|
|
|
putMsg(result, Status.SUCCESS); |
|
|
|
|
return result; |
|
|
|
|