diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java index 595bf16f..0fe0fd52 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java @@ -3000,7 +3000,7 @@ public class CoEPALController { @Mapping("com.actionsoft.apps.coe.pal_repository_process_define_Performance_check") public String definePerformanceCheck(UserContext me,String sid,String obj) { - CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); + CoeProcessLevelWeb web = new CoeProcessLevelWeb(me); return web.definePerformanceCheck(sid,obj); } 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 708e20c7..ac37b9fe 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 @@ -647,7 +647,7 @@ public class CoeCooperationAPIManager { havingBatchPerm = userOperatePermission.contains(CoeCooperationConst.ACTION_BATCH); } - ro.put("isOlderVersion", !isOlderVersion);// + ro.put("isOlderVersion", isOlderVersion);// ro.put("havingCreatePerm", havingCreatePerm);// 新增流程权限 ro.put("havingBatchPerm", havingBatchPerm);// 批量操作 Set dataVisitablePermission = CooperationCache.getUserDataVisitablePermission(teamId, userId,true); @@ -656,6 +656,33 @@ public class CoeCooperationAPIManager { } } + /** + * 获取小组成员指定文件的操作权限 + * @param teamId + * @param userId + * @param versionId + * @param ro + */ + public void queryCooperationFileActionPerm(String teamId, String userId,String versionId, ResponseObject ro) { + boolean isOlderVersion = SDK.getAppAPI().getPropertyBooleanValue("com.actionsoft.apps.coe.pal", "IsOlderVersion", true); + if (isOlderVersion){ + return; + } + boolean havingWritePerm = true; + boolean havingRemovePerm = true; + boolean havingVersionManagePerm = true; + int validUserPermDataCount = 0;// 当前小组成员有效(流程表中存在)的数据权限数量 + if (StringUtils.isNotEmpty(teamId) && isInstall()) { + Set userOperatePermission = CooperationCache.getUserDataOperatePermission(teamId, userId,versionId); + havingWritePerm = userOperatePermission.contains(CoeCooperationConst.ACTION_WRITE);// 新增、修改权限 + havingRemovePerm = userOperatePermission.contains(CoeCooperationConst.ACTION_DELETE);// 删除权限 + havingVersionManagePerm = userOperatePermission.contains(CoeCooperationConst.ACTION_VERSION);// 版本管理权限 + } + ro.put("havingWritePerm", havingWritePerm);// 新增、修改权限 + ro.put("havingRemovePerm", havingRemovePerm);// 删除权限 + ro.put("havingVersionManagePerm", havingVersionManagePerm);// 版本管理权限 + } + /** * 判断小组成员是否有某类操作权限 * @param teamId diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/job/SynchronousOrgJob.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/job/SynchronousOrgJob.java index 093c4895..30cca792 100644 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/job/SynchronousOrgJob.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/job/SynchronousOrgJob.java @@ -28,6 +28,7 @@ import java.util.*; /** + * * 同步部门、岗位数据 */ public class SynchronousOrgJob implements IJob { @@ -47,7 +48,7 @@ public class SynchronousOrgJob implements IJob { String plRid1 = UUIDGener.getUUID(); String id1 = UUIDGener.getUUID(); - orgdepartmentList = DBSql.getMaps("select DEPARTMENTNAME,ID,LAYER,PARENTDEPARTMENTID,ORDERINDEX from ORGDEPARTMENT limit 20"); + orgdepartmentList = DBSql.getMaps("select DEPARTMENTNAME,ID,LAYER,PARENTDEPARTMENTID,ORDERINDEX from ORGDEPARTMENT "); Timestamp nowTime = new Timestamp(System.currentTimeMillis()); diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java index f7e81b02..dd4bd7c6 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java @@ -3,6 +3,7 @@ package com.actionsoft.apps.coe.pal.pal.repository.web; import com.actionsoft.apps.AppPlatformConfig; import com.actionsoft.apps.AppsConst; import com.actionsoft.apps.coe.pal.cooperation.CoeCooperationAPIManager; +import com.actionsoft.apps.coe.pal.cooperation.cache.CooperationCache; import com.actionsoft.apps.coe.pal.log.CoEOpLogAPI; import com.actionsoft.apps.coe.pal.log.CoEOpLogConst; import com.actionsoft.apps.coe.pal.pal.repository.util.DiagramsUtil; @@ -8862,7 +8863,8 @@ public class CoeProcessLevelWeb extends ActionWeb { JSONArray repositoryPathData = CoeProcessLevelUtil.getRepositoryPath(id); if (UtilString.isNotEmpty(teamId)) { JSONArray tempArr = new JSONArray(); - List permVerIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, _uc.getUID()); +// List permVerIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, _uc.getUID()); + Set permVerIds = CooperationCache.getUserDataVisitablePermission(teamId, _uc.getUID(), false); for (int i = 0; i < repositoryPathData.size(); i++) { JSONObject currObj = repositoryPathData.getJSONObject(i); String pathId = currObj.getString("id"); @@ -9256,6 +9258,14 @@ public class CoeProcessLevelWeb extends ActionWeb { object.put("photoType", photoType); object.put("photo", photo); ResponseObject ro = ResponseObject.newOkResponse(); + //新版权限获取文件操作权限 + CoeCooperationAPIManager.getInstance().queryCooperationFileActionPerm(teamId,_uc.getUID(),model.getVersionId(),ro); + Map data = (Map)ro.getData(); + if (data != null && !data.isEmpty()){ + object.put("havingWritePerm", data.get("havingWritePerm"));// 新增、修改权限 + object.put("havingRemovePerm",data.get("havingRemovePerm") );// 删除权限 + object.put("havingVersionManagePerm",data.get("havingVersionManagePerm") );// 版本管理权限 + } ro.setData(object); return ro.toString(); }