Пример #1
0
  /**
   * 岗位设置
   *
   * @return
   */
  public String toConfigStation() {
    // 准备数据,过滤掉是删除状态的岗位信息
    Set<Station> stations = this.user.getStations();
    Set<Station> stations_ = new HashSet<Station>(0);
    for (Station station : stations) {
      if (station.getDf().equals("0")) {
        stations_.add(station);
      }
    }

    StringBuffer html = new StringBuffer();
    StringBuffer selectedIds = new StringBuffer();
    StringBuffer selectedNames = new StringBuffer();
    for (Station station : stations_) {
      selectedIds.append(station.getId() + ",");
      selectedNames.append(station.getName() + ",");

      html.append("<div class='iframe_name_box' id='" + station.getId() + "'>");
      html.append("<p class='iframe_name_text'>" + station.getName() + "</p>");
      html.append("<p class='iframe_name_close'>");
      html.append(
          "<a onclick=\"delItem('" + station.getId() + "', '" + station.getName() + "')\">");
      html.append(
          "<img src='"
              + ServletActionContext.getRequest().getContextPath()
              + "/images/component/open_textboxclose.gif' width='11' height='11' />");
      html.append("</a>");
      html.append("</p>");
      html.append("</div>");
    }
    getRequest().setAttribute("selectedHTML", html.toString());

    if (selectedIds.toString() != null && !selectedIds.toString().equals("")) {
      String _selectedIds =
          selectedIds.toString().substring(0, selectedIds.toString().length() - 1);
      getRequest().setAttribute("selectedIds", _selectedIds);
    }
    if (selectedNames.toString() != null && !selectedNames.toString().equals("")) {
      String _selectedNames =
          selectedNames.toString().substring(0, selectedNames.toString().length() - 1);
      getRequest().setAttribute("selectedNames", _selectedNames);
    }

    return "toConfigStation";
  }