Przeglądaj źródła

fix(utils):修正时间范围计算逻辑- 调整 three 类型的开始时间为两天前- 调整 week 类型的开始时间为六天前
- 修改 three、week 和 month 类型的结束时间为明天00:00:00
- 注释掉旧的时间范围结束时间逻辑

fugui001 2 miesięcy temu
rodzic
commit
342da2bed3

+ 4 - 3
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/business/utils/DateTimeRangeUtils.java

@@ -32,11 +32,11 @@ public class DateTimeRangeUtils {
                 break;
 
             case "three":
-                start = today.minusDays(3).atStartOfDay(); // 3天前 00:00:00
+                start = today.minusDays(2).atStartOfDay(); // 3天前 00:00:00
                 break;
 
             case "week":
-                start = today.minusDays(7).atStartOfDay(); // 7天前 00:00:00
+                start = today.minusDays(6).atStartOfDay(); // 7天前 00:00:00
                 break;
 
             case "month":
@@ -64,7 +64,8 @@ public class DateTimeRangeUtils {
 
         return switch (type.toLowerCase()) {
             case "day" -> today.plusDays(1).atStartOfDay(); // 明天 00:00:00
-            case "three", "week", "month" -> today.atStartOfDay(); // 今天 00:00:00
+            /*case "three", "week", "month" -> today.atStartOfDay(); // 今天 00:00:00*/
+            case "three", "week", "month" -> today.plusDays(1).atStartOfDay();  // 明天 00:00:00
             default -> throw new IllegalArgumentException("不支持的时间类型: " + type);
         };
     }