|
@@ -16,6 +16,7 @@ import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
|
|
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
|
|
|
+import org.jeecgframework.poi.excel.entity.params.ExcelExportEntity;
|
|
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -153,6 +154,20 @@ public class JeecgController<T, S extends IService<T>> {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public static <T> ModelAndView export(String title, Class<T> clazz, List<T> exportList) {
|
|
|
+ ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
|
|
+
|
|
|
+ mv.addObject(NormalExcelConstants.FILE_NAME, title);
|
|
|
+
|
|
|
+ mv.addObject(NormalExcelConstants.CLASS, clazz);
|
|
|
+
|
|
|
+ mv.addObject(NormalExcelConstants.PARAMS, new ExportParams(title, title));
|
|
|
+
|
|
|
+ mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
|
|
|
+ return mv;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
* 通过excel导入数据
|
|
|
*
|