|
|
@@ -1,7 +1,9 @@
|
|
|
package com.kede.common.task;
|
|
|
|
|
|
+import com.kede.common.dao.ChatMsgOptimizeMapper;
|
|
|
import com.kede.common.model.ChatMsg;
|
|
|
import com.kede.common.model.ChatMsgUser;
|
|
|
+import com.kede.common.utils.DateUtils;
|
|
|
import com.kede.common.utils.StringUtils;
|
|
|
import com.kede.wechat.bo.InputChatMsg;
|
|
|
import com.kede.wechat.service.ConversationContentService;
|
|
|
@@ -26,6 +28,8 @@ public class ConversationContentTask {
|
|
|
private com.kede.common.dao.ChatMsgMapper chatMsgMapper;
|
|
|
@Resource
|
|
|
private com.kede.common.dao.ChatMsgUserMapper chatMsgUserMapper;
|
|
|
+ @Resource
|
|
|
+ private ChatMsgOptimizeMapper chatMsgOptimizeMapper;
|
|
|
|
|
|
/**
|
|
|
* 获取企业微信聊天记录
|
|
|
@@ -41,7 +45,7 @@ public class ConversationContentTask {
|
|
|
//循环获取数据,每次100条,count不足100条时最后一次循序
|
|
|
while (count < pageLimit) {
|
|
|
|
|
|
- Map<String, Object> map = conversationContentService.getChatData(pageSeq, pageLimit);
|
|
|
+ Map<String, Object> map = conversationContentService.pushChatData(pageSeq, pageLimit);
|
|
|
List<InputChatMsg> list = (List<InputChatMsg>) map.get("list");
|
|
|
pushChatMsg(list);
|
|
|
if (map == null) {
|
|
|
@@ -58,8 +62,9 @@ public class ConversationContentTask {
|
|
|
//换算成分钟
|
|
|
long f = time / 60;
|
|
|
long m = time % 60;
|
|
|
-
|
|
|
-
|
|
|
+ Date earlyToday = DateUtils.getEarlyToday();
|
|
|
+ Date date = DateUtils.getDateBefore(earlyToday, -1);
|
|
|
+ chatMsgOptimizeMapper.deleteFromTime(date);
|
|
|
System.out.println("=========================================获取数据完成=====耗时"+f+"分"+m+"秒=========================");
|
|
|
}
|
|
|
|