Commit 97ab8a62 authored by 赵啸非's avatar 赵啸非

修改通知去重复

parent 48df4747
...@@ -3,6 +3,7 @@ package com.mortals.xhx.daemon.task; ...@@ -3,6 +3,7 @@ package com.mortals.xhx.daemon.task;
import cn.hutool.core.date.DateUnit; import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ICacheService; import com.mortals.framework.service.ICacheService;
import com.mortals.framework.service.ITask; import com.mortals.framework.service.ITask;
...@@ -81,11 +82,10 @@ public class MeetSwitchTaskImpl implements ITaskExcuteService { ...@@ -81,11 +82,10 @@ public class MeetSwitchTaskImpl implements ITaskExcuteService {
for (MettingRecordEntity recordEntity : recordEntities) { for (MettingRecordEntity recordEntity : recordEntities) {
long between = DateUtil.between(new Date(), recordEntity.getMeetTimeStart(), DateUnit.MINUTE); long between = DateUtil.between(new Date(), recordEntity.getMeetTimeStart(), DateUnit.MINUTE);
if (between <= basicSetEntity.getPreMeetStart()) { if (between <= basicSetEntity.getPreMeetStart()) {
RoomDeviceQuery roomDeviceQuery = new RoomDeviceQuery(); RoomDeviceQuery roomDeviceQuery = new RoomDeviceQuery();
roomDeviceQuery.setRoomId(recordEntity.getRoomId()); roomDeviceQuery.setRoomId(recordEntity.getRoomId());
RoomDeviceEntity roomDeviceEntity = roomDeviceService.selectOne(roomDeviceQuery); RoomDeviceEntity roomDeviceEntity = roomDeviceService.selectOne(roomDeviceQuery);
if(ObjectUtils.isEmpty(roomDeviceEntity)) return; if (ObjectUtils.isEmpty(roomDeviceEntity)) return;
//还需满足当前进行中的会议 是否已经结束超时 存在时才推送消息 //还需满足当前进行中的会议 是否已经结束超时 存在时才推送消息
mettingRecordQuery = new MettingRecordQuery(); mettingRecordQuery = new MettingRecordQuery();
...@@ -93,23 +93,23 @@ public class MeetSwitchTaskImpl implements ITaskExcuteService { ...@@ -93,23 +93,23 @@ public class MeetSwitchTaskImpl implements ITaskExcuteService {
mettingRecordQuery.setRoomId(recordEntity.getRoomId()); mettingRecordQuery.setRoomId(recordEntity.getRoomId());
MettingRecordEntity mettingRecordEntity = mettingRecordService.selectOne(mettingRecordQuery); MettingRecordEntity mettingRecordEntity = mettingRecordService.selectOne(mettingRecordQuery);
if(!ObjectUtils.isEmpty(mettingRecordEntity)){ if (!ObjectUtils.isEmpty(mettingRecordEntity)) {
if( basicSetEntity.getPostMeetStart()>0){ if (basicSetEntity.getPostMeetStart() > 0) {
//查看结束通知是否设置 //查看结束通知是否设置
long mettingBetween = DateUtil.between(mettingRecordEntity.getMeetTimeStart(), new Date(), DateUnit.MINUTE); long mettingBetween = DateUtil.between(mettingRecordEntity.getMeetTimeStart(), new Date(), DateUnit.MINUTE);
if(mettingBetween<=basicSetEntity.getPostMeetStart()){ if (mettingBetween <= basicSetEntity.getPostMeetStart()) {
log.info("当前进行中的会议未结束,不推送下一个会议消息"); log.info("当前进行中的会议未结束,不推送下一个会议消息");
return; return;
} }
} }
if(basicSetEntity.getMeetEnd()== YesNoEnum.YES.getValue()){ if (basicSetEntity.getMeetEnd() == YesNoEnum.YES.getValue()) {
long mettingBetween = DateUtil.between(mettingRecordEntity.getMeetTimeEnd(), new Date(), DateUnit.MINUTE); long mettingBetween = DateUtil.between(mettingRecordEntity.getMeetTimeEnd(), new Date(), DateUnit.MINUTE);
if(mettingBetween<=basicSetEntity.getPostMeetStart()){ if (mettingBetween <= basicSetEntity.getPostMeetStart()) {
log.info("当前进行中的会议未结束,不推送下一个会议消息"); log.info("当前进行中的会议未结束,不推送下一个会议消息");
return; return;
} }
} }
} }
//通知设备进行数据更新 //通知设备进行数据更新
...@@ -119,7 +119,7 @@ public class MeetSwitchTaskImpl implements ITaskExcuteService { ...@@ -119,7 +119,7 @@ public class MeetSwitchTaskImpl implements ITaskExcuteService {
uploadDeviceReq.setDeviceCodeList(Arrays.asList(roomDeviceEntity.getDeviceCode())); uploadDeviceReq.setDeviceCodeList(Arrays.asList(roomDeviceEntity.getDeviceCode()));
uploadDeviceReq.setAction("preMeetStart"); uploadDeviceReq.setAction("preMeetStart");
uploadDeviceReq.setContent(JSON.toJSONString(recordEntity)); uploadDeviceReq.setContent(JSON.toJSONString(recordEntity));
log.info("preMeetStart send msg :{}",roomDeviceEntity.getDeviceCode()); log.info("preMeetStart send msg :{}", roomDeviceEntity.getDeviceCode());
messageFeign.downMsg(uploadDeviceReq); messageFeign.downMsg(uploadDeviceReq);
} }
} }
...@@ -140,12 +140,13 @@ public class MeetSwitchTaskImpl implements ITaskExcuteService { ...@@ -140,12 +140,13 @@ public class MeetSwitchTaskImpl implements ITaskExcuteService {
RoomDeviceQuery roomDeviceQuery = new RoomDeviceQuery(); RoomDeviceQuery roomDeviceQuery = new RoomDeviceQuery();
roomDeviceQuery.setRoomId(pendRecordEntity.getRoomId()); roomDeviceQuery.setRoomId(pendRecordEntity.getRoomId());
RoomDeviceEntity roomDeviceEntity = roomDeviceService.selectOne(roomDeviceQuery); RoomDeviceEntity roomDeviceEntity = roomDeviceService.selectOne(roomDeviceQuery);
if(ObjectUtils.isEmpty(roomDeviceEntity)) return; if (ObjectUtils.isEmpty(roomDeviceEntity)) return;
UploadDeviceReq uploadDeviceReq = new UploadDeviceReq(); UploadDeviceReq uploadDeviceReq = new UploadDeviceReq();
uploadDeviceReq.setDeviceCodeList(Arrays.asList(roomDeviceEntity.getDeviceCode())); uploadDeviceReq.setDeviceCodeList(Arrays.asList(roomDeviceEntity.getDeviceCode()));
uploadDeviceReq.setAction("postMeet"); uploadDeviceReq.setAction("postMeet");
messageFeign.downMsg(uploadDeviceReq); Rest<String> rest = messageFeign.downMsg(uploadDeviceReq);
log.info("会议结束提前通知 postMeet 返回结果:{}", JSON.toJSONString(rest));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment