|
@@ -53,7 +53,7 @@ public class MonthStatisticsJob implements Job {
|
|
|
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
|
|
|
LocalDate yesterDate = LocalDate.now().minusMonths(1); // 当前 00:00:00 执行定时任务 减一天获取昨天的日期
|
|
|
- String lastmonth = yesterDate.format(formatter); // 上个月的月份
|
|
|
+ String lastmonth = yesterDate.atStartOfDay().format(formatter); // 上个月的月份
|
|
|
//String lastmonth = "2024-06"; // 测试模拟上个月的月份
|
|
|
String year = lastmonth.split("-")[0];
|
|
|
|