From 326058fa8c52544a795d34a6c9ab69d0532a024c Mon Sep 17 00:00:00 2001 From: hanrenchun Date: Sun, 28 Jan 2024 14:48:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B7=E6=96=B0=E6=89=A7=E6=B3=95=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E4=BB=AA=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../task/MetaImpUserModelInfoTask.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/ssf/mysqloracletest/task/MetaImpUserModelInfoTask.java b/src/main/java/com/ssf/mysqloracletest/task/MetaImpUserModelInfoTask.java index 53655c3..ed404c2 100644 --- a/src/main/java/com/ssf/mysqloracletest/task/MetaImpUserModelInfoTask.java +++ b/src/main/java/com/ssf/mysqloracletest/task/MetaImpUserModelInfoTask.java @@ -18,6 +18,9 @@ import org.springframework.stereotype.Component; import java.math.BigDecimal; import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.Date; import java.util.List; import java.util.concurrent.CountDownLatch; @@ -33,12 +36,17 @@ public class MetaImpUserModelInfoTask { final int oncesCounts = NumKit.checkInt(ConfigParam.oncesCounts) == 0 ? 1000 : NumKit.checkInt(ConfigParam.oncesCounts); + @Scheduled(initialDelay = 100, fixedDelay = 3000) public void transswzdry() { if (!"true".equals(ConfigParam.SwzdrySwitch)) { return; } - + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); + LocalDateTime now = LocalDateTime.now(); + String format = now.format(formatter); + String format1 = now.minusDays(1).format(formatter); try { int countTStrh = swzdryViewService.count(); if (countTStrh > 0) { @@ -47,8 +55,9 @@ public class MetaImpUserModelInfoTask { for (int i = 0; i <= count; i++) { try { - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.between("HDFSSJ",format1,format); List list = swzdryViewService.list(wrapper); for (SwzdryView Info : list) { MetaImpUserModelInfo modelInfo = new MetaImpUserModelInfo();