示例#1
0
  /** 为了行车规划做的学生列表 */
  public String stList() {
    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);
      // info.setRp(rpNum);
      // info.setPage(pageIndex);
      totalCount = service.getCount("RidingPlan.getCountST", info);

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

      this.map = getPagination(studentList, totalCount, pageIndex);

      // 设置操作描述
      // this.addOperationLog(formatLog(vehTitle, null));
      // 设置操作类型
      // this.setOperationType(Constants.SELECT);
      // 设置所属应用系统
      // this.setApplyId(Constants.CLW_P_CODE);
      // 设置所属模块
      // this.setModuleId(MouldId.YTP_OILMANAGE_QUREY_ID);
    } 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;
  }