Commit 875ce2d7 by Lee Munkyeong

Merge branch 'features/#42559_room_dsplay_flag' into 'features/abcomm_sp6'

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

See merge request !125
parents 4d57563d 7e735805
......@@ -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);
}
......
......@@ -190,7 +190,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
CommonExecutor.execute(new Runnable() {
@Override
public void run() {
communicationLogic.clearAllData();
communicationLogic.initChatData();
try {
updateMyInfoFromServer();
updateAllGroupInfo();
......
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