Пример #1
0
 /** 新选学生专用 */
 public String stShow2() {
   final String vehTitle = "学生选择列表";
   try {
     if (info == null) {
       info = new StudentInfo();
     }
     if ("none".equals(stu_id) || "".equals(stu_id)) {
       info.setStu_id("-1");
     } else {
       info.setStu_id(stu_id);
     }
     studentList = (List<StudentInfo>) service.getObjects("RidingPlan.getStudentShow", info);
   } catch (BusinessException e) {
     addActionError(getText(e.getMessage()));
     log.error(vehTitle, e);
     return ERROR;
   }
   return SUCCESS;
 }
Пример #2
0
  /** 展示详细 */
  public String stShow() {
    final String vehTitle = "学生选择列表";
    int totalCount = 0;
    UserInfo user = getCurrentUser();

    HttpServletRequest request =
        (HttpServletRequest)
            ActionContext.getContext().get(org.apache.struts2.StrutsStatics.HTTP_REQUEST);
    // 每页显示条数
    String rpNum = request.getParameter("rp");
    // 当前页码
    String pageIndex = request.getParameter("page");
    String sortName = request.getParameter("sortname");
    String sortOrder = request.getParameter("sortorder");

    try {
      if (info == null) {
        info = new StudentInfo();
      }
      info.setOrganization_id(user.getOrganizationID());
      info.setEnterprise_id(user.getEntiID());
      info.setSortname(sortName);
      info.setSortorder(sortOrder);
      if (info.getStu_id() == null
          || "none".equals(info.getStu_id())
          || "".equals(info.getStu_id())) {
        info.setStu_id("-1");
      }
      totalCount = service.getCount("RidingPlan.getCountSTShow", info);

      studentList =
          (List<StudentInfo>)
              service.getObjectsByPage(
                  "RidingPlan.getStudentShow",
                  info,
                  (Integer.parseInt(pageIndex) - 1) * Integer.parseInt(rpNum),
                  Integer.parseInt(rpNum));

      this.map = getPagination2(studentList, totalCount, pageIndex);
    } catch (BusinessException e) {
      addActionError(getText(e.getMessage()));
      log.error(vehTitle, e);
      return ERROR;
    }

    return SUCCESS;
  }