|
|
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.zd.algorithm.api.speaker.feign.RemoteSpeakService;
|
|
|
import com.zd.common.core.exception.ServiceException;
|
|
|
+import com.zd.common.core.redis.RedisService;
|
|
|
import com.zd.common.core.utils.Assert;
|
|
|
import com.zd.common.core.utils.SpringUtils;
|
|
|
import com.zd.laboratory.api.vo.SubFunction;
|
|
|
@@ -27,6 +28,7 @@ import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Optional;
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
/**
|
|
|
* 实验室消息发送管理 -- 对外使用该类进行操作
|
|
|
@@ -49,6 +51,9 @@ public class SubMessageSendManager {
|
|
|
@Autowired
|
|
|
private RemoteSpeakService remoteSpeakService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private RedisService redisService;
|
|
|
+
|
|
|
/**
|
|
|
* 发送疏散线路通知
|
|
|
*
|
|
|
@@ -116,8 +121,12 @@ public class SubMessageSendManager {
|
|
|
return;
|
|
|
}
|
|
|
MessageBody messageBody = getMessageBody(subFunction);
|
|
|
+ String key = getFunctionSubTopic(subId);
|
|
|
//仅发送一次
|
|
|
- commonSend.send(getFunctionSubTopic(subId), messageBody, SendMode.ONCE);
|
|
|
+ if (redisService.getCacheObject(key)==null){
|
|
|
+ redisService.setCacheObject(key,key,15L, TimeUnit.SECONDS);
|
|
|
+ commonSend.send(key, messageBody, SendMode.ONCE);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|