类 ExcelUtils

java.lang.Object
com.sie.mbm.mom.framework.excel.util.ExcelUtils

public class ExcelUtils extends Object
Excel 工具类
  • 构造器详细资料

    • ExcelUtils

      public ExcelUtils()
  • 方法详细资料

    • write

      public static <T> void write(jakarta.servlet.http.HttpServletResponse response, String filename, String sheetName, Class<T> head, List<T> data) throws IOException
      将列表以 Excel 响应给前端
      类型参数:
      T - 泛型,保证 head 和 data 类型的一致性
      参数:
      response - 响应
      filename - 文件名
      sheetName - Excel sheet 名
      head - Excel head 头
      data - 数据列表哦
      抛出:
      IOException - 写入失败的情况
    • read

      public static <T> List<T> read(org.springframework.web.multipart.MultipartFile file, Class<T> head) throws IOException
      抛出:
      IOException
    • write

      public static <T> List<T> write(org.springframework.web.multipart.MultipartFile file, Class<T> head) throws IOException
      抛出:
      IOException