xgb 3 недель назад
Родитель
Сommit
1fa15417ef

+ 2 - 2
fs-admin/src/main/java/com/fs/his/task/CompanyBalanceTask.java

@@ -152,9 +152,9 @@ public class CompanyBalanceTask {
      * @Author xgb
      * @Date 2025/12/30 10:59
      */
-     private void deleteRedPacketLogBatch() {
+    public void deleteRedPacketLogBatch() {
          companyService.deleteRedPacketLogBatch();
-     }
+    }
 
 
 

+ 2 - 2
fs-service/src/main/java/com/fs/company/service/impl/CompanyServiceImpl.java

@@ -367,7 +367,7 @@ public class CompanyServiceImpl implements ICompanyService
     @Override
     public void deleteRedPacketLogBatch() {
         // 获取三个月前的时间 格式 2025-08-01 00:00:00
-        LocalDateTime threeMonthsAgo = LocalDateTime.now().minusMonths(3).withDayOfMonth(1).with(LocalTime.MIN);
+        LocalDateTime threeMonthsAgo = LocalDateTime.now().minusMonths(3);
         String formattedDate = threeMonthsAgo.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
 
         int totalDeleted = 0;
@@ -400,7 +400,7 @@ public class CompanyServiceImpl implements ICompanyService
 
 
     public static void main(String[] args) {
-        LocalDateTime threeMonthsAgo = LocalDateTime.now().minusMonths(3).withDayOfMonth(1).with(LocalTime.MIN);
+        LocalDateTime threeMonthsAgo = LocalDateTime.now().minusMonths(3);
         String formattedDate = threeMonthsAgo.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
         System.out.println(formattedDate);
     }