Commit 92a3653d by Lee Munkyeong

Merge branch 'features/#552_タブーを変更すると既存参加者が招待リストに表示される。' into 'features/abcomm_sp6'

招待画面バグ修正

See merge request !120
parents e9ab5777 19a381a8
......@@ -604,6 +604,81 @@ public class CommunicationLogic extends AbstractLogic {
return groupSearchDataStr;
}
public String getGroupSearchDataForAddUser(Integer groupId, Integer roomId) {
//レスポンスになるJSON
JSONObject groupSearchData = new JSONObject();
//パラメータグループIDが0であれば自分のグループ情報を取得。
ChatGroupDto myGroup = chatGroupDao.getMyGroups().get(0);
ChatGroupDto rootGroup = chatGroupDao.getRootGroup();
Integer targetGroupId;
if (groupId == 0) {
targetGroupId = rootGroup.groupId;
} else {
targetGroupId = groupId;
}
ChatGroupDto parentGroup = chatGroupDao.getParentGroup(targetGroupId);
if (parentGroup != null) {
groupSearchData.put(ABookCommConstants.KEY.PARENT_GROUP_ID, parentGroup.groupId);
}
if (rootGroup != null) {
groupSearchData.put(ABookCommConstants.KEY.ROOT_GROUP_ID, rootGroup.groupId);
}
//グループ
List<ChatGroupDto> groupPathList = chatGroupDao.getGroupTree(targetGroupId);
JSONArray groupPathJSONArray = new JSONArray();
for (ChatGroupDto group : groupPathList) {
Map<String, Object> groupTreeMap = new HashMap<String, Object>();
groupTreeMap.put(ABookCommConstants.KEY.GROUP_NAME, group.groupName);
groupTreeMap.put(ABookCommConstants.KEY.GROUP_ID, group.groupId);
JSONObject jsonObject = new JSONObject(groupTreeMap);
groupPathJSONArray.put(jsonObject);
}
groupSearchData.put(ABookCommConstants.KEY.GROUP_PATH_LIST,groupPathJSONArray);
List<ChatGroupDto> childGroupList = chatGroupDao.getGroupChildList(targetGroupId);
JSONArray childGroupJSONArray = new JSONArray();
for (ChatGroupDto group : childGroupList) {
Map<String, Object> groupTreeMap = new HashMap<String, Object>();
groupTreeMap.put(ABookCommConstants.KEY.GROUP_NAME, group.groupName);
groupTreeMap.put(ABookCommConstants.KEY.GROUP_ID, group.groupId);
if (StringUtil.isNullOrEmpty(group.favoriteRegisterDate)) {
groupTreeMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
groupTreeMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
JSONObject jsonObject = new JSONObject(groupTreeMap);
childGroupJSONArray.put(jsonObject);
}
groupSearchData.put(ABookCommConstants.KEY.CHILD_GROUP_LIST,childGroupJSONArray);
List<ShopMemberDto> shopMemberList = shopMemberDao.getUserListNotInRoomByGroupId(targetGroupId, roomId);
JSONArray shopMemberJSONArray = new JSONArray();
for (ShopMemberDto shopMember : shopMemberList) {
Map<String, Object> shopMemberMap = new HashMap<String, Object>();
shopMemberMap.put(ABookCommConstants.KEY.SHOP_MEMBER_ID, shopMember.shopMemberId);
shopMemberMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMember.shopMemberName);
shopMemberMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl));
shopMemberMap.put(ABookCommConstants.KEY.CHECKED, "");
shopMemberMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, chatGroupDao.getUserGroupPathList(shopMember.shopMemberId));
if (StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate)) {
shopMemberMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
shopMemberMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
JSONObject jsonObject = new JSONObject(shopMemberMap);
shopMemberJSONArray.put(jsonObject);
}
groupSearchData.put(ABookCommConstants.KEY.GROUP_USER_LIST,shopMemberJSONArray);
String groupSearchDataStr = groupSearchData.toString();
return groupSearchDataStr;
}
public void insertChatRoomList(List<ChatRoomDto> roomList) {
List<ChatMessageDto> insertMessageList = new ArrayList<ChatMessageDto>();
......
......@@ -821,7 +821,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
@JavascriptInterface
public void createChatRoom(String roomType, String userIdList, String encodedRoomName, String screenFlg) throws NetworkDisconnectedException, AcmsException {
CreatedRoomJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).createRoom(sid, roomType, userIdList, encodedRoomName, loginId);
if ( ABookCommConstants.FLAG.SCREEN_FLG.MAKE_ROOM.equals(Integer.parseInt(screenFlg))) {
if (ABookCommConstants.FLAG.SCREEN_FLG.MAKE_ROOM.equals(Integer.parseInt(screenFlg))) {
ChatRoomDto chatRoomDto = communicationLogic.getChatRoom(resultJson.chatRoomDto.chatRoomId);
if (chatRoomDto != null) {
mChatWebView.post(new Runnable() {
......@@ -1014,6 +1014,12 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
}
@JavascriptInterface
public String getGroupInfoForAddUser(String groupId) {
String groupInfoStr = communicationLogic.getGroupSearchDataForAddUser(Integer.parseInt(groupId), roomId.intValue());
return groupInfoStr;
}
@JavascriptInterface
public String getNameCardData(String shopMemberId) {
String nameCardStr = communicationLogic.getNameCardInfo(Integer.parseInt(shopMemberId));
return nameCardStr;
......
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