From 53caa6936cd9b9d32c09dc45cb5a3978a6f837eb Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Mon, 8 Apr 2024 10:12:30 +0800 Subject: [PATCH] =?UTF-8?q?TASK:=E6=90=AD=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/tasks/MiTuExportScheduledTask.java | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/mixi/common/tasks/MiTuExportScheduledTask.java b/src/main/java/com/mixi/common/tasks/MiTuExportScheduledTask.java index 5e32cb8..ab1fb40 100644 --- a/src/main/java/com/mixi/common/tasks/MiTuExportScheduledTask.java +++ b/src/main/java/com/mixi/common/tasks/MiTuExportScheduledTask.java @@ -52,11 +52,11 @@ public class MiTuExportScheduledTask { @PostConstruct public void executeWeeklyHeavyStockReport() { -// customerPurchaseReport(); -// NewJoinVIPReport(); -// weeklySellThrReport(); -// WeeklyHeavyStockReport(); -// QuarterlyProductGroupingReport(); + customerPurchaseReport(); + NewJoinVIPReport(); + weeklySellThrReport(); + WeeklyHeavyStockReport(); + QuarterlyProductGroupingReport(); } /** @@ -95,17 +95,22 @@ public class MiTuExportScheduledTask { case "week": startTime = currentDateTime.with(DayOfWeek.MONDAY).with(LocalTime.MIN); endTime = currentDateTime.with(DayOfWeek.SUNDAY).with(LocalTime.MAX); - exportName = fileName + "_Week_" + currentDateTime.format(DateTimeFormatter.ofPattern("yyyyMMdd")); + exportName = fileName + "_week_" + currentDateTime.format(DateTimeFormatter.ofPattern("yyyyMMdd")); break; case "month": startTime = currentDateTime.withDayOfMonth(1).with(LocalTime.MIN); endTime = currentDateTime.withDayOfMonth(currentDateTime.toLocalDate().lengthOfMonth()).with(LocalTime.MAX); - exportName = fileName + "_Month_" + currentDateTime.format(DateTimeFormatter.ofPattern("yyyyMMdd")); + exportName = fileName + "_month_" + currentDateTime.format(DateTimeFormatter.ofPattern("yyyyMMdd")); break; case "year": startTime = currentDateTime.withDayOfYear(1).with(LocalTime.MIN); endTime = currentDateTime.withDayOfYear(currentDateTime.toLocalDate().lengthOfYear()).with(LocalTime.MAX); - exportName = fileName + "_Year_" + currentDateTime.format(DateTimeFormatter.ofPattern("yyyyMMdd")); + exportName = fileName + "_year_" + currentDateTime.format(DateTimeFormatter.ofPattern("yyyyMMdd")); + break; + case "quarter": + startTime = currentDateTime.withDayOfYear(1).with(LocalTime.MIN); + endTime = currentDateTime.withDayOfYear(currentDateTime.toLocalDate().lengthOfYear()).with(LocalTime.MAX); + exportName = fileName + "_quarter_" + currentDateTime.format(DateTimeFormatter.ofPattern("yyyyMMdd")); break; default: throw new IllegalArgumentException("Invalid period argument: " + period); @@ -153,7 +158,7 @@ public class MiTuExportScheduledTask { @Retryable(value = Exception.class, maxAttempts = 3, backoff = @Backoff(delay = 1000)) // @Scheduled(cron = "0 0 22 L * ?") public void NewJoinVIPReport() { - MiTuExport miTuExport = createMiTuExport("New Join VIP report", "week"); + MiTuExport miTuExport = createMiTuExport("New join vip report", "week"); try { List transactionNewCustomerList = getTransactionNewCustomerList(); String filePath = miTuExport.getExportName()+".xlsx"; @@ -229,7 +234,7 @@ public class MiTuExportScheduledTask { @Retryable(value = Exception.class, maxAttempts = 3, backoff = @Backoff(delay = 1000)) // @Scheduled(cron = "0 0 22 L * ?") public void weeklySellThrReport() { - MiTuExport miTuExport = createMiTuExport("weeklySellThrReport", "week"); + MiTuExport miTuExport = createMiTuExport("Weekly sell thr report", "week"); try { List transactionSummaryList = getTransactionSummaryList(); String filePath = miTuExport.getExportName()+".xlsx"; @@ -330,7 +335,7 @@ public class MiTuExportScheduledTask { @Retryable(value = Exception.class, maxAttempts = 3, backoff = @Backoff(delay = 1000)) // @Scheduled(cron = "0 0 22 L * ?") public void WeeklyHeavyStockReport() { - MiTuExport miTuExport = createMiTuExport("WeeklyHeavyStockReport", "week"); + MiTuExport miTuExport = createMiTuExport("Weekly heavy stock report", "week"); try { List weeklyHeavyStockList = getWeeklyHeavyStockList(); String filePath = miTuExport.getExportName()+".xlsx"; @@ -422,7 +427,7 @@ public class MiTuExportScheduledTask { @Retryable(value = Exception.class, maxAttempts = 3, backoff = @Backoff(delay = 1000)) // @Scheduled(cron = "0 0 22 L * ?") public void QuarterlyProductGroupingReport() { - MiTuExport miTuExport = createMiTuExport("Quarterly Product Grouping Report", "week"); + MiTuExport miTuExport = createMiTuExport("Quarterly product grouping report", "quarter"); try { List QuarterlyProductGroupingList = getQuarterlyProductGroupingList(); String filePath = miTuExport.getExportName()+".xlsx";