From d1124d645b177602c8c4b7caf23d0520ddaf2075 Mon Sep 17 00:00:00 2001 From: wr <1754607820@qq.com> Date: Fri, 8 Mar 2024 16:32:31 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=B8=85=E9=99=A4=E6=97=A5=E5=BF=97=EF=BC=8C?= =?UTF-8?q?=E6=9C=88=E4=BB=BD=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/njcn/system/service/impl/AuditServiceImpl.java | 4 +++- pqs-system/system-boot/src/main/resources/bootstrap.yml | 3 +++ 2 files changed, 6 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 e5ec35181..798f025ac 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 @@ -80,6 +80,8 @@ public class AuditServiceImpl extends ServiceImpl implem private final RedisUtil redisUtil; private final UserFeignClient userFeignClient; + @Value("${clear.num}") + private Integer clearHistoryLog; @Override public Page getAuditLog(AuditParam auditParam) { List auditLogVOS = new ArrayList<>(); @@ -318,7 +320,7 @@ public class AuditServiceImpl extends ServiceImpl implem @Override public void clearHistoryLog() { LocalDate nowDate = LocalDate.now(); - LocalDate agoDate = nowDate.minusMonths(6).with(TemporalAdjusters.firstDayOfMonth()); + LocalDate agoDate = nowDate.minusMonths(clearHistoryLog).with(TemporalAdjusters.firstDayOfMonth()); String date = agoDate.format(DateTimeFormatter.ISO_LOCAL_DATE); QueryWrapper queryWrapper = new QueryWrapper<>(); diff --git a/pqs-system/system-boot/src/main/resources/bootstrap.yml b/pqs-system/system-boot/src/main/resources/bootstrap.yml index 71af74144..86061e74f 100644 --- a/pqs-system/system-boot/src/main/resources/bootstrap.yml +++ b/pqs-system/system-boot/src/main/resources/bootstrap.yml @@ -59,5 +59,8 @@ runTake: #等待时间(毫秒) delayTime: 25000 +#清除日志月份 +clear: + num: 1 mqtt: client-id: @artifactId@${random.value}