diff --git a/src/main/java/com/xkrs/utilsnew/TimeRangeUtils.java b/src/main/java/com/xkrs/utilsnew/TimeRangeUtils.java index 026bf0b..02e5ed7 100644 --- a/src/main/java/com/xkrs/utilsnew/TimeRangeUtils.java +++ b/src/main/java/com/xkrs/utilsnew/TimeRangeUtils.java @@ -37,14 +37,14 @@ public class TimeRangeUtils { } /** - * 检查VIP是否过期(OK) + * 检查VIP是否过期 */ public static boolean checkIfVipExpired(String vipTimeRangeJson) { return !checkIfVipValid(vipTimeRangeJson); } /** - * 获取VIP范围列表(OK) + * 获取VIP范围列表 */ public static List> getVipRangeList(String vipTimeRangeJson) { List> vipRangeList = new ArrayList<>();//VIP范围结果列表 @@ -78,14 +78,14 @@ public class TimeRangeUtils { } /** - * 检查试用期是否过期(OK) + * 检查试用期是否过期 */ public static boolean checkIfProbationExpired(String addTime, Long dayNum) { return !checkIfProbationValid(addTime, dayNum); } /** - * 获取试用期范围(OK) + * 获取试用期范围 */ public static DataWrapper2 getProbationRange(String addTime, Long dayNum) { DateTimeUtils.checkDateTimeFormat(addTime); diff --git a/src/main/java/com/xkrs/utilsnew/VipTimeRangeUtils.java b/src/main/java/com/xkrs/utilsnew/VipTimeRangeUtils.java index b8b6ea6..176663e 100644 --- a/src/main/java/com/xkrs/utilsnew/VipTimeRangeUtils.java +++ b/src/main/java/com/xkrs/utilsnew/VipTimeRangeUtils.java @@ -2,8 +2,6 @@ package com.xkrs.utilsnew; import com.xkrs.model.bean.VipTimeRangeBean; import org.apache.hc.core5.util.TextUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.time.LocalDateTime; import java.util.ArrayList; @@ -11,8 +9,6 @@ import java.util.List; public class VipTimeRangeUtils { - public static Logger log = LoggerFactory.getLogger(VipTimeRangeUtils.class); - private VipTimeRangeUtils() { } @@ -25,8 +21,8 @@ public class VipTimeRangeUtils { LocalDateTime startLocalDateTime = LocalDateTime.now(); if (startLocalDateTime.isBefore(newLocalDateTime)) { VipTimeRangeBean.VipTimeRangeItemBean vipTimeRangeItemBean = new VipTimeRangeBean.VipTimeRangeItemBean(); - vipTimeRangeItemBean.setStartTime(DateTimeUtils.DATE_TIME_FORMATTER_1.format(startLocalDateTime)); - vipTimeRangeItemBean.setEndTime(DateTimeUtils.DATE_TIME_FORMATTER_1.format(newLocalDateTime)); + vipTimeRangeItemBean.setStartTime(DateTimeUtils.localDateTimeToString(startLocalDateTime)); + vipTimeRangeItemBean.setEndTime(DateTimeUtils.localDateTimeToString(newLocalDateTime)); List list = new ArrayList<>(); list.add(vipTimeRangeItemBean); VipTimeRangeBean vipTimeRangeBean = new VipTimeRangeBean(); @@ -78,8 +74,8 @@ public class VipTimeRangeUtils { LocalDateTime startLocalDateTime = LocalDateTime.now(); if (startLocalDateTime.isBefore(newLocalDateTime)) { VipTimeRangeBean.VipTimeRangeItemBean vipTimeRangeItemBean = new VipTimeRangeBean.VipTimeRangeItemBean(); - vipTimeRangeItemBean.setStartTime(DateTimeUtils.DATE_TIME_FORMATTER_1.format(startLocalDateTime)); - vipTimeRangeItemBean.setEndTime(DateTimeUtils.DATE_TIME_FORMATTER_1.format(newLocalDateTime)); + vipTimeRangeItemBean.setStartTime(DateTimeUtils.localDateTimeToString(startLocalDateTime)); + vipTimeRangeItemBean.setEndTime(DateTimeUtils.localDateTimeToString(newLocalDateTime)); list.add(vipTimeRangeItemBean); return JsonUtils.serialize(vipTimeRangeBean); } else { @@ -90,7 +86,7 @@ public class VipTimeRangeUtils { //调整VIP用户过期时间的方案是调整结束时间为传入的时间 LocalDateTime startLocalDateTime = LocalDateTime.parse(lastVipTimeRangeItemBean.getStartTime(), DateTimeUtils.DATE_TIME_FORMATTER_1); if (startLocalDateTime.isBefore(newLocalDateTime)) { - lastVipTimeRangeItemBean.setEndTime(DateTimeUtils.DATE_TIME_FORMATTER_1.format(newLocalDateTime)); + lastVipTimeRangeItemBean.setEndTime(DateTimeUtils.localDateTimeToString(newLocalDateTime)); return JsonUtils.serialize(vipTimeRangeBean); } else { throw new RuntimeException("设置的过期时间必须晚于当次的VIP开始时间");