|
|
【myApps/OBPM版本号】:4.4stable sp21
【浏览器类型】:Chrome
【技术QQ群】:182378297
【问题描述】:如何获取登陆用户的默认部门Id
【解决方法】:
- (function(){
- var user = getWebUser();
- var DepartmentId = user.getDefaultDepartment();
- })()
- /**
- *判断指定的用户在指定部门是否具有指定的角色
- *roleCode:角色编号 department:部门id
- *userId:用户ID
- */
- function isTheUserOwenTheDeptRolesByCode(userId, roleCode, department) {
- var doc = getCurrentDocument();
- var flag = false;
- var process = new Packages.cn.myapps.designtime.role.service.RoleServiceImpl();
- var role = process.findByRoleNo(roleCode, doc.getApplicationid());
- var roleId = role.getId();
- var sql = "select '" + getDomainid() + "'AS DOMAINID , userid as item_userid from " + DATASOURENAME + ".t_user_department_role_set where departmentid='" + department + "' and roleid='" + roleId + "' and userid='" + userId + "' ";
- var count = countBySQL(sql);
- if (count > 0) {
- flag = true;
- }
- return flag;
- };
复制代码 |
|