public abstract class BaseExcelImportController
extends com.diboot.framework.controller.BaseCrudController
| 限定符和类型 | 字段和说明 |
|---|---|
protected com.diboot.framework.service.BaseFileService |
baseFileService |
private static Map<String,List<ExcelColumn>> |
excelColumnMap
获取Excel列的定义
|
protected ExcelColumnService |
excelColumnService |
protected com.diboot.framework.service.ExcelImportRecordService |
excelImportRecordService |
private static org.slf4j.Logger |
logger |
protected static String |
PARAM_IMPORT_UUID |
| 构造器和说明 |
|---|
BaseExcelImportController() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected String |
afterCreated(javax.servlet.http.HttpServletRequest request,
List<String[]> dataList) |
protected void |
attachMore4View(Object id,
com.diboot.framework.model.BaseModel model,
org.springframework.ui.ModelMap modelMap) |
protected <T extends com.diboot.framework.model.BaseModel> |
convert2ModelList(List<String[]> dataList,
boolean isPreview)
将Excel数据转化为ModelList
|
protected void |
enhanceModel(List<? extends com.diboot.framework.model.BaseModel> modelList)
附加其他属性到model
|
protected List<String[]> |
extract2List(String excelFilePath)
提取excel内容到List
|
protected List<String> |
extractInvalidList(List<String> inputList,
Map<String,Object> realMap)
获取未能匹配的值,用于transform
|
protected abstract com.diboot.framework.service.BaseService |
getBusinessService()
获取业务的service
|
private List<ExcelColumn> |
getExcelColumnList(String modelClass)
加载表格列定义
|
protected abstract Class<?> |
getModelClass()
获取Model类
|
protected com.diboot.framework.service.BaseService |
getService() |
String |
listPaging(int pageIndex,
javax.servlet.http.HttpServletRequest request,
org.springframework.ui.ModelMap modelMap)
列表页处理
|
String |
preview(javax.servlet.http.HttpServletRequest request,
org.springframework.ui.ModelMap modelMap)
预览处理
|
String |
previewSave(javax.servlet.http.HttpServletRequest request,
org.springframework.ui.ModelMap modelMap)
预览保存
|
protected List<String[]> |
saveExcelFiles(javax.servlet.http.HttpServletRequest request,
com.diboot.framework.model.BaseModel model,
String... fileInputName)
保存上传文件
|
protected List<String[]> |
transform(List<ExcelColumn> excelColumns,
List<String[]> dataList,
boolean isPreview)
关联关系转换,如导入 员工姓名 转为 员工id
|
String |
upload(javax.servlet.http.HttpServletRequest request,
org.springframework.ui.ModelMap modelMap)
直接上传
|
afterCreated, afterDeleted, afterUpdated, attachMore, beforeCreate, beforeDelete, beforeUpdate, create, createPage, delete, getCustomPageSize, getRedirectUrlWithQueryParams, home, index, list, update, updatePage, viewPageaddAdditionalPromptMsg, addFailResultMsg, addIntoSession, addResultMsg, addSuccessResultMsg, appendAdditionalCriteria, bindCriteria, bindError, bindErrors, bindResultMsg, buildJsonError, buildPagination, buildQueryCriteria, criteria2paramString, dumpParams, getBindingError, getBoolean, getBoolean, getDouble, getDouble, getFromSession, getInteger, getInteger, getLong, getLong, getLongList, getParamsMap, getString, getString, getStringArray, getStringList, getUrlPrefix, getViewPrefix, isContinue, newCriteria, redirectTo, viewprivate static final org.slf4j.Logger logger
@Autowired protected com.diboot.framework.service.BaseFileService baseFileService
@Autowired protected ExcelColumnService excelColumnService
@Autowired protected com.diboot.framework.service.ExcelImportRecordService excelImportRecordService
private static Map<String,List<ExcelColumn>> excelColumnMap
protected abstract Class<?> getModelClass()
protected abstract com.diboot.framework.service.BaseService getBusinessService()
public String listPaging(int pageIndex, javax.servlet.http.HttpServletRequest request, org.springframework.ui.ModelMap modelMap) throws Exception
listPaging 在类中 com.diboot.framework.controller.BaseCrudControllerpageIndex - request - modelMap - Exceptionpublic String preview(javax.servlet.http.HttpServletRequest request, org.springframework.ui.ModelMap modelMap) throws Exception
request - modelMap - Exceptionpublic String previewSave(javax.servlet.http.HttpServletRequest request, org.springframework.ui.ModelMap modelMap) throws Exception
request - modelMap - Exceptionpublic String upload(javax.servlet.http.HttpServletRequest request, org.springframework.ui.ModelMap modelMap) throws Exception
request - modelMap - Exceptionprotected void enhanceModel(List<? extends com.diboot.framework.model.BaseModel> modelList) throws Exception
modelList - Exceptionprotected String afterCreated(javax.servlet.http.HttpServletRequest request, List<String[]> dataList) throws Exception
Exceptionprotected void attachMore4View(Object id, com.diboot.framework.model.BaseModel model, org.springframework.ui.ModelMap modelMap) throws Exception
attachMore4View 在类中 com.diboot.framework.controller.BaseCrudControllerExceptionprivate List<ExcelColumn> getExcelColumnList(String modelClass) throws Exception
Exceptionprotected List<String[]> extract2List(String excelFilePath) throws Exception
excelFilePath - Exceptionprotected List<String[]> transform(List<ExcelColumn> excelColumns, List<String[]> dataList, boolean isPreview) throws Exception
excelColumns - dataList - Exceptionprotected <T extends com.diboot.framework.model.BaseModel> List<T> convert2ModelList(List<String[]> dataList, boolean isPreview) throws Exception
dataList - Exceptionprotected List<String[]> saveExcelFiles(javax.servlet.http.HttpServletRequest request, com.diboot.framework.model.BaseModel model, String... fileInputName) throws Exception
request - model - fileInputName - Exceptionprotected List<String> extractInvalidList(List<String> inputList, Map<String,Object> realMap)
inputList - realMap - protected com.diboot.framework.service.BaseService getService()
getService 在类中 com.diboot.framework.controller.BaseCrudControllerCopyright © 2018. All rights reserved.