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

修改通知去重复

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