Example #1
0
  /**
   * 加载用户列表,用于选择用户组件
   *
   * @return
   */
  @SuppressWarnings("unchecked")
  public String loadUserList() {
    query.setDf("0");
    // 如果是取某分区下的用户,根据分区下的组织机构取得所有用户
    if (partitionId != null && !"".equals(partitionId)) {
      Partition partition = partitionManager.getById(partitionId);
      if (partition != null) {
        query.setOrganizIds(organizationManager.findAllChildByPartition(partition));
      }
    }

    Page page = this.organizationUserRelationManager.findByUserPage(query);
    page = userManager.findPage(query);

    List<User> users = page.getResult();
    // 处理部门列表
    for (User user : users) {
      user.setDeptsString("");
      if (user.getOuRelations() != null) {
        StringBuffer sb = new StringBuffer();
        for (OrganizationUserRelation our : user.getOuRelations()) {
          if (our.getOrganization() != null) {
            sb.append(our.getOrganization().getName() + ",");
          }
        }
        user.setDeptsString(sb.toString());
      }
    }
    // 性别
    for (User user : users) {
      /*if (user.getSex() != null && !user.getSex().equals("")) {
      	this.sexMap = this.dicUtil.getDicList("DICT_SEX");
      	user.setSexString(this.sexMap.get(user.getSex()));
      }*/
    }
    this.saveCurrentPage(page, query);
    return "loadUserList";
  }
Example #2
0
  /**
   * 发起测评 -- 跨单位
   *
   * @return
   */
  public String outUserList() {
    Page page = this.userManager.findOutPage(query, this.getCurrUser().getDeptIDs());
    String userId = query.getId();
    List<User> userList = page.getResult();

    for (User user : userList) {
      String uId = user.getId();
      if (!isNullOrEmptyString(userId)) {
        if (userId.indexOf(uId) != -1) {
          user.setChecked("1");
        }
      }
    }

    super.saveCurrentPage(page, query);
    return "outUserList";
  }
Example #3
0
  public String sponsorList() {
    Page page = this.userManager.findHead(query);
    String userId = query.getId();
    List<User> usersList = page.getResult();

    for (User user : usersList) {
      String uId = user.getId();
      if (!isNullOrEmptyString(userId)) {
        if (userId.indexOf(uId) != -1) {
          user.setChecked("1");
        }
      }
    }

    this.saveCurrentPage(page, query);
    return "sponsorList";
  }