Jelajahi Sumber

1、修改导出excel

zhoux 1 tahun lalu
induk
melakukan
32c12a6d25
1 mengubah file dengan 3 tambahan dan 2 penghapusan
  1. 3 2
      src/main/java/com/dk/common/util/ExcelPoiUtils.java

+ 3 - 2
src/main/java/com/dk/common/util/ExcelPoiUtils.java

@@ -125,8 +125,9 @@ public class ExcelPoiUtils {
 //        bytes = os.toByteArray();
         // 判断路径是否存在  类型 + 年月+ 日期
         LocalDate currentDate = LocalDate.now();
-        String dirPath = ConfigStatic.getExcelFolder() + "/" + title + "/" + "/" + currentDate.getYear()
+        String returnPath = title + "/" + currentDate.getYear()
                 + "-" + currentDate.getMonthValue() + "/" + currentDate.getDayOfMonth();
+        String dirPath = ConfigStatic.getExcelFolder() + "/" + returnPath;
         File dir = new File(dirPath);
         if (!dir.exists() && !dir.isDirectory()) {
             dir.mkdirs();
@@ -143,7 +144,7 @@ public class ExcelPoiUtils {
             e.printStackTrace();
             return "";
         }
-        return filename;
+        return returnPath + "/" + filename;
     }
 
     /**