Commit 37f0e6c9 by Lee Munkyeong

バグ修正

parent d2806542
......@@ -175,6 +175,7 @@ public class ChatRoomDao extends AbstractCommunicationDao {
for (ChatRoomDto chatRoomDto : chatRoomDtoList) {
roomIdList.add(chatRoomDto.chatRoomId);
insertChatRoom(chatRoomDto);
deleteChatRoomUsers(chatRoomDto.chatRoomId);
insertChatRoomUsers(chatRoomDto.attendUsers, chatRoomDto.chatRoomId);
}
update("delete from t_chat_room where chat_room_id NOT IN (" + StringUtil.join(" , ", roomIdList) + ")", null);
......@@ -187,12 +188,15 @@ public class ChatRoomDao extends AbstractCommunicationDao {
}
public void insertChatRoomUsers(List<Integer> attendUsers, Integer chatRoomId) {
update("delete from r_chat_room_shop_member where chat_room_id = ?", new Integer[]{chatRoomId});
for (Integer attendUserId : attendUsers) {
insert("insert or replace into r_chat_room_shop_member (chat_room_id, shop_member_id) values (?,?)", new Integer[]{chatRoomId, attendUserId});
}
}
public void deleteChatRoomUsers(Integer chatRoomId) {
update("delete from r_chat_room_shop_member where chat_room_id = ?", new Integer[]{chatRoomId});
}
public boolean updateChatRoom(ChatRoomDto dto) {
long count = update("update t_chat_room set chat_room_name=?, type=?, unread_count=?, user_count=?, favorite_register_date=? where chat_room_id=?", dto.getUpdateValues());
return count > 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment