Exemple #1
0
 public InputStream exportDepartment(QueryObj queryObj) {
   try {
     for (String key : queryObj.getQueryObjects()) {
       String value =
           new String(((String) queryObj.getQueryObject(key)).getBytes("ISO-8859-1"), "UTF-8");
       queryObj.setQueryObject(key, value);
     }
     Collection<Department> data = departmentDao.findBy(queryObj);
     TableDefine table = new TableDefine(getMessage("department"));
     table.addColumn("empId", getMessage("department.empId"), 0);
     table.addColumn("empCode", getMessage("department.empCode"), 0);
     table.addColumn("empDutyName", getMessage("department.empDutyName"), 0);
     table.addColumn("empTypeName", getMessage("department.empTypeName"), 0);
     table.addColumn("empName", getMessage("department.empName"), 0);
     table.addColumn("empGender", getMessage("department.empGender"), 0);
     table.addColumn("empEmail", getMessage("department.empEmail"), 0);
     table.addColumn("empMobile", getMessage("department.empMobile"), 0);
     table.addColumn("empOfficephone", getMessage("department.empOfficephone"), 0);
     table.addColumn("empDesc", getMessage("department.empDesc"), 0);
     table.addColumn("deptCode", getMessage("department.deptCode"), 0);
     return new ExcelExport(table).export(data);
   } catch (Exception e) {
     throw new RuntimeException(e);
   }
 }
  /**
   * 根据用户ID查找最近访问
   *
   * @param userId,count
   * @return
   */
  public List<LinkRecently> findRecently(final Long userId, final int count) {
    QueryObj queryObj = new QueryObj(0, count, "modifyDate", false);
    queryObj.setQueryObject("userId", userId);
    Collection list = this.findBy(queryObj);
    List<LinkRecently> res = new ArrayList();
    res.addAll(list);

    return res;
  }