|
|
@@ -1,6 +1,7 @@
|
|
|
package com.kede.common.task;
|
|
|
|
|
|
import com.kede.common.model.ChatMsg;
|
|
|
+import com.kede.common.utils.StringUtils;
|
|
|
import com.kede.wechat.bo.InputChatMsg;
|
|
|
import com.kede.wechat.service.ConversationContentService;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
@@ -69,19 +70,24 @@ public class ConversationContentTask {
|
|
|
stringJoiner.add(tolistName1);
|
|
|
}
|
|
|
}
|
|
|
- ChatMsg in= new ChatMsg();
|
|
|
- in.setMsgid(chatMsg.getMsgid());
|
|
|
- in.setAction(chatMsg.getAction());
|
|
|
- in.setFrom(chatMsg.getFrom());
|
|
|
- in.setFromName(chatName);
|
|
|
- in.setTolist(tolist);
|
|
|
- in.setTolistName(stringJoiner.toString());
|
|
|
- in.setRoomid(chatMsg.getRoomid());
|
|
|
- in.setMsgtime(chatMsg.getMsgtime());
|
|
|
- in.setMsgtype(chatMsg.getMsgtype());
|
|
|
- in.setContent(chatMsg.getContent());
|
|
|
- in.setCreateTime(new Date());
|
|
|
- chatMsgMapper.insert(in);
|
|
|
+ if (StringUtils.isEmpty(chatName)){
|
|
|
+ ChatMsg chatMsg1 = chatMsgMapper.selectByMsgId(chatMsg.getMsgid());
|
|
|
+ if (chatMsg1 == null){
|
|
|
+ ChatMsg in= new ChatMsg();
|
|
|
+ in.setMsgid(chatMsg.getMsgid());
|
|
|
+ in.setAction(chatMsg.getAction());
|
|
|
+ in.setFrom(chatMsg.getFrom());
|
|
|
+ in.setFromName(chatName);
|
|
|
+ in.setTolist(tolist);
|
|
|
+ in.setTolistName(stringJoiner.toString());
|
|
|
+ in.setRoomid(chatMsg.getRoomid());
|
|
|
+ in.setMsgtime(chatMsg.getMsgtime());
|
|
|
+ in.setMsgtype(chatMsg.getMsgtype());
|
|
|
+ in.setContent(chatMsg.getContent());
|
|
|
+ in.setCreateTime(new Date());
|
|
|
+ chatMsgMapper.insert(in);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|