定时推送优化!
This commit is contained in:
parent
792c246dec
commit
27f360947d
|
|
@ -26,7 +26,7 @@ public class TblTmpPushRemind {
|
|||
@TableId(value = "device_id", type = IdType.NONE)
|
||||
private Integer deviceId;
|
||||
|
||||
@TableId(value = "device_id", type = IdType.NONE)
|
||||
@TableId(value = "user_id", type = IdType.NONE)
|
||||
private Integer userId;
|
||||
|
||||
private String phoneNumber;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.ifish7.tasks.job.impl;
|
|||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.ifish7.tasks.business.device.entity.TblDevice;
|
||||
import com.ifish7.tasks.business.device.entity.TblDeviceHeaterDetail;
|
||||
import com.ifish7.tasks.business.device.entity.TblDeviceUser;
|
||||
|
|
@ -58,6 +59,7 @@ public class RemindJobImpl implements RemindJob {
|
|||
|
||||
private final String pushContent = "【换水提醒】您的水族箱\"%s\"需要换水啦~您可以在水箱设置中更改提醒设置";
|
||||
|
||||
|
||||
@Scheduled(cron = "0 0 10 * * ?")
|
||||
@Override
|
||||
public void commDeviceChangeWater() {
|
||||
|
|
@ -80,7 +82,10 @@ public class RemindJobImpl implements RemindJob {
|
|||
Instant instant = nextRemindDate.toInstant();
|
||||
ZoneId zoneId = ZoneId.systemDefault();
|
||||
tblTmpPushRemind.setRemindDate(instant.atZone(zoneId).toLocalDate());
|
||||
tmpPushRemindService.saveOrUpdate(tblTmpPushRemind);
|
||||
boolean update = tmpPushRemindService.update(tblTmpPushRemind, new UpdateWrapper<TblTmpPushRemind>()
|
||||
.eq("device_id", tblTmpPushRemind.getDeviceId())
|
||||
.eq("user_id", tblTmpPushRemind.getUserId()));
|
||||
log.info("update : " + update);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue