|
|
@@ -1,6 +1,7 @@
|
|
|
package com.kede.common.task;
|
|
|
|
|
|
import com.kede.common.model.ChatMsg;
|
|
|
+import com.kede.common.model.ChatMsgUser;
|
|
|
import com.kede.common.utils.StringUtils;
|
|
|
import com.kede.wechat.bo.InputChatMsg;
|
|
|
import com.kede.wechat.service.ConversationContentService;
|
|
|
@@ -11,7 +12,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import java.sql.SQLOutput;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
@@ -24,6 +24,8 @@ public class ConversationContentTask {
|
|
|
private ConversationContentService conversationContentService;
|
|
|
@Resource
|
|
|
private com.kede.common.dao.ChatMsgMapper chatMsgMapper;
|
|
|
+ @Resource
|
|
|
+ private com.kede.common.dao.ChatMsgUserMapper chatMsgUserMapper;
|
|
|
|
|
|
/**
|
|
|
* 获取企业微信聊天记录
|
|
|
@@ -48,6 +50,7 @@ public class ConversationContentTask {
|
|
|
}
|
|
|
pageSeq= pageSeq + pageLimit+1;
|
|
|
}
|
|
|
+ System.out.println("=========================================获取数据完成==============================");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -121,6 +124,17 @@ public class ConversationContentTask {
|
|
|
in.setTolistName(stringJoiner.toString());
|
|
|
in.setRoomid(chatMsg.getRoomid());
|
|
|
in.setRoomName(roomName);
|
|
|
+ if (StringUtils.isNotBlank(chatMsg.getRoomid())){
|
|
|
+ ChatMsgUser chatMsgUser = chatMsgUserMapper.selectByUserId(chatMsg.getRoomid());
|
|
|
+ if (chatMsgUser == null){
|
|
|
+ ChatMsgUser cmu = new ChatMsgUser();
|
|
|
+ cmu.setUserId(chatMsg.getRoomid());
|
|
|
+ cmu.setName(roomName);
|
|
|
+ cmu.setType(3);
|
|
|
+ cmu.setCreateTime(new Date());
|
|
|
+ chatMsgUserMapper.insert(cmu);
|
|
|
+ }
|
|
|
+ }
|
|
|
in.setMsgtime(chatMsg.getMsgtime());
|
|
|
in.setMsgtype(chatMsg.getMsgtype());
|
|
|
in.setContent(chatMsg.getContent());
|