فهرست منبع

客户提交一版本

xujunwei 2 سال پیش
والد
کامیت
e639fe8443

+ 10 - 0
framework-boot/src/main/java/com/mrxu/framework/boot/entity/PageParam.java

@@ -8,6 +8,16 @@ import io.swagger.annotations.ApiModelProperty;
 
 public class PageParam<T> extends Page<T> {
 
+    public static final String timeRangeTypeToday = "today";
+    public static final String timeRangeTypeYesterday = "yesterday";
+    public static final String timeRangeTypeTomorrow = "tomorrow";
+    public static final String timeRangeTypeAfterTomorrow = "afterTomorrow";
+    public static final String timeRangeTypeThisWeek = "thisWeek";
+    public static final String timeRangeTypeLastWeek = "lastWeek";
+    public static final String timeRangeTypeThisMonth = "thisMonth";
+    public static final String timeRangeTypeLastMonth = "lastMonth";
+
+
     @ApiModelProperty(value = "租户id")
     private String tenantId;
 

+ 34 - 4
framework-common/src/main/java/com/mrxu/framework/common/util/DateFunc.java

@@ -71,6 +71,20 @@ public class DateFunc {
         return new SimpleDateFormat("yyyy-MM-dd").format(time);
     }
 
+    public static String getTomorrow() {
+        Calendar cal = Calendar.getInstance();
+        cal.add(Calendar.DATE, 1);
+        Date time = cal.getTime();
+        return new SimpleDateFormat("yyyy-MM-dd").format(time);
+    }
+
+    public static String getAfterTomorrow() {
+        Calendar cal = Calendar.getInstance();
+        cal.add(Calendar.DATE, 2);
+        Date time = cal.getTime();
+        return new SimpleDateFormat("yyyy-MM-dd").format(time);
+    }
+
     public static String getYesterdayStart() {
         return getYesterday()+" 00:00:00";
     }
@@ -79,6 +93,22 @@ public class DateFunc {
         return getYesterday()+" 23:59:59";
     }
 
+    public static String getTomorrowStart() {
+        return getTomorrow()+" 00:00:00";
+    }
+
+    public static String getTomorrowEnd() {
+        return getTomorrow()+" 23:59:59";
+    }
+
+    public static String getAfterTomorrowStart() {
+        return getAfterTomorrow()+" 00:00:00";
+    }
+
+    public static String getAfterTomorrowEnd() {
+        return getAfterTomorrow()+" 23:59:59";
+    }
+
     /**
      * 获取次日开始时刻
      **/
@@ -120,7 +150,7 @@ public class DateFunc {
     /**
      * 获取上周的开始时刻
      */
-    public static String getPreWeekStart() {
+    public static String getLastWeekStart() {
         Calendar cal = Calendar.getInstance();
         //如果当天为周日,则转为上一周的周日
         if (cal.get(Calendar.DAY_OF_WEEK) == cal.getActualMinimum(Calendar.DAY_OF_WEEK)) {
@@ -136,7 +166,7 @@ public class DateFunc {
     /**
      * 获取上周结束的时刻
      **/
-    public static String getPreWeekEnd() {
+    public static String getLastWeekEnd() {
         Calendar cal = Calendar.getInstance();
         //如果当天为非周日,则为下一周的周日
         if (cal.get(Calendar.DAY_OF_WEEK) != cal.getActualMinimum(Calendar.DAY_OF_WEEK)) {
@@ -151,7 +181,7 @@ public class DateFunc {
     /**
      * 获取上月月开始时刻
      **/
-    public static String getPreMonthStart() {
+    public static String getLastMonthStart() {
         Calendar cal = Calendar.getInstance();
         cal.add(Calendar.MONTH, -1);
         cal.set(Calendar.DAY_OF_MONTH, 1);
@@ -162,7 +192,7 @@ public class DateFunc {
     /**
      * 获取上月最后时刻
      **/
-    public static String getPreMonthEnd() {
+    public static String getLastMonthEnd() {
         Calendar cal = Calendar.getInstance();
         cal.add(Calendar.MONTH, -1);
         cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));