Example #1
0
  /**
   * 页面初始化/查询
   *
   * @return
   */
  public String init() {

    try {
      UserInfo user = getCurrentUser();
      if (info == null) {
        info = new StudentInfo();
      }
      info.setOrganization_id(user.getOrganizationID());
      info.setEnterprise_id(user.getEntiID());
      studentList = (List<StudentInfo>) service.getObjects("User.getStudentList", info);

      if (studentList != null && studentList.size() == 0) {
        // 无用户信息
        addActionError("无任何记录信息!");
        return ERROR;
      }
    } catch (BusinessException e) {
      super.addActionError("数据库操作失败!");
      log.error(e.getMessage());
      return ERROR;
    } catch (Exception e) {
      super.addActionError("数据库操作失败!");
      log.error(e.getMessage());
      return ERROR;
    }

    return SUCCESS;
  }
Example #2
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;
  }
Example #3
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;
  }
Example #4
0
  /** 为了行车规划做的新学生列表 */
  public String stList2() {
    final String vehTitle = "学生选择列表";
    UserInfo user = getCurrentUser();

    try {
      if (info == null) {
        info = new StudentInfo();
      }
      info.setOrganization_id(user.getOrganizationID());
      info.setEnterprise_id(user.getEntiID());
      info.setStu_name(stu_name);
      info.setStu_code(stu_code);
      info.setStu_class(stu_class);
      info.setStu_school(stu_school);
      info.setSite_desc(site_desc);
      info.setUpnotexist(upnotexist);
      info.setDownnotexist(downnotexist);
      info.setRoute_id(route_id);
      info.setDelupexistdata(delupexistdata);
      info.setDeldownexistdata(deldownexistdata);
      info.setSearchparam(searchparam);
      studentList = (List<StudentInfo>) service.getObjects("RidingPlan.getStudentList", info);
      // 设置操作描述
      // 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;
  }