类 BaseExcelFileController

java.lang.Object
com.diboot.core.controller.BaseController
com.diboot.file.controller.BaseExcelFileController

public abstract class BaseExcelFileController extends com.diboot.core.controller.BaseController
Excel导入基类Controller
版本:
2.0
作者:
Mazc@dibo.ltd
  • 字段详细资料

  • 构造器详细资料

    • BaseExcelFileController

      public BaseExcelFileController()
  • 方法详细资料

    • getExcelDataListener

      protected abstract ReadExcelListener<?> getExcelDataListener()
      获取对应的ExcelDataListener
    • excelPreview

      public com.diboot.core.vo.JsonResult<Map<String,Object>> excelPreview(org.springframework.web.multipart.MultipartFile file, Map<String,Object> params) throws Exception
      excel数据预览
      参数:
      file - excel文件
      params - 请求参数
      返回:
      抛出:
      Exception
    • excelPreviewSave

      public com.diboot.core.vo.JsonResult<Map<String,Object>> excelPreviewSave(Map<String,Object> params) throws Exception
      预览后提交保存
      参数:
      params - 请求参数;必需包含预览返回的文件uuid
      返回:
      抛出:
      Exception
    • uploadExcelFile

      public com.diboot.core.vo.JsonResult<Map<String,Object>> uploadExcelFile(org.springframework.web.multipart.MultipartFile file, Map<String,Object> params) throws Exception
      直接上传excel
      参数:
      file - excel文件
      params - 请求参数
      返回:
      抛出:
      Exception
    • importData

      private com.diboot.core.vo.JsonResult<Map<String,Object>> importData(FileRecord uploadFile, InputStream inputStream, Map<String,Object> params) throws Exception
      导入数据
      参数:
      uploadFile - 上传文件对象
      inputStream - excel文件输入流
      params - 请求参数
      返回:
      抛出:
      Exception
    • readExcelFile

      protected <T extends BaseExcelModel> void readExcelFile(InputStream inputStream, ReadExcelListener<T> listener) throws Exception
      读取excel方法
      参数:
      inputStream -
      listener -
      抛出:
      Exception
    • checkIsExcel

      protected void checkIsExcel(org.springframework.web.multipart.MultipartFile file)
      检查是否为合法的excel文件
      参数:
      file -
      抛出:
      Exception