waf平台常用方法总结

//得到当前登录人各种的信息

      //得到配置文件中的档案室角色id

      String das = WAFConfigure.getProperty("das");

      //得到登陆人的部门ID

      String deptid = this.getCurrentUser().getDeptId();

      String deptName ="";

      if(WafDeptProxy.getWafDeptById(deptid).getDeptName() != null && !(WafDeptProxy.getWafDeptById(deptid).getDeptName()).equals("")) {

        //得到登陆人的部门名称

          deptName = WafDeptProxy.getWafDeptById(this.getCurrentUser().getDeptId()).getDeptName();

      }

      System.out.println("机构问题查询操作人的部门名称为:" + deptName);

      //得到登录人的用户id

      String uid = this.getCurrentUser().getUserId();

      //得到用户的角色数组

      String[] role = WafUserProxy.getWafUserRoleIds(uid, conn);

      //判断是否拥有档案室角色

      boolean isDas = false;

      if(role != null && role.length > 0) {

          for(int i = 0; i < role.length; i++) {

              if(role[i].trim().equals(das)) {

                  System.out.println("*******档案室角色用户登陆执行的查询!********");

                  isDas = true;

              }

          } 

      }
  
  
  //得到登录人的部门id
        
did  = this.getCurrentUser().getDeptId();
        
  if(WafDeptProxy.getWafDeptById(did) != null && !"".equals(WafDeptProxy.getWafDeptById(did))) {
         
  //得到父部门的id
         
  fdeptid  = WafDeptProxy.getWafDeptById(did).getParentDeptId();
         
this.deptId = fdeptid;
         
//得到父部门的名称
         
fdept  = WafDeptProxy.getWafDeptById(fdeptid).getDeptName();
         
this.deptName = fdept;

  
  
  //jsp页面获取
  WafUser user = (WafUser)request.getSession().getAttribute("user");

 

 

你可能感兴趣的:(常用方法)