|
@@ -7,7 +7,11 @@ import com.kede.common.utils.DateUtils;
|
|
|
import com.kede.common.utils.HttpUtils;
|
|
import com.kede.common.utils.HttpUtils;
|
|
|
import com.kede.common.utils.RSAEncrypt;
|
|
import com.kede.common.utils.RSAEncrypt;
|
|
|
import com.kede.common.utils.StringUtils;
|
|
import com.kede.common.utils.StringUtils;
|
|
|
|
|
+import com.kede.core.mybatis.BaseMybatisDao;
|
|
|
|
|
+import com.kede.wechat.bo.ChatMsgUserBo;
|
|
|
import com.kede.wechat.bo.InputChatMsg;
|
|
import com.kede.wechat.bo.InputChatMsg;
|
|
|
|
|
+import com.kede.wechat.bo.InputGetChatName;
|
|
|
|
|
+import com.kede.wechat.bo.InputgetUserMsg;
|
|
|
import com.kede.wechat.service.ConversationContentService;
|
|
import com.kede.wechat.service.ConversationContentService;
|
|
|
import com.tencent.wework.Finance;
|
|
import com.tencent.wework.Finance;
|
|
|
import org.json.JSONArray;
|
|
import org.json.JSONArray;
|
|
@@ -24,11 +28,12 @@ import java.io.File;
|
|
|
import java.io.FileOutputStream;
|
|
import java.io.FileOutputStream;
|
|
|
import java.io.UnsupportedEncodingException;
|
|
import java.io.UnsupportedEncodingException;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
import static sun.plugin2.os.windows.OSVERSIONINFOA.size;
|
|
import static sun.plugin2.os.windows.OSVERSIONINFOA.size;
|
|
|
|
|
|
|
|
@Service("ConversationContentService")
|
|
@Service("ConversationContentService")
|
|
|
-public class ConversationContentServiceImpl implements ConversationContentService {
|
|
|
|
|
|
|
+public class ConversationContentServiceImpl extends BaseMybatisDao<ChatMsgUserMapper> implements ConversationContentService {
|
|
|
|
|
|
|
|
Logger logger = LoggerFactory.getLogger(ConversationContentServiceImpl.class);
|
|
Logger logger = LoggerFactory.getLogger(ConversationContentServiceImpl.class);
|
|
|
@Resource
|
|
@Resource
|
|
@@ -528,6 +533,66 @@ public class ConversationContentServiceImpl implements ConversationContentServic
|
|
|
return name;
|
|
return name;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Object getMsgData(InputGetChatName in) {
|
|
|
|
|
+
|
|
|
|
|
+ List<ChatMsgUser> list = chatMsgUserMapper.getUserList(2);
|
|
|
|
|
+ list.forEach(e->{
|
|
|
|
|
+ //查询每个人的所有信息
|
|
|
|
|
+ List<ChatMsg> chatMsgs = chatMsgMapper.selectMsgById(e.getUserId(),null);
|
|
|
|
|
+ List<ChatMsg> collect = chatMsgs.stream().filter(e1 -> e1.getType().equals(0)).collect(Collectors.toList());
|
|
|
|
|
+ List<ChatMsg> collect1 = chatMsgs.stream().filter(e1 -> e1.getType().equals(1)).collect(Collectors.toList());
|
|
|
|
|
+ List<String> toUser=new ArrayList<>();
|
|
|
|
|
+ List<String> toList=new ArrayList<>();
|
|
|
|
|
+ collect.forEach(e1->{
|
|
|
|
|
+ if (e1.getFromId().equals(e.getUserId())){
|
|
|
|
|
+ if (!toUser.contains(e1.getTolist())){
|
|
|
|
|
+ toUser.add(e1.getTolist());
|
|
|
|
|
+ }
|
|
|
|
|
+ }else {
|
|
|
|
|
+ if (!toUser.contains(e1.getFromId())){
|
|
|
|
|
+ toUser.add(e1.getFromId());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ collect1.forEach(e1->{
|
|
|
|
|
+ if (e1.getFromId().equals(e.getUserId())){
|
|
|
|
|
+ if (!toList.contains(e1.getRoomid())){
|
|
|
|
|
+ toList.add(e1.getRoomid());
|
|
|
|
|
+ }
|
|
|
|
|
+ }else {
|
|
|
|
|
+ if (!toList.contains(e1.getRoomid())){
|
|
|
|
|
+ toList.add(e1.getRoomid());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ System.out.println(e.getName()+"单聊有:");
|
|
|
|
|
+ toUser.forEach(System.out::println);
|
|
|
|
|
+ System.out.println("================================");
|
|
|
|
|
+ System.out.println(e.getName()+"群聊有:");
|
|
|
|
|
+ toList.forEach(System.out::println);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ return list;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Object getUserMsg(InputgetUserMsg in) {
|
|
|
|
|
+ List<ChatMsgUser> list = chatMsgUserMapper.getUserList(2);
|
|
|
|
|
+ return list;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Object getMyIdByUser(InputgetUserMsg in) {
|
|
|
|
|
+ return chatMsgUserMapper.selectMyIdByUser(in.getUserId());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Object getMyIdByRoom(InputgetUserMsg in) {
|
|
|
|
|
+ return chatMsgUserMapper.selectMyIdByRoom(in.getUserId());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
private Map<String,Object> getUserName(String url,Integer type){
|
|
private Map<String,Object> getUserName(String url,Integer type){
|
|
|
String name = null;
|
|
String name = null;
|