定时推送优化!

This commit is contained in:
易焱 2019-06-13 18:11:03 +08:00
parent 65dbdf7948
commit 792c246dec
1 changed files with 14 additions and 10 deletions

View File

@ -67,10 +67,12 @@ public class RemindJobImpl implements RemindJob {
.eq(TblTmpPushRemind::getRemindDate, LocalDate.now()));
final PushList pushList = new PushList();
list.forEach(tblTmpPushRemind -> {
//查询出设备对应的名称
TblDeviceUser deviceUser = deviceUserService.getOne(new QueryWrapper<TblDeviceUser>().lambda()
List<TblDeviceUser> deviceUsers = deviceUserService.list(new QueryWrapper<TblDeviceUser>().lambda()
.eq(TblDeviceUser::getDeviceId, tblTmpPushRemind.getDeviceId())
.eq(TblDeviceUser::getUserId, tblTmpPushRemind.getUserId()));
if (deviceUsers.size() > 0) {
//查询出设备对应的名称
TblDeviceUser deviceUser = deviceUsers.get(0);
if (deviceUser != null) {
setPushList(pushList, deviceUser);
//更新换水提醒下次时间
@ -80,6 +82,8 @@ public class RemindJobImpl implements RemindJob {
tblTmpPushRemind.setRemindDate(instant.atZone(zoneId).toLocalDate());
tmpPushRemindService.saveOrUpdate(tblTmpPushRemind);
}
}
});
log.info("RemindJobImpl - commDeviceChangeWater --> end");
}