Commit 5daba5bf by Lee Munkyeong

Merge branch 'features/abcomm_sp6_bug_fix_for_user_invite' into 'features/abcomm_sp6'

バグ修正

See merge request !136
parents d2806542 37f0e6c9
...@@ -175,6 +175,7 @@ public class ChatRoomDao extends AbstractCommunicationDao { ...@@ -175,6 +175,7 @@ public class ChatRoomDao extends AbstractCommunicationDao {
for (ChatRoomDto chatRoomDto : chatRoomDtoList) { for (ChatRoomDto chatRoomDto : chatRoomDtoList) {
roomIdList.add(chatRoomDto.chatRoomId); roomIdList.add(chatRoomDto.chatRoomId);
insertChatRoom(chatRoomDto); insertChatRoom(chatRoomDto);
deleteChatRoomUsers(chatRoomDto.chatRoomId);
insertChatRoomUsers(chatRoomDto.attendUsers, chatRoomDto.chatRoomId); insertChatRoomUsers(chatRoomDto.attendUsers, chatRoomDto.chatRoomId);
} }
update("delete from t_chat_room where chat_room_id NOT IN (" + StringUtil.join(" , ", roomIdList) + ")", null); 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 { ...@@ -187,12 +188,15 @@ public class ChatRoomDao extends AbstractCommunicationDao {
} }
public void insertChatRoomUsers(List<Integer> attendUsers, Integer chatRoomId) { 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) { 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}); 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) { 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()); 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; 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