01.实体类注解
package com.zhuzher.annotations; import java.lang.annotation.ElementType; /** |
02.实体类主键注解
package com.zhuzher.annotations; import java.lang.annotation.ElementType; /** |
03.实体类需要导出的属性注解
package com.zhuzher.annotations; import java.lang.annotation.ElementType; /** |
04.实体类需要导出的属性排序注解
package com.zhuzher.annotations; import java.lang.annotation.ElementType; /** public String value() default ""; |
0.5需要导出的报表实体类
package com.zhuzher.vxs.po; import com.zhuzher.annotations.ExcelStatisticIdentifier; @ExcelStatisticIdentifier public void setScenevalue(Integer scenevalue) {
public ReportThird(){}; |
06.1.使用action调用工具类并返回文件流给页面自动下载Excel文件
public void downloadScenPlanreport(){ //这里是一个需要导出的数据集合,此处具体内容省略 |
06.2.使用controller调用工具类并返回文件流给页面自动下载Excel文件
1.controller层 @RequestMapping("/report/download") //这里是一个需要导出的数据集合cutPriceReportList,此处具体内容省略 return excelReportService.downloadReport(cutPriceReportList, wxcid, ReportNames.CUTPRICE_DAY_NAME, 0, false, false, null, null,response);
2.service层 package com.zhuzher.excel.service.impl; import java.util.List; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; import com.zhuzher.ErrorCode; //@Service @Override public String getReport_cre |