From 19b5d9bd0727569ca58f92092ebf198b96e9152a Mon Sep 17 00:00:00 2001 From: anhc <3442943606@qq.com> Date: Mon, 4 Jul 2022 16:57:18 +0800 Subject: [PATCH] =?UTF-8?q?pal=20=E5=B0=8F=E7=BB=84=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=B9=E6=B3=95=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cooperation/CoeCooperationAPIManager.java | 29 ++++++++++++------- .../cooperation/cache/CooperationCache.java | 8 +++++ 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/cooperation/CoeCooperationAPIManager.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/cooperation/CoeCooperationAPIManager.java index 1d2e0624..f67ad5c3 100644 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/cooperation/CoeCooperationAPIManager.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/cooperation/CoeCooperationAPIManager.java @@ -482,6 +482,7 @@ public class CoeCooperationAPIManager { } } if (addToRolePerm) { + //Todo: 根据权限转化新建文件权限 CoeCooperationMemberModel memberModel = new CoeCooperationMemberDao().getModelByTeamUser(teamId, userId); String roleId = memberModel.getRoleId(); CoeCooperationRoleModel roleModel = new CoeCooperationRoleDao().getInstance(roleId); @@ -615,9 +616,9 @@ public class CoeCooperationAPIManager { havingBatchPerm = userOperatePermission.contains(CoeCooperationConst.ACTION_BATCH); } - ro.put("isOlderVersion", !isOlderVersion);// 新增、修改权限 - ro.put("havingCreatePerm", havingCreatePerm);// 新增、修改权限 - ro.put("havingBatchPerm", havingBatchPerm);// 删除权限 + ro.put("isOlderVersion", !isOlderVersion);// + ro.put("havingCreatePerm", havingCreatePerm);// 新增流程权限 + ro.put("havingBatchPerm", havingBatchPerm);// 批量操作 Set dataVisitablePermission = CooperationCache.getUserDataVisitablePermission(teamId, userId,true); validUserPermDataCount = dataVisitablePermission != null ? dataVisitablePermission.size() : 0; ro.put("validUserPermDataCount", validUserPermDataCount); @@ -761,18 +762,24 @@ public class CoeCooperationAPIManager { List allTeam = new CoeCooperationTeamDao().getAllTeam(); for (CoeCooperationTeamModel teamModel : allTeam) { - TeamInfo teamInfo = new TeamInfo(); - teamInfo.setTeamId(teamModel.getId()); - List userInfos = this.getUserInfoByTeamId(teamModel.getId()); - teamInfo.setUsers(userInfos); - - List permVerIds = new CoeCooperationTeamPermDao().getCooperationTeamPermVerIds(teamModel.getId()); - teamInfo.getVersionIds().addAll(permVerIds); - + TeamInfo teamInfo = this.getTeamInfo(teamModel.getId()); list.add(teamInfo); } return list; } + public TeamInfo getTeamInfo(String teamId){ + TeamInfo teamInfo = new TeamInfo(); + if (StringUtils.isEmpty(teamId)){ + return teamInfo; + } + teamInfo.setTeamId(teamId); + List userInfos = this.getUserInfoByTeamId(teamId); + teamInfo.setUsers(userInfos); + + List permVerIds = new CoeCooperationTeamPermDao().getCooperationTeamPermVerIds(teamId); + teamInfo.getVersionIds().addAll(permVerIds); + return teamInfo; + } public List getUserInfoByTeamId(String teamId){ List list = new ArrayList<>(); diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/cooperation/cache/CooperationCache.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/cooperation/cache/CooperationCache.java index cda73bc6..06211476 100644 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/cooperation/cache/CooperationCache.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/cooperation/cache/CooperationCache.java @@ -6,6 +6,8 @@ import com.actionsoft.apps.coe.pal.cooperation.CoeCooperationAPIManager; import com.actionsoft.apps.coe.pal.cooperation.cache.model.TeamInfo; import com.actionsoft.apps.coe.pal.cooperation.cache.model.UserInfo; import com.actionsoft.apps.coe.pal.cooperation.constant.CoeCooperationConst; +import com.actionsoft.apps.coe.pal.cooperation.dao.CoeCooperationMemberDao; +import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationMemberModel; import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache; import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel; import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile; @@ -197,6 +199,12 @@ public class CooperationCache extends Cache { } + public static void updateTeamInfo(String teamId){ + TeamInfo teamInfo = CoeCooperationAPIManager.getInstance().getTeamInfo(teamId); + getCache().put(teamId,teamInfo); + } + + }