|
@@ -77,6 +77,8 @@ import org.apache.dolphinscheduler.service.process.ProcessService;
|
|
|
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.apache.hadoop.mapred.TaskLog.LogName;
|
|
|
+import org.apache.yetus.audience.InterfaceAudience.Public;
|
|
|
|
|
|
import java.io.BufferedOutputStream;
|
|
|
import java.io.IOException;
|
|
@@ -1102,9 +1104,13 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro
|
|
|
putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, codes);
|
|
|
return result;
|
|
|
}
|
|
|
+ HashMap<Long, Project> userProjects = new HashMap(Constants.DEFAULT_HASH_MAP_SIZE);
|
|
|
+ projectMapper.queryProjectCreatedAndAuthorizedByUserId(loginUser.getId())
|
|
|
+ .forEach(userProject -> userProjects.put(userProject.getCode(), userProject));
|
|
|
+
|
|
|
// check processDefinition exist in project
|
|
|
List<ProcessDefinition> processDefinitionListInProject = processDefinitionList.stream().
|
|
|
- filter(o -> projectCode == o.getProjectCode()).collect(Collectors.toList());
|
|
|
+ filter(o -> userProjects.containsKey(o.getProjectCode())).collect(Collectors.toList());
|
|
|
if (CollectionUtils.isEmpty(processDefinitionListInProject)) {
|
|
|
putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, codes);
|
|
|
return result;
|