Commit 1d8ee783 authored by 王晓旭's avatar 王晓旭
parents 7d665069 24b159bf
......@@ -113,15 +113,21 @@ public class MeetSwitchTaskImpl implements ITaskExcuteService {
//通知设备进行数据更新
long expire = between * 60 == 0 ? between * 60 : 60;
boolean setnx = cacheService.setnx(RedisKey.KEY_METTING_START_CACHE, recordEntity.getId(), expire);
if (setnx) {
UploadDeviceReq uploadDeviceReq = new UploadDeviceReq();
uploadDeviceReq.setDeviceCodeList(Arrays.asList(roomDeviceEntity.getDeviceCode()));
uploadDeviceReq.setAction("preMeetStart");
uploadDeviceReq.setContent(JSON.toJSONString(recordEntity));
log.info("preMeetStart send msg :{}", roomDeviceEntity.getDeviceCode());
messageFeign.downMsg(uploadDeviceReq);
log.info("会议redis 设置过期时间:{}", expire);
try {
boolean setnx = cacheService.setnx(RedisKey.KEY_METTING_START_CACHE, recordEntity.getId(), expire);
if (setnx) {
UploadDeviceReq uploadDeviceReq = new UploadDeviceReq();
uploadDeviceReq.setDeviceCodeList(Arrays.asList(roomDeviceEntity.getDeviceCode()));
uploadDeviceReq.setAction("preMeetStart");
uploadDeviceReq.setContent(JSON.toJSONString(recordEntity));
log.info("preMeetStart send msg :{}", roomDeviceEntity.getDeviceCode());
messageFeign.downMsg(uploadDeviceReq);
}
}catch (Exception e){
log.error("设置异常",e);
}
}
}
......
......@@ -119,7 +119,6 @@ public class MettingRecordServiceImpl extends AbstractCRUDServiceImpl<MettingRec
protected void saveBefore(MettingRecordEntity entity, Context context) throws AppException {
super.saveBefore(entity, context);
checkStartAndEndTime(entity);
Boolean bool = checkExistStartMeetTime(entity);
if (bool) {
throw new AppException("当前会议室该时段已经存在等待或进行中的会议,请选择其它时间段!");
......@@ -134,17 +133,17 @@ public class MettingRecordServiceImpl extends AbstractCRUDServiceImpl<MettingRec
boolean in = DateUtil.isIn(new Date(), entity.getMeetTimeStart(), entity.getMeetTimeEnd());
if (in) {
entity.setMeetStatus(MeetStatusEnum.进行中.getValue());
//发送推送通知
RoomDeviceQuery roomDeviceQuery = new RoomDeviceQuery();
roomDeviceQuery.setRoomId(entity.getRoomId());
RoomDeviceEntity roomDeviceEntity = roomDeviceService.selectOne(roomDeviceQuery);
if (!ObjectUtils.isEmpty(roomDeviceEntity)) {
UploadDeviceReq uploadDeviceReq = new UploadDeviceReq();
uploadDeviceReq.setDeviceCodeList(Arrays.asList(roomDeviceEntity.getDeviceCode()));
uploadDeviceReq.setAction("refreshMetting");
log.info("refreshMetting send deviceList :{}", JSON.toJSONString(Arrays.asList(roomDeviceEntity.getDeviceCode())));
messageFeign.downMsg(uploadDeviceReq);
}
}
//发送推送通知
RoomDeviceQuery roomDeviceQuery = new RoomDeviceQuery();
roomDeviceQuery.setRoomId(entity.getRoomId());
RoomDeviceEntity roomDeviceEntity = roomDeviceService.selectOne(roomDeviceQuery);
if (!ObjectUtils.isEmpty(roomDeviceEntity)) {
UploadDeviceReq uploadDeviceReq = new UploadDeviceReq();
uploadDeviceReq.setDeviceCodeList(Arrays.asList(roomDeviceEntity.getDeviceCode()));
uploadDeviceReq.setAction("refreshMetting");
log.info("refreshMetting send deviceList :{}", JSON.toJSONString(Arrays.asList(roomDeviceEntity.getDeviceCode())));
messageFeign.downMsg(uploadDeviceReq);
}
}
......
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