|
|
@ -24,6 +24,7 @@ import org.apache.dolphinscheduler.api.service.ProjectService; |
|
|
|
import org.apache.dolphinscheduler.api.utils.PageInfo; |
|
|
|
import org.apache.dolphinscheduler.api.utils.PageInfo; |
|
|
|
import org.apache.dolphinscheduler.common.Constants; |
|
|
|
import org.apache.dolphinscheduler.common.Constants; |
|
|
|
import org.apache.dolphinscheduler.common.enums.UserType; |
|
|
|
import org.apache.dolphinscheduler.common.enums.UserType; |
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.common.utils.CollectionUtils; |
|
|
|
import org.apache.dolphinscheduler.dao.entity.ProcessDefinition; |
|
|
|
import org.apache.dolphinscheduler.dao.entity.ProcessDefinition; |
|
|
|
import org.apache.dolphinscheduler.dao.entity.Project; |
|
|
|
import org.apache.dolphinscheduler.dao.entity.Project; |
|
|
|
import org.apache.dolphinscheduler.dao.entity.ProjectUser; |
|
|
|
import org.apache.dolphinscheduler.dao.entity.ProjectUser; |
|
|
@ -442,21 +443,13 @@ public class ProjectServiceImpl extends BaseService implements ProjectService { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public Map<String, Object> queryAllProjectList() { |
|
|
|
public Map<String, Object> queryAllProjectList() { |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
List<Project> projects = projectMapper.selectList(null); |
|
|
|
List<Project> projects = new ArrayList<>(); |
|
|
|
List<ProcessDefinition> processDefinitions = processDefinitionMapper.selectList(null); |
|
|
|
|
|
|
|
if (projects != null) { |
|
|
|
List<Integer> projectIds = processDefinitionMapper.listProjectIds(); |
|
|
|
Set<Integer> set = new HashSet<>(); |
|
|
|
if (CollectionUtils.isNotEmpty(projectIds)) { |
|
|
|
for (ProcessDefinition processDefinition : processDefinitions) { |
|
|
|
projects = projectMapper.selectBatchIds(projectIds); |
|
|
|
set.add(processDefinition.getProjectId()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
List<Project> tempDeletelist = new ArrayList<>(); |
|
|
|
|
|
|
|
for (Project project : projects) { |
|
|
|
|
|
|
|
if (!set.contains(project.getId())) { |
|
|
|
|
|
|
|
tempDeletelist.add(project); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
projects.removeAll(tempDeletelist); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
result.put(Constants.DATA_LIST, projects); |
|
|
|
result.put(Constants.DATA_LIST, projects); |
|
|
|
putMsg(result, Status.SUCCESS); |
|
|
|
putMsg(result, Status.SUCCESS); |
|
|
|
return result; |
|
|
|
return result; |
|
|
|