/*
   *
   * (non-Javadoc)
   *
   * @see com.opensymphony.xwork.ActionSupport#execute()
   */
  public String execute() {
    User userVO = null;
    try {

      /** 验证请求的属性是否完整,防止知道URL非法请求----开始 */
      String userId = this.getRequest().getParameter("userId");
      String name = this.getRequest().getParameter("name");
      String password = this.getRequest().getParameter("password");
      String mailAddress = this.getRequest().getParameter("mailAddress");
      String mobileNumber = this.getRequest().getParameter("mobileNumber");
      String pageSize = this.getRequest().getParameter("pageSize");

      if (StringUtils.hasText(userId)
          && StringUtils.hasText(name)
          && StringUtils.hasText(password)
          && StringUtils.hasText(mailAddress)
          && StringUtils.hasText(mobileNumber)
          && StringUtils.hasText(pageSize)) {
        try {
          NumberUtils.parseNumber(userId, Integer.class);
          NumberUtils.parseNumber(pageSize, Integer.class);
        } catch (Exception e) {
          /** 记录日志 */
          LogsApplication appLog = new LogsApplication();
          appLog.setOperator(this.getUserSessionInfo().getName());
          appLog.setLogDate(new Date());
          appLog.setEventType("修改用户自身信息异常");
          appLog.setContent(
              "操作员["
                  + this.getUserSessionInfo().getName()
                  + "]"
                  + "修改用户出现异常,异常信息:["
                  + e.getMessage()
                  + "]!");
          appLog.setPriority(LogsApplication.EXCEPTION);
          appLog.setIpAddress(this.getUserSessionInfo().getIpAddress());
          this.appLogManager.saveOrUpdateAppLog(appLog);

          /** 输出错误信息 */
          logger.error(e.getMessage());
          e.printStackTrace();

          return INPUT;
        }
        /** 每个属性都有内容表示正常 */
      } else {
        /** 记录日志 */
        LogsApplication appLog = new LogsApplication();
        appLog.setOperator(this.getUserSessionInfo().getName());
        appLog.setLogDate(new Date());
        appLog.setEventType("修改用户自身信息异常");
        appLog.setContent(
            "操作员["
                + this.getUserSessionInfo().getName()
                + "]"
                + "修改用户自身信息出现异常,异常信息:["
                + "必填属性值有空值"
                + "]!");
        appLog.setPriority(LogsApplication.EXCEPTION);
        appLog.setIpAddress(this.getUserSessionInfo().getIpAddress());
        this.appLogManager.saveOrUpdateAppLog(appLog);

        /** 输出错误信息 */
        logger.error("必填属性值有空值");

        /** 有空值的属性,返回 */
        return INPUT;
      }

      /** 验证请求的属性是否完整----结束 */

      // 通过identifier获得User对象。
      userVO =
          this.getUserManager()
              .getUserById(
                  NumberUtils.parseNumber(StringUtils.trimWhitespace(userId), Integer.class));
      if (userVO == null) {
        return "emptyUser";
      }

      /** 验证用户是否存在 */
      if (!StringUtils.trimWhitespace(userVO.getName()).equals(StringUtils.trimWhitespace(name))) {
        if (this.getUserManager().getUserByUserName(StringUtils.trimWhitespace(name)) != null) {
          return "existUser";
        }
      }

      // 设置属性。
      userVO.setName(name);
      userVO.setMailAddress(mailAddress);
      userVO.setMobileNumber(mobileNumber);
      userVO.setPageSize(new Integer(pageSize));
      userVO.setPassword(password);
      this.getUserManager().saveOrUpdateUser(userVO);

      /** 记录日志 */
      LogsApplication appLog = new LogsApplication();
      appLog.setOperator(this.getUserSessionInfo().getName());
      appLog.setLogDate(new Date());
      appLog.setEventType("修改用户自身信息");
      appLog.setContent("操作员[" + this.getUserSessionInfo().getName() + "]" + "修改用户自身信息!");
      appLog.setPriority(LogsApplication.NORMAL);
      appLog.setIpAddress(this.getUserSessionInfo().getIpAddress());
      this.appLogManager.saveOrUpdateAppLog(appLog);

      return SUCCESS;
    } catch (Exception e) {

      /** 记录日志 */
      LogsApplication appLog = new LogsApplication();
      appLog.setOperator(this.getUserSessionInfo().getName());
      appLog.setLogDate(new Date());
      appLog.setEventType("修改自身用户信息异常");
      appLog.setContent(
          "操作员["
              + this.getUserSessionInfo().getName()
              + "]"
              + "修改自身用户信息出现异常,异常信息:["
              + e.getMessage()
              + "]!");
      appLog.setPriority(LogsApplication.EXCEPTION);
      appLog.setIpAddress(this.getUserSessionInfo().getIpAddress());
      this.appLogManager.saveOrUpdateAppLog(appLog);

      /** 输出错误信息 */
      logger.error(e.getMessage());
      e.printStackTrace();

      return ERROR;
    }
  }
  /*
   *
   * (non-Javadoc)
   *
   * @see com.opensymphony.xwork.ActionSupport#execute()
   */
  public String execute() {
    List moduleList = null;
    ModulesSearchCondition modulesSearch = null;
    String searchName = "";
    try {

      /** 验证请求的属性是否完整,防止知道URL非法请求----开始 */
      String page = this.getRequest().getParameter("page");
      String name = this.getRequest().getParameter("name");
      String isNewSearch = this.getRequest().getParameter("isNew");
      if (page != null) {
        if (page.trim().length() > 0) {
          try {
            NumberUtils.parseNumber(page, Integer.class);
          } catch (Exception e) {
            /** 记录日志 */
            LogsApplication appLog = new LogsApplication();
            appLog.setOperator(this.getUserSessionInfo().getName());
            appLog.setLogDate(new Date());
            appLog.setEventType("搜索模块异常");
            appLog.setContent(
                "操作员["
                    + this.getUserSessionInfo().getName()
                    + "]"
                    + "搜索模块出现异常,异常信息:["
                    + e.getMessage()
                    + "]!");
            appLog.setPriority(LogsApplication.EXCEPTION);
            appLog.setIpAddress(this.getUserSessionInfo().getIpAddress());
            this.appLogManager.saveOrUpdateAppLog(appLog);

            /** 输出错误信息 */
            logger.error(e.getMessage());
            e.printStackTrace();
          }
        }
      }

      /** 构造搜索对象 */
      modulesSearch = new ModulesSearchCondition();
      if (StringUtils.hasText(name)) {
        searchName = name;
        modulesSearch.setName(StringUtils.trimWhitespace(name));
      }

      /** 验证请求的属性是否完整----结束 */

      /** 构造Page对象 */
      Page pageInfo = this.getModuleManager().searchModules(modulesSearch, this.getUserPageSize());

      /** 设置取的页数 */
      if (page != null) {
        if (page.trim().length() > 0) {
          try {
            pageInfo.setPage(
                (Integer) NumberUtils.parseNumber(StringUtils.trimWhitespace(page), Integer.class));
          } catch (Exception e) {
            /** 记录日志 */
            LogsApplication appLog = new LogsApplication();
            appLog.setOperator(this.getUserSessionInfo().getName());
            appLog.setLogDate(new Date());
            appLog.setEventType("搜索模块异常");
            appLog.setContent(
                "操作员["
                    + this.getUserSessionInfo().getName()
                    + "]"
                    + "搜索模块出现异常,异常信息:["
                    + e.getMessage()
                    + "]!");
            appLog.setPriority(LogsApplication.EXCEPTION);
            appLog.setIpAddress(this.getUserSessionInfo().getIpAddress());
            this.appLogManager.saveOrUpdateAppLog(appLog);

            /** 输出错误信息 */
            logger.error(e.getMessage());
            e.printStackTrace();
          }
        }
      }

      /** 如果是新搜索 */
      if (isNewSearch != null) {
        if (isNewSearch.trim().length() > 0) {
          if (isNewSearch.equalsIgnoreCase("true")) {
            pageInfo.setPage(1);
          }
        }
      }
      /** 获得分页集合 */
      moduleList = this.getModuleManager().searchModules(modulesSearch, pageInfo);

      /** 设置到属性中去 */
      this.getRequest().setAttribute("pageInfo", pageInfo);
      this.getRequest().setAttribute("moduleList", moduleList);
      this.getRequest().setAttribute("searchContent", modulesSearch);
      this.getRequest().setAttribute("name", searchName);

      this.getRequest()
          .setAttribute(
              "actionName",
              "searchModules."
                  + Global.ACTION_EXT
                  + "?name="
                  + StringUtils.trimWhitespace(searchName));

      /** 记录日志 */
      LogsApplication appLog = new LogsApplication();
      appLog.setOperator(this.getUserSessionInfo().getName());
      appLog.setLogDate(new Date());
      appLog.setEventType("搜索模块");
      appLog.setContent("操作员[" + this.getUserSessionInfo().getName() + "]" + "搜索模块!");
      appLog.setPriority(LogsApplication.NORMAL);
      appLog.setIpAddress(this.getUserSessionInfo().getIpAddress());
      this.appLogManager.saveOrUpdateAppLog(appLog);

      return SUCCESS;
    } catch (Exception e) {

      /** 记录日志 */
      LogsApplication appLog = new LogsApplication();
      appLog.setOperator(this.getUserSessionInfo().getName());
      appLog.setLogDate(new Date());
      appLog.setEventType("搜索模块异常");
      appLog.setContent(
          "操作员["
              + this.getUserSessionInfo().getName()
              + "]"
              + "搜索模块出现异常,异常信息:["
              + e.getMessage()
              + "]!");
      appLog.setPriority(LogsApplication.EXCEPTION);
      appLog.setIpAddress(this.getUserSessionInfo().getIpAddress());
      this.appLogManager.saveOrUpdateAppLog(appLog);

      /** 输出错误信息 */
      logger.error(e.getMessage());
      e.printStackTrace();

      return ERROR;
    }
  }
  /*
   *
   * (non-Javadoc)
   *
   * @see com.opensymphony.xwork.ActionSupport#execute()
   */
  public String execute() {
    Module moduleVO = new Module();
    Module oldModuleVO = null;
    try {

      /** 验证请求的属性是否完整,防止知道URL非法请求----开始 */
      String name = this.getRequest().getParameter("name");
      String parentId = this.getRequest().getParameter("parentId");
      String actionUrl = this.getRequest().getParameter("actionUrl");
      String moduleLevel = this.getRequest().getParameter("moduleLevel");
      String viewType = this.getRequest().getParameter("viewType");
      String moduleSort = this.getRequest().getParameter("moduleSort");
      if (StringUtils.hasText(name)
          && StringUtils.hasText(parentId)
          && StringUtils.hasText(actionUrl)
          && StringUtils.hasText(moduleLevel)
          && StringUtils.hasText(viewType)
          && StringUtils.hasText(moduleSort)) {
        try {
          NumberUtils.parseNumber(parentId, Integer.class);
          NumberUtils.parseNumber(moduleLevel, Integer.class);
          NumberUtils.parseNumber(moduleSort, Integer.class);
        } catch (Exception e) {
          /** 记录日志 */
          LogsApplication appLog = new LogsApplication();
          appLog.setOperator(this.getUserSessionInfo().getName());
          appLog.setLogDate(new Date());
          appLog.setEventType("新增一级模块异常");
          appLog.setContent(
              "操作员["
                  + this.getUserSessionInfo().getName()
                  + "]"
                  + "新增一级模块出现异常,异常信息:["
                  + e.getMessage()
                  + "]!");
          appLog.setPriority(LogsApplication.EXCEPTION);
          appLog.setIpAddress(this.getUserSessionInfo().getIpAddress());
          this.appLogManager.saveOrUpdateAppLog(appLog);

          /** 输出错误信息 */
          logger.error(e.getMessage());
          e.printStackTrace();

          return INPUT;
        }
        /** 每个属性都有内容表示正常 */
      } else {
        /** 记录日志 */
        LogsApplication appLog = new LogsApplication();
        appLog.setOperator(this.getUserSessionInfo().getName());
        appLog.setLogDate(new Date());
        appLog.setEventType("新增一级模块异常");
        appLog.setContent(
            "操作员["
                + this.getUserSessionInfo().getName()
                + "]"
                + "新增一级模块出现异常,异常信息:["
                + "必填属性值有空值"
                + "]!");
        appLog.setPriority(LogsApplication.EXCEPTION);
        appLog.setIpAddress(this.getUserSessionInfo().getIpAddress());
        this.appLogManager.saveOrUpdateAppLog(appLog);

        logger.error("必填属性值有空值");

        /** 有空值的属性,返回 */
        return INPUT;
      }

      /** 验证请求的属性是否完整----结束 */

      /** 验证模块是否存在 */
      oldModuleVO = this.getModuleManager().getModuleByModuleName(StringUtils.trimWhitespace(name));
      if (oldModuleVO != null) {
        this.getRequest()
            .setAttribute(
                "actionName",
                this.getWebApplitionUrl() + "/webmanager/module/toAddFirstModule.action");
        return "existModule";
      }

      /** 添加模块 */
      // BeanUtils.copyProperties(moduleVO, moduleFormBean);
      // BeanUtil会将null的属性赋值为0||""。
      moduleVO.setId(null);
      moduleVO.setName(StringUtils.trimWhitespace(name));
      moduleVO.setParentId(
          (Integer) NumberUtils.parseNumber(StringUtils.trimWhitespace(parentId), Integer.class));
      moduleVO.setActionUrl(StringUtils.trimWhitespace(actionUrl));
      moduleVO.setModuleLevel(
          (Integer)
              NumberUtils.parseNumber(StringUtils.trimWhitespace(moduleLevel), Integer.class));
      moduleVO.setViewType(StringUtils.trimWhitespace(viewType));
      moduleVO.setModuleSort(
          (Integer) NumberUtils.parseNumber(StringUtils.trimWhitespace(moduleSort), Integer.class));

      /** 添加 */
      this.getModuleManager().saveOrUpdateModule(moduleVO);

      /** 记录日志 */
      LogsApplication appLog = new LogsApplication();
      appLog.setOperator(this.getUserSessionInfo().getName());
      appLog.setLogDate(new Date());
      appLog.setEventType("新增一级模块");
      appLog.setContent(
          "操作员["
              + this.getUserSessionInfo().getName()
              + "]"
              + "新增一级模块,新增一级模块是["
              + moduleVO.getName()
              + "]!");
      appLog.setPriority(LogsApplication.NORMAL);
      appLog.setIpAddress(this.getUserSessionInfo().getIpAddress());
      this.appLogManager.saveOrUpdateAppLog(appLog);

      return SUCCESS;

    } catch (Exception e) {
      /** 记录日志 */
      LogsApplication appLog = new LogsApplication();
      appLog.setOperator(this.getUserSessionInfo().getName());
      appLog.setLogDate(new Date());
      appLog.setEventType("新增一级模块异常");
      appLog.setContent(
          "操作员["
              + this.getUserSessionInfo().getName()
              + "]"
              + "新增一级模块出现异常,异常信息:["
              + e.getMessage()
              + "]!");
      appLog.setPriority(LogsApplication.EXCEPTION);
      appLog.setIpAddress(this.getUserSessionInfo().getIpAddress());
      this.appLogManager.saveOrUpdateAppLog(appLog);

      /** 输出错误信息 */
      logger.error(e.getMessage());
      e.printStackTrace();

      return ERROR;
    }
  }
  /*
   *
   * (non-Javadoc)
   *
   * @see com.opensymphony.xwork.ActionSupport#execute()
   */
  public String execute() {
    User userVO = null;
    String[] items = null;
    try {
      /** 验证请求的属性是否完整,防止知道URL非法请求----开始 */
      items = this.getRequest().getParameterValues("items");

      if (items == null) {
        /** 记录日志 */
        LogsApplication appLog = new LogsApplication();
        appLog.setOperator(this.getUserSessionInfo().getName());
        appLog.setLogDate(new Date());
        appLog.setEventType("批量删除用户异常");
        appLog.setContent(
            "操作员["
                + this.getUserSessionInfo().getName()
                + "]"
                + "批量删除用户出现异常,异常信息:["
                + "必填属性值有空值"
                + "]!");
        appLog.setPriority(LogsApplication.EXCEPTION);
        appLog.setIpAddress(this.getUserSessionInfo().getIpAddress());
        this.appLogManager.saveOrUpdateAppLog(appLog);
        /** 有空值的属性,返回 */

        /** 输出错误信息 */
        logger.error("必填属性值有空值");

        return INPUT;
      } else {
        if (items.length <= 0) {
          /** 每个属性都有内容表示正常 */
          /** 记录日志 */
          LogsApplication appLog = new LogsApplication();
          appLog.setOperator(this.getUserSessionInfo().getName());
          appLog.setLogDate(new Date());
          appLog.setEventType("批量删除用户异常");
          appLog.setContent(
              "操作员["
                  + this.getUserSessionInfo().getName()
                  + "]"
                  + "批量删除用户出现异常,异常信息:["
                  + "必填属性值有空值"
                  + "]!");
          appLog.setPriority(LogsApplication.EXCEPTION);
          appLog.setIpAddress(this.getUserSessionInfo().getIpAddress());
          this.appLogManager.saveOrUpdateAppLog(appLog);
          /** 有空值的属性,返回 */

          /** 输出错误信息 */
          logger.error("必填属性值有空值");

          return INPUT;
        }
      }
      /** 验证请求的属性是否完整----结束 */
      Integer[] temp = null;
      temp = new Integer[items.length];

      for (int i = 0; i < items.length; i++) {
        /** 获取用户对象 */
        userVO =
            this.getUserManager()
                .getUserById(
                    NumberUtils.parseNumber(StringUtils.trimWhitespace(items[i]), Integer.class));
        if (userVO == null) {
          return "emptyUser";
        }
        if (userVO.getId() == 1) {
          return "noDelUser";
        }

        temp[i] =
            (Integer) NumberUtils.parseNumber(StringUtils.trimWhitespace(items[i]), Integer.class);
      }

      /** 删除一组用户 */
      this.getUserManager().removeUserByIds(temp);

      /** 记录日志 */
      LogsApplication appLog = new LogsApplication();
      appLog.setOperator(this.getUserSessionInfo().getName());
      appLog.setLogDate(new Date());
      appLog.setEventType("批量删除用户");
      appLog.setContent("操作员[" + this.getUserSessionInfo().getName() + "]" + "批量删除用户!");
      appLog.setPriority(LogsApplication.NORMAL);
      appLog.setIpAddress(this.getUserSessionInfo().getIpAddress());
      this.appLogManager.saveOrUpdateAppLog(appLog);
      return SUCCESS;

    } catch (Exception e) {
      /** 记录日志 */
      LogsApplication appLog = new LogsApplication();
      appLog.setOperator(this.getUserSessionInfo().getName());
      appLog.setLogDate(new Date());
      appLog.setEventType("批量删除用户异常");
      appLog.setContent(
          "操作员["
              + this.getUserSessionInfo().getName()
              + "]"
              + "批量删除用户出现异常,异常信息:["
              + e.getMessage()
              + "]!");
      appLog.setPriority(LogsApplication.EXCEPTION);
      appLog.setIpAddress(this.getUserSessionInfo().getIpAddress());
      this.appLogManager.saveOrUpdateAppLog(appLog);

      /** 输出错误信息 */
      logger.error(e.getMessage());
      e.printStackTrace();

      return ERROR;
    }
  }
  /*
   *
   * (non-Javadoc)
   *
   * @see com.opensymphony.xwork.ActionSupport#execute()
   */
  public String execute() {
    Function functionVO = new Function();
    Function oldfunctionVO = null;
    Module moduleVO = null;

    try {

      /** 验证请求的属性是否完整,防止知道URL非法请求----开始 */
      String moduleId = this.getRequest().getParameter("moduleId");
      String name = this.getRequest().getParameter("name");

      if (StringUtils.hasText(moduleId) && StringUtils.hasText(name)) {
        try {
          NumberUtils.parseNumber(moduleId, Integer.class);
        } catch (Exception e) {
          /** 记录日志 */
          LogsApplication appLog = new LogsApplication();
          appLog.setOperator(this.getUserSessionInfo().getName());
          appLog.setLogDate(new Date());
          appLog.setEventType("新增功能异常");
          appLog.setContent(
              "操作员["
                  + this.getUserSessionInfo().getName()
                  + "]"
                  + "新增功能出现异常,异常信息:["
                  + e.getMessage()
                  + "]!");
          appLog.setPriority(LogsApplication.EXCEPTION);
          appLog.setIpAddress(this.getUserSessionInfo().getIpAddress());
          this.appLogManager.saveOrUpdateAppLog(appLog);

          /** 输出错误信息 */
          logger.error(e.getMessage());
          e.printStackTrace();

          return INPUT;
        }
        /** 每个属性都有内容表示正常 */
      } else {
        /** 记录日志 */
        LogsApplication appLog = new LogsApplication();
        appLog.setOperator(this.getUserSessionInfo().getName());
        appLog.setLogDate(new Date());
        appLog.setEventType("新增功能异常");
        appLog.setContent(
            "操作员["
                + this.getUserSessionInfo().getName()
                + "]"
                + "新增功能出现异常,异常信息:["
                + "必填属性值有空值"
                + "]!");
        appLog.setPriority(LogsApplication.EXCEPTION);
        appLog.setIpAddress(this.getUserSessionInfo().getIpAddress());
        this.appLogManager.saveOrUpdateAppLog(appLog);

        /** 输出错误信息 */
        logger.error("必填属性值有空值");
        /** 有空值的属性,返回 */
        return INPUT;
      }

      /** 验证请求的属性是否完整----结束 */

      /** 验证请求的属性是否完整----结束 */

      /** 获取模块对象 */
      moduleVO =
          this.getModuleManager()
              .getModuleById(
                  NumberUtils.parseNumber(StringUtils.trimWhitespace(moduleId), Integer.class));
      if (moduleVO == null) {
        return "emptyModule";
      }

      /** 验证功能是否存在 */
      // oldfunctionVO = this
      // .getFunctionManager()
      // .getFunctionByFunctionName(StringUtils.trimWhitespace(name));
      // if (oldfunctionVO != null) {
      // this
      // .getRequest()
      // .setAttribute(
      // "actionName",
      // this.getWebApplitionUrl()
      // + "/webmanager/module/toAddFunction.action?moduleId="
      // + NumberUtils.parseNumber(moduleId,
      // Integer.class));
      // return "existFunction";
      // }
      /** 设置属性 */
      functionVO.setName(StringUtils.trimWhitespace(name));
      functionVO.setModule(moduleVO);

      this.functionManager.saveOrUpdateFunction(functionVO);

      /** 记录日志 */
      LogsApplication appLog = new LogsApplication();
      appLog.setOperator(this.getUserSessionInfo().getName());
      appLog.setLogDate(new Date());
      appLog.setEventType("新增功能");
      appLog.setContent(
          "操作员["
              + this.getUserSessionInfo().getName()
              + "]"
              + "新增功能,新增功能是["
              + functionVO.getName()
              + "]!");
      appLog.setPriority(LogsApplication.NORMAL);
      appLog.setIpAddress(this.getUserSessionInfo().getIpAddress());
      this.appLogManager.saveOrUpdateAppLog(appLog);

      this.getRequest()
          .setAttribute(
              "actionName",
              this.getWebApplitionUrl()
                  + "/webmanager/module/getModuleFunctions.action?moduleId="
                  + NumberUtils.parseNumber(moduleId, Integer.class));
      return SUCCESS;

    } catch (Exception e) {

      /** 记录日志 */
      LogsApplication appLog = new LogsApplication();
      appLog.setOperator(this.getUserSessionInfo().getName());
      appLog.setLogDate(new Date());
      appLog.setEventType("新增功能异常");
      appLog.setContent(
          "操作员["
              + this.getUserSessionInfo().getName()
              + "]"
              + "新增功能出现异常,异常信息:["
              + e.getMessage()
              + "]!");
      appLog.setPriority(LogsApplication.EXCEPTION);
      appLog.setIpAddress(this.getUserSessionInfo().getIpAddress());
      this.appLogManager.saveOrUpdateAppLog(appLog);

      /** 输出错误信息 */
      logger.error(e.getMessage());
      e.printStackTrace();

      return ERROR;
    }
  }
  /*
   *
   * (non-Javadoc)
   *
   * @see com.opensymphony.xwork.ActionSupport#execute()
   */
  public String execute() {
    List loginLogList = null;
    LogsLoginSearchCondition logsSearch = null;
    String searchOperator = "";
    String searchEventType = "";
    String searchStartLogDate = "";
    String searchEndLogDate = "";
    try {

      /** 验证请求的属性是否完整,防止知道URL非法请求----开始 */
      String page = this.getRequest().getParameter("page");
      String operator = this.getRequest().getParameter("operator");
      String eventType = this.getRequest().getParameter("eventType");
      String startLogDate = this.getRequest().getParameter("startLogDate");
      String endLogDate = this.getRequest().getParameter("endLogDate");
      String isNewSearch = this.getRequest().getParameter("isNew");
      if (page != null) {
        if (page.trim().length() > 0) {
          try {
            NumberUtils.parseNumber(page, Integer.class);
          } catch (Exception e) {
            /** 记录日志 */
            LogsApplication appLog = new LogsApplication();
            appLog.setOperator(this.getUserSessionInfo().getName());
            appLog.setLogDate(new Date());
            appLog.setEventType("搜索登陆日志异常");
            appLog.setContent(
                "操作员["
                    + this.getUserSessionInfo().getName()
                    + "]"
                    + "搜索登陆日志出现异常,异常信息:["
                    + e.getMessage()
                    + "]!");
            appLog.setPriority(LogsApplication.EXCEPTION);
            appLog.setIpAddress(this.getUserSessionInfo().getIpAddress());
            this.appLogManager.saveOrUpdateAppLog(appLog);

            /** 输出错误信息 */
            logger.error(e.getMessage());
            e.printStackTrace();
          }
        }
      }

      /** 构造搜索对象 */
      logsSearch = new LogsLoginSearchCondition();
      if (StringUtils.hasText(operator)) {
        searchOperator = operator;
        logsSearch.setOperator(StringUtils.trimWhitespace(operator));
      }
      if (StringUtils.hasText(eventType)) {
        searchEventType = eventType;
        logsSearch.setEventType(StringUtils.trimWhitespace(eventType));
      }
      if (StringUtils.hasText(startLogDate)) {
        logsSearch.setStartLogDate(java.sql.Date.valueOf(startLogDate));
        searchStartLogDate =
            DateUtils.formatDateToString(
                logsSearch.getStartLogDate(), DateUtils.DATE_FORMAT_YYYY_MM_DD);
      }
      if (StringUtils.hasText(endLogDate)) {
        logsSearch.setEndLogDate(java.sql.Date.valueOf(endLogDate));
        searchEndLogDate =
            DateUtils.formatDateToString(
                logsSearch.getEndLogDate(), DateUtils.DATE_FORMAT_YYYY_MM_DD);
      }

      /** 验证请求的属性是否完整----结束 */

      /** 构造Page对象 */
      Page pageInfo = this.getLoginLogManager().searchLoginLogs(logsSearch, this.getUserPageSize());

      /** 设置取的页数 */
      if (page != null) {
        if (page.trim().length() > 0) {
          try {
            pageInfo.setPage(
                (Integer) NumberUtils.parseNumber(StringUtils.trimWhitespace(page), Integer.class));
          } catch (Exception e) {
            /** 记录日志 */
            LogsApplication appLog = new LogsApplication();
            appLog.setOperator(this.getUserSessionInfo().getName());
            appLog.setLogDate(new Date());
            appLog.setEventType("搜索登陆日志异常");
            appLog.setContent(
                "操作员["
                    + this.getUserSessionInfo().getName()
                    + "]"
                    + "搜索登陆日志出现异常,异常信息:["
                    + e.getMessage()
                    + "]!");
            appLog.setPriority(LogsApplication.EXCEPTION);
            appLog.setIpAddress(this.getUserSessionInfo().getIpAddress());
            this.appLogManager.saveOrUpdateAppLog(appLog);

            /** 输出错误信息 */
            logger.error(e.getMessage());
            e.printStackTrace();
          }
        }
      }

      /** 如果是新搜索 */
      if (isNewSearch != null) {
        if (isNewSearch.trim().length() > 0) {
          if (isNewSearch.equalsIgnoreCase("true")) {
            pageInfo.setPage(1);
          }
        }
      }
      /** 获得分页集合 */
      loginLogList = this.getLoginLogManager().searchLoginLogs(logsSearch, pageInfo);

      /** 设置到属性中去 */
      this.getRequest().setAttribute("pageInfo", pageInfo);
      this.getRequest().setAttribute("loginLogList", loginLogList);
      this.getRequest().setAttribute("searchContent", logsSearch);
      this.getRequest().setAttribute("operator", searchOperator);
      this.getRequest().setAttribute("eventType", searchEventType);
      this.getRequest().setAttribute("startLogDate", searchStartLogDate);
      this.getRequest().setAttribute("endLogDate", searchEndLogDate);

      this.getRequest()
          .setAttribute(
              "actionName",
              "searchLoginLogs."
                  + Global.ACTION_EXT
                  + "?operator="
                  + StringUtils.trimWhitespace(searchOperator)
                  + "&eventType="
                  + StringUtils.trimWhitespace(searchEventType)
                  + "&startLogDate="
                  + StringUtils.trimWhitespace(searchStartLogDate)
                  + "&endLogDate="
                  + StringUtils.trimWhitespace(searchEndLogDate));

      /** 记录日志 */
      LogsApplication appLog = new LogsApplication();
      appLog.setOperator(this.getUserSessionInfo().getName());
      appLog.setLogDate(new Date());
      appLog.setEventType("搜索登陆日志");
      appLog.setContent("操作员[" + this.getUserSessionInfo().getName() + "]" + "搜索登陆日志!");
      appLog.setPriority(LogsApplication.NORMAL);
      appLog.setIpAddress(this.getUserSessionInfo().getIpAddress());
      this.appLogManager.saveOrUpdateAppLog(appLog);

      return SUCCESS;
    } catch (Exception e) {

      /** 记录日志 */
      LogsApplication appLog = new LogsApplication();
      appLog.setOperator(this.getUserSessionInfo().getName());
      appLog.setLogDate(new Date());
      appLog.setEventType("搜索登陆日志异常");
      appLog.setContent(
          "操作员["
              + this.getUserSessionInfo().getName()
              + "]"
              + "搜索登陆日志出现异常,异常信息:["
              + e.getMessage()
              + "]!");
      appLog.setPriority(LogsApplication.EXCEPTION);
      appLog.setIpAddress(this.getUserSessionInfo().getIpAddress());
      this.appLogManager.saveOrUpdateAppLog(appLog);

      /** 输出错误信息 */
      logger.error(e.getMessage());
      e.printStackTrace();

      return ERROR;
    }
  }