TASK:搭配

This commit is contained in:
shahaibo
2024-04-08 10:12:30 +08:00
parent 94110ac415
commit 53caa6936c

View File

@@ -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<TransactionNewCustomer> 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<TransactionSummary> 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<WeeklyHeavyStock> 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<WeeklyHeavyStock> QuarterlyProductGroupingList = getQuarterlyProductGroupingList();
String filePath = miTuExport.getExportName()+".xlsx";