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; ...@@ -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.ChatRoomDto;
import jp.agentec.abook.abv.bl.dto.MemberInfoDto; import jp.agentec.abook.abv.bl.dto.MemberInfoDto;
import jp.agentec.abook.abv.bl.dto.ShopMemberDto; import jp.agentec.abook.abv.bl.dto.ShopMemberDto;
import jp.agentec.adf.util.CollectionUtil;
import jp.agentec.adf.util.StringUtil; import jp.agentec.adf.util.StringUtil;
public class ChatRoomDao extends AbstractDao { public class ChatRoomDao extends AbstractDao {
...@@ -170,10 +171,13 @@ public class ChatRoomDao extends AbstractDao { ...@@ -170,10 +171,13 @@ public class ChatRoomDao extends AbstractDao {
public void insertChatRoom(List<ChatRoomDto> chatRoomDtoList) { public void insertChatRoom(List<ChatRoomDto> chatRoomDtoList) {
try { try {
beginTransaction(); beginTransaction();
ArrayList<Integer> roomIdList = new ArrayList<Integer>();
for (ChatRoomDto chatRoomDto : chatRoomDtoList) { for (ChatRoomDto chatRoomDto : chatRoomDtoList) {
roomIdList.add(chatRoomDto.chatRoomId);
insertChatRoom(chatRoomDto); insertChatRoom(chatRoomDto);
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);
commit(); commit();
} catch (Exception e) { } catch (Exception e) {
rollback(); rollback();
......
...@@ -865,6 +865,13 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -865,6 +865,13 @@ public class CommunicationLogic extends AbstractLogic {
archiveDao.deleteArchiveAllData(); archiveDao.deleteArchiveAllData();
} }
public void initChatData() {
chatGroupDao.deleteChatGroup();
chatMessageDao.deleteChatMessage();
shopMemberDao.deleteShopMember();
archiveDao.deleteArchiveAllData();
}
public void roomDisplayOff(Integer roomId) { public void roomDisplayOff(Integer roomId) {
chatRoomDao.changeRoomViewFlg(roomId); chatRoomDao.changeRoomViewFlg(roomId);
} }
......
...@@ -190,7 +190,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -190,7 +190,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
CommonExecutor.execute(new Runnable() { CommonExecutor.execute(new Runnable() {
@Override @Override
public void run() { public void run() {
communicationLogic.clearAllData(); communicationLogic.initChatData();
try { try {
updateMyInfoFromServer(); updateMyInfoFromServer();
updateAllGroupInfo(); 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