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 @PostConstruct
public void executeWeeklyHeavyStockReport() { public void executeWeeklyHeavyStockReport() {
// customerPurchaseReport(); customerPurchaseReport();
// NewJoinVIPReport(); NewJoinVIPReport();
// weeklySellThrReport(); weeklySellThrReport();
// WeeklyHeavyStockReport(); WeeklyHeavyStockReport();
// QuarterlyProductGroupingReport(); QuarterlyProductGroupingReport();
} }
/** /**
@@ -95,17 +95,22 @@ public class MiTuExportScheduledTask {
case "week": case "week":
startTime = currentDateTime.with(DayOfWeek.MONDAY).with(LocalTime.MIN); startTime = currentDateTime.with(DayOfWeek.MONDAY).with(LocalTime.MIN);
endTime = currentDateTime.with(DayOfWeek.SUNDAY).with(LocalTime.MAX); 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; break;
case "month": case "month":
startTime = currentDateTime.withDayOfMonth(1).with(LocalTime.MIN); startTime = currentDateTime.withDayOfMonth(1).with(LocalTime.MIN);
endTime = currentDateTime.withDayOfMonth(currentDateTime.toLocalDate().lengthOfMonth()).with(LocalTime.MAX); 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; break;
case "year": case "year":
startTime = currentDateTime.withDayOfYear(1).with(LocalTime.MIN); startTime = currentDateTime.withDayOfYear(1).with(LocalTime.MIN);
endTime = currentDateTime.withDayOfYear(currentDateTime.toLocalDate().lengthOfYear()).with(LocalTime.MAX); 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; break;
default: default:
throw new IllegalArgumentException("Invalid period argument: " + period); throw new IllegalArgumentException("Invalid period argument: " + period);
@@ -153,7 +158,7 @@ public class MiTuExportScheduledTask {
@Retryable(value = Exception.class, maxAttempts = 3, backoff = @Backoff(delay = 1000)) @Retryable(value = Exception.class, maxAttempts = 3, backoff = @Backoff(delay = 1000))
// @Scheduled(cron = "0 0 22 L * ?") // @Scheduled(cron = "0 0 22 L * ?")
public void NewJoinVIPReport() { public void NewJoinVIPReport() {
MiTuExport miTuExport = createMiTuExport("New Join VIP report", "week"); MiTuExport miTuExport = createMiTuExport("New join vip report", "week");
try { try {
List<TransactionNewCustomer> transactionNewCustomerList = getTransactionNewCustomerList(); List<TransactionNewCustomer> transactionNewCustomerList = getTransactionNewCustomerList();
String filePath = miTuExport.getExportName()+".xlsx"; String filePath = miTuExport.getExportName()+".xlsx";
@@ -229,7 +234,7 @@ public class MiTuExportScheduledTask {
@Retryable(value = Exception.class, maxAttempts = 3, backoff = @Backoff(delay = 1000)) @Retryable(value = Exception.class, maxAttempts = 3, backoff = @Backoff(delay = 1000))
// @Scheduled(cron = "0 0 22 L * ?") // @Scheduled(cron = "0 0 22 L * ?")
public void weeklySellThrReport() { public void weeklySellThrReport() {
MiTuExport miTuExport = createMiTuExport("weeklySellThrReport", "week"); MiTuExport miTuExport = createMiTuExport("Weekly sell thr report", "week");
try { try {
List<TransactionSummary> transactionSummaryList = getTransactionSummaryList(); List<TransactionSummary> transactionSummaryList = getTransactionSummaryList();
String filePath = miTuExport.getExportName()+".xlsx"; String filePath = miTuExport.getExportName()+".xlsx";
@@ -330,7 +335,7 @@ public class MiTuExportScheduledTask {
@Retryable(value = Exception.class, maxAttempts = 3, backoff = @Backoff(delay = 1000)) @Retryable(value = Exception.class, maxAttempts = 3, backoff = @Backoff(delay = 1000))
// @Scheduled(cron = "0 0 22 L * ?") // @Scheduled(cron = "0 0 22 L * ?")
public void WeeklyHeavyStockReport() { public void WeeklyHeavyStockReport() {
MiTuExport miTuExport = createMiTuExport("WeeklyHeavyStockReport", "week"); MiTuExport miTuExport = createMiTuExport("Weekly heavy stock report", "week");
try { try {
List<WeeklyHeavyStock> weeklyHeavyStockList = getWeeklyHeavyStockList(); List<WeeklyHeavyStock> weeklyHeavyStockList = getWeeklyHeavyStockList();
String filePath = miTuExport.getExportName()+".xlsx"; String filePath = miTuExport.getExportName()+".xlsx";
@@ -422,7 +427,7 @@ public class MiTuExportScheduledTask {
@Retryable(value = Exception.class, maxAttempts = 3, backoff = @Backoff(delay = 1000)) @Retryable(value = Exception.class, maxAttempts = 3, backoff = @Backoff(delay = 1000))
// @Scheduled(cron = "0 0 22 L * ?") // @Scheduled(cron = "0 0 22 L * ?")
public void QuarterlyProductGroupingReport() { public void QuarterlyProductGroupingReport() {
MiTuExport miTuExport = createMiTuExport("Quarterly Product Grouping Report", "week"); MiTuExport miTuExport = createMiTuExport("Quarterly product grouping report", "quarter");
try { try {
List<WeeklyHeavyStock> QuarterlyProductGroupingList = getQuarterlyProductGroupingList(); List<WeeklyHeavyStock> QuarterlyProductGroupingList = getQuarterlyProductGroupingList();
String filePath = miTuExport.getExportName()+".xlsx"; String filePath = miTuExport.getExportName()+".xlsx";