Преглед на файлове

导出文档时间转换1

jichaobo преди 3 години
родител
ревизия
d9f681ddf1
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      fiveep-service/src/main/java/com/bizmatics/service/impl/WcBlackoutPlanServiceImpl.java

+ 2 - 1
fiveep-service/src/main/java/com/bizmatics/service/impl/WcBlackoutPlanServiceImpl.java

@@ -100,6 +100,7 @@ public class WcBlackoutPlanServiceImpl extends AbstractCrudService<WcBlackoutPla
 
     @Override
     public String outagePlanListExport(String startTime, String endTime, Integer type) {
+        DateFormat dFormat = new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒");
         Workbook workbook = null;
         File file = null;
         try {
@@ -111,7 +112,7 @@ public class WcBlackoutPlanServiceImpl extends AbstractCrudService<WcBlackoutPla
                         return new ArrayList<>(BeanMapperUtils.mapList(plannedOutageList, WcBlackoutPlanOneVo.class, WcBlackoutPlanOneExportVo.class));
                     }, null);
             if (null != workbook) {
-                file = FileUtils.getFile(GlobalUtils.getTempBaseDir(), String.format("%s-%s.xlsx", "停电计划列表", System.currentTimeMillis() + ""));
+                file = FileUtils.getFile(GlobalUtils.getTempBaseDir(), String.format("%s-%s.xlsx", "停电计划列表", dFormat.format(System.currentTimeMillis()) + ""));
                 FileUtils.createFile(file.getAbsolutePath());
                 FileOutputStream allListingFileOutputStream = new FileOutputStream(file);
                 workbook.write(allListingFileOutputStream);