站点管理-弹窗管理-修复推送次数判断有误

master
382696293@qq.com 2 years ago
parent d12281024e
commit a90f6b76e8

@ -21,8 +21,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="siteId != null "> and site_id = #{siteId}</if>
<if test="params != null and params.beginTime != null"> and create_time &gt;= #{params.beginTime},</if>
<if test="params != null and params.endTime != null"> and create_time &lt;= #{params.endTime},</if>
<if test="params != null and params.beginTime != null"> and create_time &gt;= #{params.beginTime}</if>
<if test="params != null and params.endTime != null"> and create_time &lt;= #{params.endTime}</if>
</where>
</select>

@ -277,7 +277,7 @@ public class SiteInfoServiceImpl implements ISiteInfoService {
/* 5、推送频次 */
Integer pushType = info.getPushType();
if (info.getPushType() != null) {
// 5.1、每次进入,不用做判断
// 5.1、每次进入:每次页面刷新则展示,不用做判断
// 5.2、一次
if (SitePushTypeEnum.ONE.getCode() == pushType) {
SiteLog siteLog = new SiteLog();
@ -293,7 +293,7 @@ public class SiteInfoServiceImpl implements ISiteInfoService {
// 判断当前日期的星期是否在规定范围内
String pushTimer = info.getPushTimer();
if (StringUtils.isNotBlank(pushTimer)) {
List<String> weekList = Arrays.asList(pushTimer.split(","));
List<Integer> weekList = Arrays.asList(pushTimer.split(",")).stream().map(Integer::valueOf).collect(Collectors.toList());
Calendar calendar = Calendar.getInstance();
// 获取当前星期几1表示周日2表示周一依此类推
int week = calendar.get(Calendar.DAY_OF_WEEK);
@ -309,7 +309,7 @@ public class SiteInfoServiceImpl implements ISiteInfoService {
siteLog.getParams().put("beginTime", LocalDateTime.of(now.toLocalDate(), LocalTime.MIN));
siteLog.getParams().put("endTime", LocalDateTime.of(now.toLocalDate(), LocalTime.MAX));
List<SiteLog> siteLogs = siteLogMapper.selectSiteLogList(siteLog);
if (siteLogs == null || siteLogs.size() >= info.getPushNumber()) {
if (siteLogs != null && siteLogs.size() >= info.getPushNumber()) {
continue;
}
}

Loading…
Cancel
Save