替换旧代码

This commit is contained in:
liuchengqian 2023-02-14 16:36:57 +08:00
parent 31aadb17a6
commit 51edb2e4e8
2 changed files with 7 additions and 0 deletions

View File

@ -19,6 +19,10 @@ public class VipTimeRangeUtils {
private VipTimeRangeUtils() { private VipTimeRangeUtils() {
} }
public static boolean checkIfInVipTimeRange(String vipTimeRangeJson) {
return checkIfInVipTimeRange(vipTimeRangeJson, LocalDateTime.now());
}
/** /**
* 校验传入的时间是否在指定的VIP时间范围内 * 校验传入的时间是否在指定的VIP时间范围内
*/ */

View File

@ -1,6 +1,7 @@
package com.xkrs.utils; package com.xkrs.utils;
import com.xkrs.straw.model.entity.SysUserEntity; import com.xkrs.straw.model.entity.SysUserEntity;
import com.xkrs.straw.utils.VipTimeRangeUtils;
import org.apache.hc.core5.util.TextUtils; import org.apache.hc.core5.util.TextUtils;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -54,6 +55,8 @@ public class FirePointCodeUtils {
if ("管理员".equals(sysUser.getAccountType())) {//管理员用户不发短信 if ("管理员".equals(sysUser.getAccountType())) {//管理员用户不发短信
continue; continue;
} }
boolean inVipTimeRange = VipTimeRangeUtils.checkIfInVipTimeRange(sysUser.getVipTimeRangeJson());
LocalDateTime sysUserOverDateTime = DateTimeUtil.stringToDateTimeFormatter(sysUser.getOverTime(), DateTimeUtil.COMMON_FORMATTER_DATETIME); LocalDateTime sysUserOverDateTime = DateTimeUtil.stringToDateTimeFormatter(sysUser.getOverTime(), DateTimeUtil.COMMON_FORMATTER_DATETIME);
if (sysUserOverDateTime.isBefore(LocalDateTime.now())) { if (sysUserOverDateTime.isBefore(LocalDateTime.now())) {
if (!normalSmsEnable) {//根据配置信息决定普通用户是否发送短信 if (!normalSmsEnable) {//根据配置信息决定普通用户是否发送短信