예제 #1
0
 public String roleAnduserList() {
   try {
     this.userRolelist = this.sysRoleService.select(null);
     if (this.userRolelist != null) {
       for (int i = 0; i < this.userRolelist.size(); i++) {
         SysRole role = new SysRole();
         List<SysUser> userlist = new ArrayList();
         role = (SysRole) this.userRolelist.get(i);
         userlist = this.sysUserService.getsysuerList(role.getId());
         role.setUserlist(userlist);
       }
     }
   } catch (Exception e) {
     e.printStackTrace();
   }
   return "list_role_user";
 }
예제 #2
0
  public void isCodeExisted() {
    boolean isCodeExisted = true;

    String id = this.sysRole.getId();
    String code = this.sysRole.getCode();
    logger.info("check isCodeExisted,code:" + code + ";id:" + id);
    try {
      SysRole sysRoleResult = (SysRole) this.sysRoleService.selectOne(this.sysRole);
      if (sysRoleResult == null) {
        isCodeExisted = false;
      } else if (StringUtils.isNotEmpty(id)) {
        isCodeExisted = !id.equals(sysRoleResult.getId());
      }
      logger.info("check isCodeExisted result:" + isCodeExisted);
      responseFlag(isCodeExisted);
    } catch (Exception e) {
      logger.error("error occur when check isCodeExisted!", e);
    }
  }