|
@@ -137,10 +137,32 @@ public class ProjectService {
|
|
}
|
|
}
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
|
|
+ // 项目管理员
|
|
|
|
+ if (userContext.isAdmin()) {
|
|
|
|
+ list = projectDao.getProjectByOrganizationId(userContext.getOrganizationId());
|
|
|
|
+ if (list != null && list.size() > 0) {
|
|
|
|
+ Set<JSONObject> set = new HashSet<>();
|
|
|
|
+ set.add(JSONObject.parseObject(UserContext.IDENTITY_OWNER_DATA));
|
|
|
|
+ for (Project project : list) {
|
|
|
|
+ project.setProjectListIdentity(set);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 组织和组织关联的
|
|
Map<Long, Set<JSONObject>> projectListIdentity = userContext.getProjectListIdentity();
|
|
Map<Long, Set<JSONObject>> projectListIdentity = userContext.getProjectListIdentity();
|
|
List<Long> ids = new ArrayList<>();
|
|
List<Long> ids = new ArrayList<>();
|
|
projectListIdentity.forEach((key, value) -> ids.add(key));
|
|
projectListIdentity.forEach((key, value) -> ids.add(key));
|
|
if (ids.size() > 0) {
|
|
if (ids.size() > 0) {
|
|
|
|
+ // 所有者
|
|
|
|
+ if (list.size() > 0) {
|
|
|
|
+ List<Project> ls = getIds(ids);
|
|
|
|
+ for (Project project : ls) {
|
|
|
|
+ project.setProjectListIdentity(projectListIdentity.get(project.getId()));
|
|
|
|
+ }
|
|
|
|
+ ls.addAll(list);
|
|
|
|
+ return ls;
|
|
|
|
+ }
|
|
list = getIds(ids);
|
|
list = getIds(ids);
|
|
for (Project project : list) {
|
|
for (Project project : list) {
|
|
project.setProjectListIdentity(projectListIdentity.get(project.getId()));
|
|
project.setProjectListIdentity(projectListIdentity.get(project.getId()));
|