|
|
@ -40,7 +40,6 @@ import org.apache.dolphinscheduler.common.graph.DAG; |
|
|
|
import org.apache.dolphinscheduler.common.model.TaskNode; |
|
|
|
import org.apache.dolphinscheduler.common.model.TaskNode; |
|
|
|
import org.apache.dolphinscheduler.common.model.TaskNodeRelation; |
|
|
|
import org.apache.dolphinscheduler.common.model.TaskNodeRelation; |
|
|
|
import org.apache.dolphinscheduler.common.thread.Stopper; |
|
|
|
import org.apache.dolphinscheduler.common.thread.Stopper; |
|
|
|
import org.apache.dolphinscheduler.common.utils.CollectionUtils; |
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.common.utils.DateUtils; |
|
|
|
import org.apache.dolphinscheduler.common.utils.DateUtils; |
|
|
|
import org.apache.dolphinscheduler.common.utils.JSONUtils; |
|
|
|
import org.apache.dolphinscheduler.common.utils.JSONUtils; |
|
|
|
import org.apache.dolphinscheduler.common.utils.SnowFlakeUtils; |
|
|
|
import org.apache.dolphinscheduler.common.utils.SnowFlakeUtils; |
|
|
@ -72,7 +71,7 @@ import org.apache.dolphinscheduler.dao.mapper.UserMapper; |
|
|
|
import org.apache.dolphinscheduler.service.permission.PermissionCheck; |
|
|
|
import org.apache.dolphinscheduler.service.permission.PermissionCheck; |
|
|
|
import org.apache.dolphinscheduler.service.process.ProcessService; |
|
|
|
import org.apache.dolphinscheduler.service.process.ProcessService; |
|
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.lang.StringUtils; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.BufferedOutputStream; |
|
|
|
import java.io.BufferedOutputStream; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.IOException; |
|
|
@ -303,7 +302,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro |
|
|
|
Collection<Long> codes = CollectionUtils.subtract(postTaskCodes, taskNodeCodes); |
|
|
|
Collection<Long> codes = CollectionUtils.subtract(postTaskCodes, taskNodeCodes); |
|
|
|
if (CollectionUtils.isNotEmpty(codes)) { |
|
|
|
if (CollectionUtils.isNotEmpty(codes)) { |
|
|
|
logger.error("the task code is not exit"); |
|
|
|
logger.error("the task code is not exit"); |
|
|
|
putMsg(result, Status.TASK_DEFINE_NOT_EXIST, StringUtils.join(codes, Constants.COMMA)); |
|
|
|
putMsg(result, Status.TASK_DEFINE_NOT_EXIST, org.apache.commons.lang.StringUtils.join(codes, Constants.COMMA)); |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -719,20 +718,6 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro |
|
|
|
|
|
|
|
|
|
|
|
switch (releaseState) { |
|
|
|
switch (releaseState) { |
|
|
|
case ONLINE: |
|
|
|
case ONLINE: |
|
|
|
// To check resources whether they are already cancel authorized or deleted
|
|
|
|
|
|
|
|
String resourceIds = processDefinition.getResourceIds(); |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(resourceIds)) { |
|
|
|
|
|
|
|
Integer[] resourceIdArray = Arrays.stream(resourceIds.split(Constants.COMMA)).map(Integer::parseInt).toArray(Integer[]::new); |
|
|
|
|
|
|
|
PermissionCheck<Integer> permissionCheck = new PermissionCheck<>(AuthorizationType.RESOURCE_FILE_ID, processService, resourceIdArray, loginUser.getId(), logger); |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
permissionCheck.checkPermission(); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
logger.error(e.getMessage(), e); |
|
|
|
|
|
|
|
putMsg(result, Status.RESOURCE_NOT_EXIST_OR_NO_PERMISSION, RELEASESTATE); |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
processDefinition.setReleaseState(releaseState); |
|
|
|
processDefinition.setReleaseState(releaseState); |
|
|
|
processDefinitionMapper.updateById(processDefinition); |
|
|
|
processDefinitionMapper.updateById(processDefinition); |
|
|
|
break; |
|
|
|
break; |
|
|
@ -769,7 +754,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void batchExportProcessDefinitionByCodes(User loginUser, long projectCode, String codes, HttpServletResponse response) { |
|
|
|
public void batchExportProcessDefinitionByCodes(User loginUser, long projectCode, String codes, HttpServletResponse response) { |
|
|
|
if (StringUtils.isEmpty(codes)) { |
|
|
|
if (org.apache.commons.lang.StringUtils.isEmpty(codes)) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
Project project = projectMapper.queryByCode(projectCode); |
|
|
|
Project project = projectMapper.queryByCode(projectCode); |
|
|
@ -1339,7 +1324,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isEmpty(processDefinitionCodes)) { |
|
|
|
if (org.apache.commons.lang.StringUtils.isEmpty(processDefinitionCodes)) { |
|
|
|
putMsg(result, Status.PROCESS_DEFINITION_CODES_IS_EMPTY, processDefinitionCodes); |
|
|
|
putMsg(result, Status.PROCESS_DEFINITION_CODES_IS_EMPTY, processDefinitionCodes); |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|