From ae2a0d820f11f947d7a878ae59d28124c340c8b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=B6=85?= <973677575@qq.com> Date: Mon, 25 Jul 2022 16:12:29 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=96=87=E4=BB=B6=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/njcn/system/service/impl/AuditServiceImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/AuditServiceImpl.java b/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/AuditServiceImpl.java index 63c886d2d..873b625cc 100644 --- a/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/AuditServiceImpl.java +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/AuditServiceImpl.java @@ -39,6 +39,7 @@ import java.io.FileInputStream; import java.io.InputStream; import java.io.OutputStream; import java.time.LocalDate; +import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.time.temporal.TemporalAdjusters; import java.util.*; @@ -128,9 +129,12 @@ public class AuditServiceImpl extends ServiceImpl implem queryWrapper.ge("sys_user_log.update_time",date); List excelList = auditMapper.queryExportUser(queryWrapper); + LocalDateTime nowDateTime = LocalDateTime.now(); + String nowTime = DateTimeFormatter.ofPattern("yyyy-MM-dd HH-mm-ss").format(nowDateTime); + File filePath = new File(generalInfo.getBusinessTempPath()); filePath.mkdirs(); - File file = new File(filePath.getPath() + File.separator + nowDate +" sys_user_log.xlsx"); + File file = new File(filePath.getPath() + File.separator + nowTime +" sys_user_log.xlsx"); ExcelUtil.exportExcelWithTargetFile(file, UserLogExcel.class, excelList); //备份为txt