EAS8.2版本二开功能授权权用户组织管辖范围为行政组织
1、需要元数据增加枚举值:com.kingdee.eas.base.permission.OrgRangeType.enum
增加枚举 名称=MANAGE_ADMIN_ORG_TYPE 别名=管辖行政组织 值=50
修改完成后元数据记得发布
2、修改com.kingdee.eas.base.permission.client.OrgRangeListUI#initOrgRangeType方法
将管辖组织移除,伪代码:this.kdcOrgRangeType.removeItem(OrgRangeType.MANAGE_ORG_TYPE);
如果是普通用户,不需要“管辖行政组织”枚举,去掉:this.kdcOrgRangeType.removeItem(OrgRangeType.MANAGE_ADMIN_ORG_TYPE);
授权权用户不能授权权用户维护管辖范围,自己查看自己管辖范围则可以,去掉:this.kdcOrgRangeType.removeItem(OrgRangeType.MANAGE_ADMIN_ORG_TYPE);
3、修改过滤条件,增加查询“管辖行政组织”枚举类型和对应组织id:com.kingdee.eas.base.permission.client.OrgRangeListUI#getDefaultFilterForQuery
分别在第一个if(OrgRangeType.BIZ_ORG_TYPE.equals(this.getOrgRangeType())){
增加分支:else if (OrgRangeType.MANAGE_ADMIN_ORG_TYPE.equals(this.getOrgRangeType())) {
typeFilterItem = new FilterItemInfo("type", new Integer(OrgRangeType.MANAGE_ADMIN_ORG_TYPE_VALUE));
}
4、com.kingdee.eas.base.permission.client.OrgRangeListUI新增方法:
/**
* 判断当前组织范围类型是否为 “管辖行政组织”
* @return
*/
private boolean isManagerAdminOrgType() {
return OrgRangeType.MANAGE_ADMIN_ORG_TYPE.equals(this.getOrgRangeType());
}
5、修改方法:com.kingdee.eas.base.permission.client.OrgRangeListUI#actionAddOrg_actionPerformed
增加分支,伪代码如下,构建F7显示信息:
```
else if (this.isManagerAdminOrgType()) {
orgF7 = new AdminOrgRangeF7PromptDialog(this, getUser()) {
@Override
public void viewDidShow() {
super.getInnerF7UI().setCancel(false);
initSnapshot(this, old);
super.getInnerF7UI().setCancel(true);
}
@Override
public FilterInfo getOuterFilterInfo() {
FilterInfo filter = new FilterInfo();
try {
// 当前用户的管辖范围下的行政组织
StringBuffer result = new StringBuffer();
result.append("UNIT.CU.id in (")
.append(PermissionRangeHelper.getBizUserCUOrgRangeSQL(null, ToolUtils.getCurrentUserPK()))
.append(")");
filter.mergeFilter(new FilterInfo(result.toString()), "and");
}catch (Exception e) {
logger.error(e);
}
return filter;
}
protected OrgAssistInfo buildNewOrgF7AssistInfo(OrgViewType orgViewType,
OrgTreeInfo orgTreeInfo, CoreBaseInfo userObject)
throws EASBizException, BOSException {
OrgAssistInfo info = super.buildNewOrgF7AssistInfo(orgViewType, orgTreeInfo, userObject);
info.setNeedAddOrgRange(false);
info.setNeedAddUserCU(false);
info.setNeedAddCU(false);
info.setIgnoreUnionGroup(true);
info.setNeedConsiderFaultTree(true);
StringBuffer extraFilters = new StringBuffer();
extraFilters.append(" AND ").append(OrgTableAliasConstants.BASEUNIT).append(".FControlUnitID IN (")
.append(PermissionRangeHelper.getBizUserCUOrgRangeSQL(null, ToolUtils.getCurrentUserPK()))
.append(")");
info.setExtraFilters(extraFilters.toString());
return info;
}
};
}
```
6、替换该方法
```
com.kingdee.eas.base.permission.client.UserListUIHelper#getCurrentRangeUser
/**
* 根据组织范围过滤用户信息
*
* @throws EASBizException /
* @throws BOSException /
* @throws UuidException /
* @throws ParserException /
* @return /
*/
public FilterInfo getCurrentRangeUser() throws EASBizException, BOSException, UuidException, ParserException {
StringBuffer filter = new StringBuffer();
filter.append(this.getIncludeInfo());
UserInfo curUserInfo = ToolUtils.getCurrentUser();
if (!Administrator.isAdminType(curUserInfo.getType())) {
// 开启 “管辖行政组织”
String userId = curUserInfo.getId().toString();
// 职位人员查看主职位部门
filter.append(" ((PM.isPrimary = 1 AND ADMIN.id IN( SELECT forgid FROM t_pm_orgrange WHERE fuserid = '").append(userId).append("' AND ftype = ").append(OrgRangeType.MANAGE_ADMIN_ORG_TYPE_VALUE).append(")) OR");
// 无职位人员查看挂靠部门
filter.append(" (PM.isPrimary IS NULL AND person.gkAdmin.id IN( SELECT forgid FROM t_pm_orgrange WHERE fuserid = '").append(userId).append("' AND ftype = ").append(OrgRangeType.MANAGE_ADMIN_ORG_TYPE_VALUE).append(")))");
} else {
filter.append(" (CU.id IN(").append(this.getCurrentUserOrgRange()).append("))");
}
String filterStr = filter.toString();
logger.debug("fiterStr is:" + filterStr);
return new FilterInfo(filterStr, true);
}
```
其他版本可以直接通过manageOrgRangeByadminOrg参数控制
![image.webp](/download/0100f5008a4f17f24e34a89eb4371d477417.webp)
EAS8.2版本二开功能授权权用户组织管辖范围为行政组织
1、需要元数据增加枚举值:com.kingdee.eas.base.permission.OrgRangeType.enum增加枚举 名称=MANAGE_ADMIN_ORG_TYPE 别名=管辖行政组...
点击下载文档
本文2024-09-16 21:56:47发表“eas cloud知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-eas-44933.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章