Commit 2219b13b by Lee Munkyeong

ホームに戻ってからまたCommに入るとテーブルが初期化される問題対応

parent 7ed25cb6
......@@ -8,6 +8,7 @@ import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.dto.ChatRoomDto;
import jp.agentec.abook.abv.bl.dto.MemberInfoDto;
import jp.agentec.abook.abv.bl.dto.ShopMemberDto;
import jp.agentec.adf.util.CollectionUtil;
import jp.agentec.adf.util.StringUtil;
public class ChatRoomDao extends AbstractDao {
......@@ -170,10 +171,13 @@ public class ChatRoomDao extends AbstractDao {
public void insertChatRoom(List<ChatRoomDto> chatRoomDtoList) {
try {
beginTransaction();
ArrayList<Integer> roomIdList = new ArrayList<Integer>();
for (ChatRoomDto chatRoomDto : chatRoomDtoList) {
roomIdList.add(chatRoomDto.chatRoomId);
insertChatRoom(chatRoomDto);
insertChatRoomUsers(chatRoomDto.attendUsers, chatRoomDto.chatRoomId);
}
update("delete from t_chat_room where chat_room_id NOT IN (" + StringUtil.join(" , ", roomIdList) + ")", null);
commit();
} catch (Exception e) {
rollback();
......
......@@ -865,6 +865,13 @@ public class CommunicationLogic extends AbstractLogic {
archiveDao.deleteArchiveAllData();
}
public void initChatData() {
chatGroupDao.deleteChatGroup();
chatMessageDao.deleteChatMessage();
shopMemberDao.deleteShopMember();
archiveDao.deleteArchiveAllData();
}
public void roomDisplayOff(Integer roomId) {
chatRoomDao.changeRoomViewFlg(roomId);
}
......
......@@ -159,7 +159,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
if (AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).checkSid(sid)) {
isOnline = true;
chatWebviewUrl = CHAT_PAGE_URL;
communicationLogic.clearAllData();
communicationLogic.initChatData();
updateMyInfoFromServer();
updateAllGroupInfo();
updateFavoriteInfo();
......
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