public String exportExcel(String rootDir, ReaderView readerView) {
    List<Reader> readers = new ArrayList<Reader>();
    WritableWorkbook ww;
    String fileName = "upload" + File.separator + "readers.xls";
    File file = new File(rootDir + fileName);
    try {
      readers = readerDao.selectReaders(readerView);
      ww = Workbook.createWorkbook(file);
      WritableSheet ws = ww.createSheet("读者信息", 0);
      ExcelOperate.addLabelToSheet(ws, 0, 0, 9, 0, "读者信息", ExcelStyle.getHeaderStyle());
      ExcelOperate.addLabelToSheet(ws, 0, 1, "借阅证号", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 1, 1, "密码", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 2, 1, "条形码", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 3, 1, "读者姓名", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 4, 1, "出生日期", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 5, 1, "姓别", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 6, 1, "邮箱", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 7, 1, "联系电话", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 8, 1, "余额", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 9, 1, "拼音", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 10, 1, "办证日期", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 11, 1, "有效日期", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 12, 1, "当前借阅数量", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 13, 1, "累计借阅数量", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 14, 1, "读者描述", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 15, 1, "读者单位", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 16, 1, "读者类别", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 17, 1, "证件类别", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 18, 1, "借阅证状态", ExcelStyle.getTitleStyle());

      int count = 2;
      for (Reader reader : readers) {
        ExcelOperate.addLabelToSheet(
            ws, 0, count, reader.getCardNo(), ExcelStyle.getContentStyle());
        ExcelOperate.addLabelToSheet(
            ws, 1, count, reader.getPassword(), ExcelStyle.getContentStyle());
        ExcelOperate.addLabelToSheet(
            ws, 2, count, reader.getBarCode(), ExcelStyle.getContentStyle());
        ExcelOperate.addLabelToSheet(
            ws, 3, count, reader.getReaderName(), ExcelStyle.getContentStyle());

        String birthday = DateFormatUtil.format(reader.getBirthday(), "yyyy-MM-dd");
        ExcelOperate.addLabelToSheet(
            ws, 4, count, DateFormatUtil.convertToDate(birthday), ExcelStyle.getDateStyle());
        //				ExcelOperate.addLabelToSheet(ws, 4, count,reader.getBirthday(),
        // ExcelStyle.getContentStyle());
        ExcelOperate.addLabelToSheet(ws, 5, count, reader.getSex(), ExcelStyle.getContentStyle());
        ExcelOperate.addLabelToSheet(ws, 6, count, reader.getEmail(), ExcelStyle.getContentStyle());
        ExcelOperate.addLabelToSheet(
            ws, 7, count, reader.getContactTel(), ExcelStyle.getContentStyle());
        ExcelOperate.addLabelToSheet(
            ws, 8, count, reader.getLeftMoney(), ExcelStyle.getContentStyle());
        ExcelOperate.addLabelToSheet(ws, 9, count, reader.getSpell(), ExcelStyle.getContentStyle());

        String entyDate = DateFormatUtil.format(reader.getEntyDate(), "yyyy-MM-dd");
        ExcelOperate.addLabelToSheet(
            ws, 10, count, DateFormatUtil.convertToDate(entyDate), ExcelStyle.getDateStyle());
        //				ExcelOperate.addLabelToSheet(ws, 10, count,reader.getEntyDate(),
        // ExcelStyle.getContentStyle());

        String effectiveDate = DateFormatUtil.format(reader.getEffectiveDate(), "yyyy-MM-dd");
        ExcelOperate.addLabelToSheet(
            ws, 11, count, DateFormatUtil.convertToDate(effectiveDate), ExcelStyle.getDateStyle());
        //				ExcelOperate.addLabelToSheet(ws, 11,
        // count,reader.getEffectiveDate(),ExcelStyle.getContentStyle());
        ExcelOperate.addLabelToSheet(
            ws, 12, count, reader.getBorrowedQuantiy(), ExcelStyle.getContentStyle());
        ExcelOperate.addLabelToSheet(
            ws, 13, count, reader.getTotalBQuantity(), ExcelStyle.getContentStyle());
        ExcelOperate.addLabelToSheet(
            ws, 14, count, reader.getReaderDesc(), ExcelStyle.getContentStyle());
        ExcelOperate.addLabelToSheet(
            ws, 15, count, reader.getReaderUnits().getUnitName(), ExcelStyle.getContentStyle());
        ExcelOperate.addLabelToSheet(
            ws,
            16,
            count,
            reader.getReaderType().getReaderCateName(),
            ExcelStyle.getContentStyle());
        ExcelOperate.addLabelToSheet(
            ws, 17, count, reader.getCertificate().getItemName(), ExcelStyle.getContentStyle());
        ExcelOperate.addLabelToSheet(
            ws, 18, count, reader.getCardState().getItemName(), ExcelStyle.getContentStyle());
        count++;
      }

      for (int i = 0; i < 20; i++) {
        ws.setColumnView(i, 16);
      }
      ws.setRowView(0, 20);
      ww.write();
      ww.close();
      System.out.println("写入excel成功!");
    } catch (Exception e) {
      System.out.println("写入excel失败!");
      e.printStackTrace();
    }
    return fileName;
  }
  public String exportExcel(String rootDir, SysLogView sysLogView) {
    List<SysLog> sysLogs = new ArrayList<SysLog>();
    WritableWorkbook ww;
    String fileName = "upload" + File.separator + "sysLogs.xls";
    File file = new File(rootDir + fileName);
    try {
      sysLogs = sysLogDao.selectSysLogs(sysLogView);
      ww = Workbook.createWorkbook(file);
      WritableSheet ws = ww.createSheet("日志信息", 0);
      ExcelOperate.addLabelToSheet(ws, 0, 0, 9, 0, "日志信息", ExcelStyle.getHeaderStyle());
      ExcelOperate.addLabelToSheet(ws, 0, 1, "操作类型", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 1, 1, "事件", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 2, 1, "操作人", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 3, 1, "日期", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 4, 1, "ip地址", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 5, 1, "业务描述", ExcelStyle.getTitleStyle());

      int count = 2;
      for (SysLog sysLog : sysLogs) {
        ExcelOperate.addLabelToSheet(
            ws, 0, count, sysLog.getOperateType(), ExcelStyle.getContentStyle());
        ExcelOperate.addLabelToSheet(
            ws, 1, count, sysLog.getFuncName(), ExcelStyle.getContentStyle());
        ExcelOperate.addLabelToSheet(
            ws, 2, count, sysLog.getOperator(), ExcelStyle.getContentStyle());
        String operateDate = DateFormatUtil.format(sysLog.getOperateDate(), "yyyy-MM-dd");
        ExcelOperate.addLabelToSheet(
            ws, 3, count, DateFormatUtil.convertToDate(operateDate), ExcelStyle.getDateStyle());
        ExcelOperate.addLabelToSheet(
            ws, 4, count, sysLog.getOperateIPAddress(), ExcelStyle.getContentStyle());
        ExcelOperate.addLabelToSheet(
            ws, 5, count, sysLog.getOperateDescription(), ExcelStyle.getContentStyle());
        count++;
      }

      for (int i = 0; i < 6; i++) {
        ws.setColumnView(i, 16);
      }
      ws.setRowView(0, 20);
      ww.write();
      ww.close();
      System.out.println("写入excel成功!");
    } catch (Exception e) {
      System.out.println("写入excel失败!");
      e.printStackTrace();
    }
    return fileName;
  }
  public String exportReaderBorrowedExcel(String rootDir, ReaderView readerView) {
    List<Reader> readers = new ArrayList<Reader>();
    WritableWorkbook ww;
    String fileName = "upload" + File.separator + "readerBorrowedsStatics.xls";
    File file = new File(rootDir + fileName);
    try {
      readers = readerDao.selectReaders(readerView);
      ww = Workbook.createWorkbook(file);
      WritableSheet ws = ww.createSheet("读者借阅信息统计", 0);
      ExcelOperate.addLabelToSheet(ws, 0, 0, 9, 0, "读者借阅信息统计", ExcelStyle.getHeaderStyle());
      ExcelOperate.addLabelToSheet(ws, 0, 1, "借阅证号", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 1, 1, "条形码", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 2, 1, "读者姓名", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 3, 1, "姓别", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 4, 1, "当前借阅数量", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 5, 1, "累计借阅数量", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 6, 1, "读者单位", ExcelStyle.getTitleStyle());
      ExcelOperate.addLabelToSheet(ws, 7, 1, "读者类别", ExcelStyle.getTitleStyle());

      int count = 2;
      for (Reader reader : readers) {
        ExcelOperate.addLabelToSheet(
            ws, 0, count, reader.getCardNo(), ExcelStyle.getContentStyle());
        ExcelOperate.addLabelToSheet(
            ws, 1, count, reader.getBarCode(), ExcelStyle.getContentStyle());
        ExcelOperate.addLabelToSheet(
            ws, 2, count, reader.getReaderName(), ExcelStyle.getContentStyle());
        ExcelOperate.addLabelToSheet(ws, 3, count, reader.getSex(), ExcelStyle.getContentStyle());
        ExcelOperate.addLabelToSheet(
            ws, 4, count, reader.getBorrowedQuantiy(), ExcelStyle.getContentStyle());
        ExcelOperate.addLabelToSheet(
            ws, 5, count, reader.getTotalBQuantity(), ExcelStyle.getContentStyle());
        ExcelOperate.addLabelToSheet(
            ws, 6, count, reader.getReaderUnits().getUnitName(), ExcelStyle.getContentStyle());
        ExcelOperate.addLabelToSheet(
            ws, 7, count, reader.getReaderType().getReaderCateName(), ExcelStyle.getContentStyle());
        count++;
      }

      for (int i = 0; i < 8; i++) {
        ws.setColumnView(i, 16);
      }
      ws.setRowView(0, 20);
      ww.write();
      ww.close();
      System.out.println("写入excel成功!");
    } catch (Exception e) {
      System.out.println("写入excel失败!");
      e.printStackTrace();
    }
    return fileName;
  }