资料维护部分开发
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
package com.jero.util;
|
||||
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 金额工具类
|
||||
*
|
||||
@@ -7,6 +16,9 @@ package com.jero.util;
|
||||
* @date 2021-08-31 15:28
|
||||
*/
|
||||
public class AmountUtil {
|
||||
|
||||
@Value("${jero.path.upload}")
|
||||
private String upLoadPath;
|
||||
/**
|
||||
* 计算到账状态
|
||||
*
|
||||
@@ -30,4 +42,24 @@ public class AmountUtil {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**自定义导出
|
||||
* 导出excel
|
||||
*传入 对象的list集合 对象的class对象 excel名称
|
||||
* @param
|
||||
*/
|
||||
protected ModelAndView exportListXls(List<T> object, Class<T> clazz, String title) {
|
||||
// Step.3 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, title); //此处设置的filename无效 ,前端会重更新设置一下
|
||||
mv.addObject(NormalExcelConstants.CLASS, clazz);
|
||||
//update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
|
||||
ExportParams exportParams=new ExportParams(title, title);
|
||||
exportParams.setImageBasePath(upLoadPath);
|
||||
//update-end--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
|
||||
mv.addObject(NormalExcelConstants.PARAMS,exportParams);
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, null);
|
||||
return mv;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user