Commit 5543fb53 by Kang Donghun

Merge branch 'features/abcomm_sp6_collaboration_display_participants' into 'features/abcomm_sp6'

協業記録参加者リスト表示

See merge request !130
parents e52a4f7a 71c61196
......@@ -57,6 +57,7 @@ public class GroupListJSON extends AcmsCommonJSON {
ShopMemberDto shopMemberDto = new ShopMemberDto();
shopMemberDto.shopMemberId = groupMember.getInt(ABookCommConstants.KEY.SHOP_MEMBER_ID);
shopMemberDto.shopMemberName = groupMember.getString(ABookCommConstants.KEY.MEMBER_NAME);
shopMemberDto.loginId = groupMember.getString(ABookCommConstants.KEY.LOGIN_ID);
shopMemberDto.delFlg = groupMember.getInt(ABookCommConstants.KEY.DEL_FLG);
if (groupMember.has(ABookCommConstants.KEY.PROFILE_IMAGE_PATH)) {
shopMemberDto.profileUrl = groupMember.getString(ABookCommConstants.KEY.PROFILE_IMAGE_PATH);
......
......@@ -45,6 +45,7 @@ public class MessageInfoListJSON extends AcmsCommonJSON {
if (messageInfoJSON == null) { continue; }
chatMessageDto.shopMemberId = messageInfoJSON.getInt(ABookCommConstants.KEY.SHOP_MEMBER_ID);
chatMessageDto.loginId = messageInfoJSON.getString(ABookCommConstants.KEY.LOGIN_ID);
chatMessageDto.chatMessageId = messageInfoJSON.getInt(ABookCommConstants.KEY.MESSAGE_ID);
chatMessageDto.messageType = messageInfoJSON.getInt(ABookCommConstants.KEY.MESSAGE_TYPE);
if (ABookCommConstants.FLAG.MESSAGE_TYPE.COLLABORATION_START.equals(chatMessageDto.messageType)
......@@ -65,6 +66,7 @@ public class MessageInfoListJSON extends AcmsCommonJSON {
ShopMemberDto shopMemberDto = new ShopMemberDto();
shopMemberDto.shopMemberId = messageInfoJSON.getInt(ABookCommConstants.KEY.SHOP_MEMBER_ID);
shopMemberDto.shopMemberName = messageInfoJSON.getString(ABookCommConstants.KEY.MEMBER_NAME);
shopMemberDto.loginId = messageInfoJSON.getString(ABookCommConstants.KEY.LOGIN_ID);
if (messageInfoJSON.has(ABookCommConstants.KEY.PROFILE_IMAGE_PATH)) {
shopMemberDto.profileUrl = messageInfoJSON.getString(ABookCommConstants.KEY.PROFILE_IMAGE_PATH);
}
......
......@@ -37,6 +37,9 @@ public class MyInfoJSON extends AcmsCommonJSON {
shopMemberDto.profileUrl = MyInfoJson.getString(ABookCommConstants.KEY.PROFILE_IMAGE_PATH);
shopMemberDto.shopMemberId = MyInfoJson.getInt(ABookCommConstants.KEY.SHOP_MEMBER_ID);
shopMemberDto.shopMemberName = MyInfoJson.getString(ABookCommConstants.KEY.MEMBER_NAME);
if (MyInfoJson.has(ABookCommConstants.KEY.LOGIN_ID)) {
shopMemberDto.loginId = MyInfoJson.getString(ABookCommConstants.KEY.LOGIN_ID);
}
}
}
......@@ -36,6 +36,10 @@ public class ChatMessageDao extends AbstractDao {
if (column != -1) {
dto.shopMemberId = cursor.getInt(column);
}
column = cursor.getColumnIndex("login_id");
if (column != -1) {
dto.loginId = cursor.getString(column);
}
column = cursor.getColumnIndex("message");
if (column != -1) {
dto.message = cursor.getString(column);
......@@ -85,6 +89,7 @@ public class ChatMessageDao extends AbstractDao {
sql.append(" cm.chat_message_id ");
sql.append(" ,cm.chat_room_id ");
sql.append(" ,cm.shop_member_id ");
sql.append(" ,cm.login_id ");
sql.append(" ,cm.message ");
sql.append(" ,cm.message_type ");
sql.append(" ,cm.image_name ");
......@@ -112,6 +117,7 @@ public class ChatMessageDao extends AbstractDao {
sql.append(" cm.chat_message_id ");
sql.append(" ,cm.chat_room_id ");
sql.append(" ,cm.shop_member_id ");
sql.append(" ,cm.login_id ");
sql.append(" ,cm.message ");
sql.append(" ,cm.message_type ");
sql.append(" ,cm.image_name ");
......@@ -149,7 +155,7 @@ public class ChatMessageDao extends AbstractDao {
}
public void insertChatMessage(ChatMessageDto dto) {
insert("insert or replace into t_chat_message (chat_message_id, chat_room_id, shop_member_id, message, message_type, image_name, download_file_name, save_path, insert_date, unread_count) values (?,?,?,?,?,?,?,?,?,?)", dto.getInsertValues());
insert("insert or replace into t_chat_message (chat_message_id, chat_room_id, shop_member_id, login_id, message, message_type, image_name, download_file_name, save_path, insert_date, unread_count) values (?,?,?,?,?,?,?,?,?,?,?)", dto.getInsertValues());
}
public void insertChatMessage(List<ChatMessageDto> chatMessageDtoList) {
......@@ -167,7 +173,7 @@ public class ChatMessageDao extends AbstractDao {
}
public boolean updateChatMessage(ChatMessageDto dto) {
long count = update("update t_chat_message set chat_room_id=?, shop_member_id=?, message=?, message_type=?, image_name=?, download_file_name=?, save_path=?, insert_date=?, unread_count where chat_message_id=?", dto.getUpdateValues());
long count = update("update t_chat_message set chat_room_id=?, shop_member_id=?, login_id=?,message=?, message_type=?, image_name=?, download_file_name=?, save_path=?, insert_date=?, unread_count where chat_message_id=?", dto.getUpdateValues());
return count > 0;
}
......
......@@ -37,6 +37,10 @@ public class ShopMemberDao extends AbstractDao {
if (column != -1) {
dto.shopMemberName = cursor.getString(column);
}
column = cursor.getColumnIndex("login_id");
if (column != -1) {
dto.loginId = cursor.getString(column);
}
column = cursor.getColumnIndex("profile_url");
if (column != -1) {
dto.profileUrl = cursor.getString(column);
......@@ -64,7 +68,7 @@ public class ShopMemberDao extends AbstractDao {
public void insertShopMember(ShopMemberDto dto) {
try {
beginTransaction();
insert("insert or replace into m_shop_member (shop_member_id, shop_member_name, profile_url, self_flg, favorite_register_date) values (?,?,?,?,(select favorite_register_date from m_shop_member where shop_member_id = ?))", dto.getInsertValues());
insert("insert or replace into m_shop_member (shop_member_id, shop_member_name, login_id, profile_url, self_flg, favorite_register_date) values (?,?,?,?,?,(select favorite_register_date from m_shop_member where shop_member_id = ?))", dto.getInsertValues());
update(" delete from r_shop_member_group WHERE shop_member_id = ? ", new Integer[]{dto.shopMemberId});
for (Integer groupId : dto.groupIdList) {
......@@ -83,7 +87,7 @@ public class ShopMemberDao extends AbstractDao {
try {
beginTransaction();
for (ShopMemberDto dto : dtoList) {
insert("insert or replace into m_shop_member (shop_member_id, shop_member_name, profile_url, self_flg, favorite_register_date) values (?,?,?,?, (select favorite_register_date from m_shop_member where shop_member_id = ?))", dto.getInsertValues());
insert("insert or replace into m_shop_member (shop_member_id, shop_member_name, login_id, profile_url, self_flg, favorite_register_date) values (?,?,?,?,?, (select favorite_register_date from m_shop_member where shop_member_id = ?))", dto.getInsertValues());
if (dto.groupIdList == null) { continue; }
for (Integer groupId : dto.groupIdList) {
insert("insert or replace into r_shop_member_group (shop_member_id, group_id) values ("+dto.shopMemberId+",?)", new Integer[]{groupId});
......@@ -143,6 +147,33 @@ public class ShopMemberDao extends AbstractDao {
return list;
}
public List<ShopMemberDto> getUserListByLoginId(String[] loginIdList) {
StringBuffer sql = new StringBuffer();
sql.append(" SELECT ");
sql.append(" sm.shop_member_id ");
sql.append(" ,sm.shop_member_name ");
sql.append(" ,sm.login_id ");
sql.append(" ,sm.profile_url");
sql.append(" FROM ");
sql.append(" m_shop_member AS sm ");
sql.append(" WHERE ");
sql.append(" sm.login_id IN (");
ArrayList<String> whereSqlList = new ArrayList<String>();
for (String loginId : loginIdList) {
if (StringUtil.isNullOrEmpty(loginId)){
continue;
}
String whereSql = "'"+loginId+"' ";
whereSqlList.add(whereSql);
}
if (CollectionUtil.isNotEmpty(whereSqlList)) {
sql.append(StringUtil.join(" , ", whereSqlList) + ")");
}
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);
}
......@@ -323,6 +354,19 @@ public class ShopMemberDao extends AbstractDao {
return list;
}
public List<ShopMemberDto> getCollaborationMemberList(Integer collaborationDetailId) {
StringBuffer sql = new StringBuffer();
sql.append(" SELECT sm.* ");
sql.append(" FROM ");
sql.append(" m_shop_member AS sm ");
sql.append(" INNER JOIN r_chat_collaboration_member AS rccm ");
sql.append(" ON sm.shop_member_id = rccm.shop_member_id ");
sql.append(" WHERE rccm.chat_collaboration_detail_id =?");
sql.append(" ORDER BY sm.shop_member_name DESC ");
List<ShopMemberDto> list = rawQueryGetDtoList(sql.toString(), new String[]{""+ collaborationDetailId}, ShopMemberDto.class);
return list;
}
public boolean updateShopMember(ShopMemberDto dto) {
long count = update("update m_shop_member set shop_member_name=?, profile_url=? where shop_member_id=?", dto.getUpdateValues());
return count > 0;
......
......@@ -18,6 +18,7 @@ public class MShopMember extends SQLiteTableScript {
sql.append(" create table m_shop_member ( ");
sql.append(" shop_member_id INTEGER NOT NULL ");
sql.append(" , shop_member_name VARCHAR(64) ");
sql.append(" , login_id VARCHAR(64) ");
sql.append(" , profile_url VARCHAR(64) ");
sql.append(" , favorite_register_date VARCHAR2(64) ");
sql.append(" , self_flg INTEGER NOT NULL ");
......
......@@ -19,6 +19,7 @@ public class TChatMessage extends SQLiteTableScript {
sql.append(" chat_message_id INTEGER NOT NULL ");
sql.append(" , chat_room_id INTEGER NOT NULL ");
sql.append(" , shop_member_id INTEGER NOT NULL ");
sql.append(" , login_id VARCHAR2 ");
sql.append(" , message VARCHAR2 ");
sql.append(" , message_type INTEGER ");
sql.append(" , image_name VARCHAR2 ");
......
......@@ -4,6 +4,7 @@ public class ChatMessageDto extends AbstractDto {
public Integer chatMessageId;
public Integer chatRoomId;
public Integer shopMemberId;
public String loginId;
public String message;
public Integer messageType;
public String imageName;
......@@ -17,12 +18,12 @@ public class ChatMessageDto extends AbstractDto {
@Override
public Object[] getInsertValues() {
return new Object[] { chatMessageId, chatRoomId, shopMemberId, message, messageType, imageName, downloadFileName, savePath, insertDate, unreadCount };
return new Object[] { chatMessageId, chatRoomId, shopMemberId, loginId, message, messageType, imageName, downloadFileName, savePath, insertDate, unreadCount };
}
@Override
public Object[] getUpdateValues() {
return new Object[] { chatRoomId, shopMemberId, message, messageType, imageName, downloadFileName, savePath, insertDate, unreadCount, chatMessageId };
return new Object[] { chatRoomId, shopMemberId, loginId, message, messageType, imageName, downloadFileName, savePath, insertDate, unreadCount, chatMessageId };
}
@Override
......
......@@ -6,6 +6,7 @@ import java.util.Date;
public class ShopMemberDto extends AbstractDto {
public Integer shopMemberId;
public String shopMemberName;
public String loginId;
public String profileUrl;
public String favoriteRegisterDate;
public Integer selfFlg;
......@@ -14,7 +15,7 @@ public class ShopMemberDto extends AbstractDto {
@Override
public Object[] getInsertValues() {
return new Object[] { shopMemberId, shopMemberName, profileUrl, selfFlg , shopMemberId};
return new Object[] { shopMemberId, shopMemberName, loginId, profileUrl, selfFlg , shopMemberId};
}
@Override
......
......@@ -12,6 +12,7 @@ import java.util.Map;
import java.util.stream.Collectors;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.common.util.JsonUtil;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.ArchiveDao;
......@@ -30,6 +31,7 @@ import jp.agentec.adf.util.ArrayUtil;
import jp.agentec.adf.util.CollectionUtil;
import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.StringUtil;
import sun.rmi.runtime.Log;
/**
* @author Lee-mk
......@@ -208,6 +210,28 @@ public class CommunicationLogic extends AbstractLogic {
return myInfoStr;
}
public String getUserListByLoginId(String loginIdList) {
if (loginIdList == null) {
return null;
}
String[] userIdArray = loginIdList.split(",");
List<ShopMemberDto> shopMemberDtoList = shopMemberDao.getUserListByLoginId(userIdArray);
JSONArray joinedMemberArray = new JSONArray();
for (ShopMemberDto dto : shopMemberDtoList) {
Map<String, Object> joinedMemberMap = new HashMap<String, Object>();
joinedMemberMap.put(ABookCommConstants.KEY.SHOP_MEMBER_ID, dto.shopMemberId);
joinedMemberMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, dto.shopMemberName);
joinedMemberMap.put(ABookCommConstants.KEY.LOGIN_ID, dto.loginId);
joinedMemberMap.put(ABookCommConstants.KEY.PROFILE_URL, dto.profileUrl);
JSONObject myInfoJson = new JSONObject(joinedMemberMap);
joinedMemberArray.put(myInfoJson);
}
String myInfoStr = joinedMemberArray.toString();
return myInfoStr;
}
public String getMyGroupUsers() {
List<ChatGroupDto> myGroupIds = chatGroupDao.getMyGroups();
JSONArray myGroupUsersJson = new JSONArray();
......@@ -1024,4 +1048,19 @@ public class CommunicationLogic extends AbstractLogic {
}
return resultJsonArray.toString();
}
public String getCollaborationMemberList(Integer collaborationDetailId) {
List<ShopMemberDto> shopMemberDtoListDtoList = shopMemberDao.getCollaborationMemberList(collaborationDetailId);
JSONArray resultJsonArray = new JSONArray();
for (ShopMemberDto dto : shopMemberDtoListDtoList) {
Map<String, Object> userMap = new HashMap<String, Object>();
userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_ID, dto.shopMemberId);
userMap.put(ABookCommConstants.KEY.LOGIN_ID, dto.loginId);
userMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(dto.profileUrl));
userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, dto.shopMemberName);
JSONObject jsonObject = new JSONObject(userMap);
resultJsonArray.put(jsonObject);
}
return resultJsonArray.toString();
}
}
......@@ -1328,6 +1328,11 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
public String getContentList() {
return communicationLogic.getContentList();
}
@JavascriptInterface
public String getUserListByLoginId(String loginIdList) {
return communicationLogic.getUserListByLoginId(loginIdList);
}
}
/**
......
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