diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java index ee76d025..8161366b 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java @@ -5517,14 +5517,6 @@ public class PALRepositoryQueryAPIManager { String depViewPer = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.reportform", "Dep_View_Per"); String newBoName = "BO_ACT_PUBLISH_PERM_SCOPE"; - BO bo = SDK.getBOAPI().query(newBoName).addQuery("PALVERSIONID=", model.getVersionId()).detail(); - if (bo == null) { - return false; - } - String permType = bo.getString("PERMTYPE"); - if ("1".equals(permType)) {// 全集团,都有权限 - return true; - } // 如果当前人是系统管理员角色或者兼职系统管理员角色,默认有权限 String roleId = "d102c89d-55f3-4865-9d5c-c00b7f47b803";// 系统管理员 if (roleId.equals(uc.getRoleModel().getId())) { @@ -5552,6 +5544,62 @@ public class PALRepositoryQueryAPIManager { return true; } } + + //新增的查询逻辑 + BO boNew = SDK.getBOAPI().query(newBoName).addQuery("FILEUUID=", model.getId()).detail(); + //原来的查询逻辑 + if (boNew != null) { + System.out.println(">>>>>>查询新逻辑 = " + model.getId()); + String permType = boNew.getString("PERMTYPE"); + if ("1".equals(permType)) {// 全集团,都有权限 + return true; + } + String orgPerm = boNew.getString("ORGPERM"); + String postPerm = boNew.getString("POSTPERM"); + String levelPerm = boNew.getString("LEVELPERM"); + // 根据发布流程选择的发布范围,获取所选组织、岗位、职级的交集进行权限控制 + boolean newResult; + // 都不为空时 + if (UtilString.isNotEmpty(orgPerm) && UtilString.isNotEmpty(postPerm) && UtilString.isNotEmpty(levelPerm)) { + newResult= (getOrgPerm(orgPerm, uc) && getLevelPerm(levelPerm, uc)) || getPostPerm(postPerm, uc); + // 职级为空时 + } else if (UtilString.isNotEmpty(orgPerm) && UtilString.isNotEmpty(postPerm) && UtilString.isEmpty(levelPerm)) { + newResult= getOrgPerm(orgPerm, uc) || getPostPerm(postPerm, uc); + // 岗位为空时 + } else if (UtilString.isNotEmpty(orgPerm) && UtilString.isNotEmpty(levelPerm) && UtilString.isEmpty(postPerm)) { + newResult= getOrgPerm(orgPerm, uc) && getLevelPerm(levelPerm, uc); + // 组织为空时 + } else if (UtilString.isNotEmpty(postPerm) && UtilString.isNotEmpty(levelPerm) && UtilString.isEmpty(orgPerm)) { + newResult= getPostPerm(postPerm, uc) || getLevelPerm(levelPerm, uc); + // 组织、岗位为空时 + } else if (UtilString.isNotEmpty(levelPerm) && UtilString.isEmpty(postPerm) && UtilString.isEmpty(orgPerm)) { + newResult= getLevelPerm(levelPerm, uc); + // 组织、职级为空时 + } else if (UtilString.isNotEmpty(postPerm) && UtilString.isEmpty(levelPerm) && UtilString.isEmpty(orgPerm)) { + newResult= getPostPerm(postPerm, uc); + // 岗位、职级为空时 + } else if (UtilString.isNotEmpty(orgPerm) && UtilString.isEmpty(levelPerm) && UtilString.isEmpty(postPerm)) { + newResult= getOrgPerm(orgPerm, uc); + } else { + newResult = false; + } + + if (newResult) { + return true; + } + + } + + //原来的查询逻辑 + BO bo = SDK.getBOAPI().query(newBoName).addQuery("PALVERSIONID=", model.getVersionId()).detail(); + System.out.println(">>>>>>查询原有逻辑 = " + model.getVersionId()); + if (bo == null) { + return false; + } + String permType = bo.getString("PERMTYPE"); + if ("1".equals(permType)) {// 全集团,都有权限 + return true; + } String orgPerm = bo.getString("ORGPERM"); String postPerm = bo.getString("POSTPERM"); String levelPerm = bo.getString("LEVELPERM"); 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 1ec659dd..f1e48315 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 @@ -34,6 +34,7 @@ import com.actionsoft.apps.coe.pal.pal.repository.util.PALFrameworkFilterUtil; import com.actionsoft.bpms.bo.engine.BO; import com.actionsoft.bpms.commons.formfile.model.delegate.FormFile; import com.actionsoft.sdk.local.api.BOQueryAPI; +import jodd.util.StringUtil; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.apache.poi.hssf.usermodel.HSSFCell; @@ -2905,7 +2906,22 @@ public class CoeProcessLevelWeb extends ActionWeb { inputValue = CoeProcessLevelUtil.escapeHtml(inputValue); boolean isRequired = attributeModel.getIsRequired(); String desc = attributeModel.getDesc(); - + //修改显示的版本号 by ydq + if (StringUtil.isNotBlank(id) && "P_versions".equals(id)) { + System.out.println("进入数据转化节点,版本数据" + inputValue); + String[] parts = inputValue.split("\\."); + int majorVersion = Integer.parseInt(parts[0]); + System.out.println("大版本数据" + majorVersion); + String minorVersionStr = parts.length > 1 ? parts[1] : "0"; + // 补足三位小数 + while (minorVersionStr.length() < 3) { + minorVersionStr += "0"; + } + int minorVersion = Integer.parseInt(minorVersionStr); + System.out.println("小版本数据" + minorVersion); + inputValue = majorVersion + "." + minorVersion; + System.out.println("转化后数据" + inputValue); + } String input = ""; String type = attributeModel.getType();