Commit 74da67a1 by Kang Donghun

CreateRoomUI適用

parent b80b9811
......@@ -33,6 +33,7 @@ public interface ABookCommConstants {
String CHILD_GROUP_LIST = "childGroupList";
String GROUP_USER_LIST = "groupUserList";
String BODY = "body";
String CHECKED = "checked";
String CHAT_ROOM_INFO = "chatRoomInfo";
String ROOM_ID = "roomId";
......
......@@ -113,6 +113,20 @@ public class ShopMemberDao extends AbstractDao {
return list;
}
public List<ShopMemberDto> getSelectedUsers(String userIdList) {
StringBuffer sql = new StringBuffer();
sql.append(" SELECT ");
sql.append(" sm.shop_member_id ");
sql.append(" ,sm.shop_member_name ");
sql.append(" ,sm.profile_url");
sql.append(" FROM ");
sql.append(" m_shop_member AS sm ");
sql.append(" WHERE sm.shop_member_id IN ( "+userIdList+" )");
sql.append(" AND sm.self_flg != 1");
List<ShopMemberDto> list = rawQueryGetDtoList(sql.toString(), new String[]{}, ShopMemberDto.class);
return list;
}
public List<ShopMemberDto> getfavoriteUserList() {
return rawQueryGetDtoList("select * from m_shop_member where favorite_register_date NOT NULL", null, ShopMemberDto.class);
}
......
......@@ -157,6 +157,7 @@ public class CommunicationLogic extends AbstractLogic {
Map<String, Object> myGroupUserMap = new HashMap<String, Object>();
myGroupUserMap.put(ABookCommConstants.KEY.SHOP_MEMBER_ID, groupUser.shopMemberId);
myGroupUserMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, groupUser.shopMemberName);
myGroupUserMap.put(ABookCommConstants.KEY.CHECKED, "");
myGroupUserMap.put(ABookCommConstants.KEY.PROFILE_URL, groupUser.profileUrl);
myGroupUserMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupUser);
if (StringUtil.isNullOrEmpty(groupUser.favoriteRegisterDate)) {
......@@ -271,6 +272,7 @@ public class CommunicationLogic extends AbstractLogic {
List<String> groupPathList = groupDao.getUserGroupPathList(favoriteUser.shopMemberId);
favoriteUserMap.put(ABookCommConstants.KEY.SHOP_MEMBER_ID, favoriteUser.shopMemberId);
favoriteUserMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, favoriteUser.shopMemberName);
favoriteUserMap.put(ABookCommConstants.KEY.CHECKED, "");
favoriteUserMap.put(ABookCommConstants.KEY.PROFILE_URL, favoriteUser.profileUrl);
favoriteUserMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathList);
favoriteUserMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
......@@ -360,6 +362,7 @@ public class CommunicationLogic extends AbstractLogic {
shopMemberMap.put(ABookCommConstants.KEY.SHOP_MEMBER_ID, shopMember.shopMemberId);
shopMemberMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMember.shopMemberName);
shopMemberMap.put(ABookCommConstants.KEY.PROFILE_URL, shopMember.profileUrl);
shopMemberMap.put(ABookCommConstants.KEY.CHECKED, "");
shopMemberMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupDao.getUserGroupPathList(shopMember.shopMemberId));
if (StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate)) {
shopMemberMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
......@@ -504,4 +507,18 @@ public class CommunicationLogic extends AbstractLogic {
chatRoomDao.deleteChatRoom();
shopMemberDao.deleteShopMember();
}
public String getUserList(String userIdList) {
List<ShopMemberDto> selectedUsers = shopMemberDao.getSelectedUsers(userIdList);
JSONArray attendUsers = new JSONArray();
for (ShopMemberDto dto : selectedUsers) {
Map<String, Object> userMap = new HashMap<String, Object>();
userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_ID, dto.shopMemberId);
userMap.put(ABookCommConstants.KEY.PROFILE_URL, dto.profileUrl);
userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, dto.shopMemberName);
JSONObject jsonObject = new JSONObject(userMap);
attendUsers.put(jsonObject);
}
return attendUsers.toString();
};
}
......@@ -13,6 +13,7 @@ import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.webkit.CookieManager;
......@@ -102,6 +103,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
private boolean isOnline;
private Long roomId;
private Integer shopMemberId;
private String selectedUserIdList;
public AlertDialog myAlertDialog;
......@@ -702,6 +704,19 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
}
@JavascriptInterface
public void saveSelectedUserList(String userIdList) {
Log.d("userIdList " , userIdList );
selectedUserIdList = userIdList;
}
@JavascriptInterface
public String getSelectedUserList() {
String userList = communicationLogic.getUserList(selectedUserIdList);
Log.d("getSelectedUserList " , userList );
return userList;
}
@JavascriptInterface
public String getRoomList(String roomType) {
String chatRoomListStr = communicationLogic.getChatRoomList(Integer.parseInt(roomType));
return chatRoomListStr;
......
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