瀏覽代碼

fix
发送消息没有时间戳的问题

18339543638 1 年之前
父節點
當前提交
fba5d9f9d4

+ 8 - 0
nb-im/src/main/java/com/nb/im/ws/PubMsgRequestHandler.java

@@ -2,6 +2,8 @@ package com.nb.im.ws;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
@@ -75,9 +77,15 @@ public class PubMsgRequestHandler implements IMsgRequestHandler {
                     }else {
                         key=JSONUtil.parseObj(message.getPayload()).getStr("key");
                     }
+                    if(StrUtil.isBlank(key)){
+                        key=message.getKey();
+                    }
                     pubMsgInfo= objectMapper.readerFor(PubMsgInfo.class).readValue(String.valueOf(message.getPayload()));
                     pubMsgInfo.setKey(key);
                     pubMsgInfo.setOperationType(MsgEnum.NORMAL);
+                    if(ObjectUtil.isNull(pubMsgInfo.getSendTimestamp())){
+                        pubMsgInfo.setSendTimestamp(System.currentTimeMillis());
+                    }
                     imUtils.send(param,topicWrapper,pubMsgInfo,channelContext,false);
                 }catch (Exception e){
                     log.error("PubMsgRequestHandler.handler msg confront error,",e);

+ 5 - 0
nb-service/web-service/src/main/java/com/nb/web/service/bus/controller/BusClinicController.java

@@ -27,6 +27,7 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
+import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -264,4 +265,8 @@ public class BusClinicController {
         }
         return result;
     }
+
+    public R exportExcel(Collection<String> clinicId){
+        return null;
+    }
 }