dcs 6 tháng trước cách đây
mục cha
commit
fba9cd9623

+ 22 - 0
virgo.api/src/main/java/com/bosshand/virgo/api/service/ProjectService.java

@@ -137,10 +137,32 @@ public class ProjectService {
 			}
 			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();
 		List<Long> ids = new ArrayList<>();
 		projectListIdentity.forEach((key, value) -> ids.add(key));
 		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);
 			for (Project project : list) {
 				project.setProjectListIdentity(projectListIdentity.get(project.getId()));

+ 1 - 0
virgo.core/src/main/java/com/bosshand/virgo/core/service/MgrUserService.java

@@ -366,6 +366,7 @@ public class MgrUserService {
     		//Load the first organization default. 
     		if(organizationList.size() > 0) {
     			currentOrganization = organizationList.get(0);
+				this.switchOrganization(user, currentOrganization);
     		}
     	}