/** 解析用户和工作组的关系 */ public static boolean parseWorkGroup(String atomicExpress, String loginName) { if (StringUtils.contains(atomicExpress, TextOperator.NET.getCode())) { String workGroupName = StringUtils.substringBetween(atomicExpress, "'", "'").trim(); return !userInWorkGroup(ContextUtils.getCompanyId(), loginName, workGroupName); } else if (StringUtils.contains(atomicExpress, TextOperator.ET.getCode())) { String workGroupName = StringUtils.substringBetween(atomicExpress, "'", "'").trim(); return userInWorkGroup(ContextUtils.getCompanyId(), loginName, workGroupName); } return false; }
/** * 解析用户是否满足条件 ,判断条件的值有3中来源,分别为组织结构中、表单字段中和标准值 ${currentTransactorName} operator.text.et * '吴荣[wurong]' ${currentTransactorName} operator.text.et '${documentCreatorName}' * ${currentTransactorName} operator.text.et '${field[姓名[name]]} */ public static boolean parseUser(String atomicExpress, String loginName) { if (StringUtils.contains(atomicExpress, TextOperator.NET.getCode())) { String userLoginName = StringUtils.substringBetween(atomicExpress, "'", "'").trim(); return !loginName.equals(userLoginName); } else if (StringUtils.contains(atomicExpress, TextOperator.ET.getCode())) { String userLoginName = StringUtils.substringBetween(atomicExpress, "'", "'").trim(); return loginName.equals(userLoginName); } return false; }