Browse Source

导入下载错误数据excelURl修改

master
chenfang 2 years ago
parent
commit
8fa1e083b3
  1. 2
      win-framework/win-spring-boot-starter-excel/src/main/java/com/win/framework/excel/core/util/ExcelUtils.java
  2. 2
      win-framework/win-spring-boot-starter-web/src/main/java/com/win/framework/web/constant/Constant.java

2
win-framework/win-spring-boot-starter-excel/src/main/java/com/win/framework/excel/core/util/ExcelUtils.java

@ -102,7 +102,7 @@ public class ExcelUtils {
*/
public static <T> String writeLocalFile(String fileName, String sheetName, List<T> dataList) throws FileNotFoundException {
WebProperties webProperties = SpringUtil.getBean(WebProperties.class);
fileName = fileName + LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8")) + ".xlsx";
fileName = fileName + LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8"));
File file = ResourceUtils.getFile( webProperties.getProfile() + "/" + fileName);
EasyExcel.write(file).sheet(sheetName).doWrite(dataList);
return Constant.RESOURCE_PREFIX + fileName;

2
win-framework/win-spring-boot-starter-web/src/main/java/com/win/framework/web/constant/Constant.java

@ -5,6 +5,6 @@ public class Constant {
/**
* 资源映射路径 前缀
*/
public static final String RESOURCE_PREFIX = "/profile";
public static final String RESOURCE_PREFIX = "/profile/";
}

Loading…
Cancel
Save