Explorar el Código

新增同意和不同意的识别

anderx hace 5 meses
padre
commit
6e814ddd52

+ 2 - 0
src/main/java/com/kede/common/dao/ChatMsgUserMapper.java

@@ -88,5 +88,7 @@ public interface ChatMsgUserMapper {
     List<ChatMsgUser>  selectMyIdByUser(InputgetUserMsg in);
 
     List<ChatMsgUser>  selectMyIdByRoom(InputgetUserMsg in);
+
+    void deleteByUserId(String from);
 }
 

+ 5 - 0
src/main/java/com/kede/common/mapper/ChatMsgUserMapper.xml

@@ -127,6 +127,11 @@
         from chat_msg_user
         where id = #{id}
     </delete>
+    <delete id="deleteByUserId">
+        delete
+        from chat_msg_user
+        where chat_msg_user.user_id = #{id}
+    </delete>
 
     <select id="selectByUserId" resultMap="ChatMsgUserMap">
         select

+ 5 - 1
src/main/java/com/kede/common/task/ConversationContentTask.java

@@ -90,8 +90,12 @@ public class ConversationContentTask {
             String from = chatMsg.getFrom();
             //获取发送这名称
 //            System.out.println("====>"+chatMsg);
+            //如果是同意聊天,删除之前存储的未知名称,获取新的名称
+            if (chatMsg.getAction().equals("agree")){
+                chatMsgUserMapper.deleteByUserId(from);
+            }
+
             Map<String, Object> map = conversationContentService.pushGetChatName(from);
-            //
             String chatName=map.get("name").toString();
             String tolist = chatMsg.getTolist();
             String roomName=null;