diff --git a/src/main/java/com/xkrs/straw/utils/VipTimeRangeUtils.java b/src/main/java/com/xkrs/straw/utils/VipTimeRangeUtils.java index a78cdf0..7e58fac 100644 --- a/src/main/java/com/xkrs/straw/utils/VipTimeRangeUtils.java +++ b/src/main/java/com/xkrs/straw/utils/VipTimeRangeUtils.java @@ -19,6 +19,10 @@ public class VipTimeRangeUtils { private VipTimeRangeUtils() { } + public static boolean checkIfInVipTimeRange(String vipTimeRangeJson) { + return checkIfInVipTimeRange(vipTimeRangeJson, LocalDateTime.now()); + } + /** * 校验传入的时间是否在指定的VIP时间范围内 */ diff --git a/src/main/java/com/xkrs/utils/FirePointCodeUtils.java b/src/main/java/com/xkrs/utils/FirePointCodeUtils.java index 93dc54a..69352dd 100644 --- a/src/main/java/com/xkrs/utils/FirePointCodeUtils.java +++ b/src/main/java/com/xkrs/utils/FirePointCodeUtils.java @@ -1,6 +1,7 @@ package com.xkrs.utils; import com.xkrs.straw.model.entity.SysUserEntity; +import com.xkrs.straw.utils.VipTimeRangeUtils; import org.apache.hc.core5.util.TextUtils; import java.time.LocalDateTime; @@ -54,6 +55,8 @@ public class FirePointCodeUtils { if ("管理员".equals(sysUser.getAccountType())) {//管理员用户不发短信 continue; } + boolean inVipTimeRange = VipTimeRangeUtils.checkIfInVipTimeRange(sysUser.getVipTimeRangeJson()); + LocalDateTime sysUserOverDateTime = DateTimeUtil.stringToDateTimeFormatter(sysUser.getOverTime(), DateTimeUtil.COMMON_FORMATTER_DATETIME); if (sysUserOverDateTime.isBefore(LocalDateTime.now())) { if (!normalSmsEnable) {//根据配置信息决定普通用户是否发送短信