|
|
@ -36,10 +36,10 @@ import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.poi.ss.usermodel.Workbook; |
|
|
|
import org.jetbrains.annotations.NotNull; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.core.io.ClassPathResource; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.io.InputStream; |
|
|
|
import java.net.URLEncoder; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
@ -266,12 +266,12 @@ public class ScreenProjectController { |
|
|
|
} |
|
|
|
|
|
|
|
String templatePath = "excel/project_temp_easy_excel.xlsx"; |
|
|
|
ClassPathResource classPathResource = new ClassPathResource(templatePath); |
|
|
|
String template = classPathResource.getPath(); |
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(templatePath); |
|
|
|
|
|
|
|
|
|
|
|
//String template = this.getClass().getResource(templatePath).getPath();
|
|
|
|
String fileName = "项目统计.xlsx"; |
|
|
|
excelWriter = EasyExcel.write(ExcelUtils.getOutputStream(fileName, response)).withTemplate(template).build(); |
|
|
|
excelWriter = EasyExcel.write(ExcelUtils.getOutputStream(fileName, response)).withTemplate(inputStream).build(); |
|
|
|
WriteSheet writeSheet = EasyExcel.writerSheet().build(); |
|
|
|
excelWriter.fill(mapData, writeSheet); |
|
|
|
|
|
|
|