Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abook_check
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abook_android
abook_check
Commits
40c8c327
Commit
40c8c327
authored
Jun 13, 2021
by
Lee Munkyeong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
メッセージ取得修正。
parent
f1076f09
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
0 deletions
+89
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/constant/ABookCommConstants.java
+1
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ChatMessageDao.java
+32
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/CommunicationLogic.java
+29
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/ChatWebViewActivity.java
+27
-0
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/constant/ABookCommConstants.java
View file @
40c8c327
...
...
@@ -146,6 +146,7 @@ public interface ABookCommConstants {
interface
SIZE
{
Integer
MAX_FAVORITE_COUNT
=
100
;
Integer
MESSAGE_PAGING_SIZE
=
20
;
}
String
FILE_SAVE_PATH
=
"/data/user/0/jp.co.agentec.abookplus.check/files/"
;
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ChatMessageDao.java
View file @
40c8c327
...
...
@@ -3,6 +3,7 @@ package jp.agentec.abook.abv.bl.data.dao;
import
java.util.ArrayList
;
import
java.util.List
;
import
jp.agentec.abook.abv.bl.common.constant.ABookCommConstants
;
import
jp.agentec.abook.abv.bl.common.db.Cursor
;
import
jp.agentec.abook.abv.bl.common.log.Logger
;
import
jp.agentec.abook.abv.bl.dto.ChatMessageDto
;
...
...
@@ -107,10 +108,41 @@ public class ChatMessageDao extends AbstractCommunicationDao {
sql
.
append
(
" ON cm.shop_member_id = sm.shop_member_id "
);
sql
.
append
(
" WHERE cm.chat_room_id = ? "
);
sql
.
append
(
" ORDER BY cm.insert_date DESC "
);
sql
.
append
(
" LIMIT "
+
ABookCommConstants
.
SIZE
.
MESSAGE_PAGING_SIZE
);
List
<
ChatMessageDto
>
list
=
rawQueryGetDtoList
(
sql
.
toString
(),
new
String
[]{
""
+
chatRoomId
},
ChatMessageDto
.
class
);
return
list
;
}
public
List
<
ChatMessageDto
>
getChatMessageFromMessageId
(
int
chatRoomId
,
String
MessageId
)
{
StringBuffer
sql
=
new
StringBuffer
();
sql
.
append
(
" SELECT "
);
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 "
);
sql
.
append
(
" ,cm.download_file_name "
);
sql
.
append
(
" ,cm.save_path "
);
sql
.
append
(
" ,cm.insert_date "
);
sql
.
append
(
" ,sm.shop_member_name "
);
sql
.
append
(
" ,sm.profile_url "
);
sql
.
append
(
" ,sm.self_flg "
);
sql
.
append
(
" ,cm.unread_count "
);
sql
.
append
(
" FROM "
);
sql
.
append
(
" t_chat_message AS cm "
);
sql
.
append
(
" INNER JOIN "
);
sql
.
append
(
" m_shop_member AS sm "
);
sql
.
append
(
" ON cm.shop_member_id = sm.shop_member_id "
);
sql
.
append
(
" WHERE cm.chat_room_id = ? "
);
sql
.
append
(
" AND cm.chat_message_id < ? "
);
sql
.
append
(
" ORDER BY cm.insert_date DESC "
);
sql
.
append
(
" LIMIT "
+
ABookCommConstants
.
SIZE
.
MESSAGE_PAGING_SIZE
);
List
<
ChatMessageDto
>
list
=
rawQueryGetDtoList
(
sql
.
toString
(),
new
String
[]{
""
+
chatRoomId
,
""
+
MessageId
},
ChatMessageDto
.
class
);
return
list
;
}
public
List
<
ChatMessageDto
>
searchChatMessage
(
int
chatRoomId
,
String
[]
keywords
,
String
userList
)
{
StringBuffer
sql
=
new
StringBuffer
();
sql
.
append
(
" SELECT "
);
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/CommunicationLogic.java
View file @
40c8c327
...
...
@@ -127,6 +127,35 @@ public class CommunicationLogic extends AbstractLogic {
Map
<
String
,
Object
>
chatMessageMap
=
new
HashMap
<
String
,
Object
>();
chatMessageMap
.
put
(
ABookCommConstants
.
KEY
.
CHAT_ROOM_ID
,
chatMessageDto
.
chatRoomId
);
chatMessageMap
.
put
(
ABookCommConstants
.
KEY
.
LOGIN_ID
,
chatMessageDto
.
shopMemberName
);
chatMessageMap
.
put
(
ABookCommConstants
.
KEY
.
MESSAGE_ID
,
chatMessageDto
.
chatMessageId
);
chatMessageMap
.
put
(
ABookCommConstants
.
KEY
.
SHOP_MEMBER_ID
,
chatMessageDto
.
shopMemberId
);
if
(
ABookCommConstants
.
FLAG
.
MESSAGE_TYPE
.
PHOTO
.
equals
(
chatMessageDto
.
messageType
)
||
ABookCommConstants
.
FLAG
.
MESSAGE_TYPE
.
VIDEO
.
equals
(
chatMessageDto
.
messageType
))
{
chatMessageMap
.
put
(
ABookCommConstants
.
KEY
.
MESSAGE
,
getFileUrlPath
(
chatMessageDto
.
message
));
}
else
{
chatMessageMap
.
put
(
ABookCommConstants
.
KEY
.
MESSAGE
,
chatMessageDto
.
message
);
}
chatMessageMap
.
put
(
ABookCommConstants
.
KEY
.
MESSAGE_TYPE
,
chatMessageDto
.
messageType
);
chatMessageMap
.
put
(
ABookCommConstants
.
KEY
.
INSERT_DATE
,
chatMessageDto
.
insertDate
);
chatMessageMap
.
put
(
ABookCommConstants
.
KEY
.
PROFILE_URL
,
getProfileUrlPath
(
chatMessageDto
.
profileUrl
));
chatMessageMap
.
put
(
ABookCommConstants
.
KEY
.
SELF_FLG
,
chatMessageDto
.
selfFlg
);
chatMessageMap
.
put
(
ABookCommConstants
.
KEY
.
UNREAD_COUNT
,
chatMessageDto
.
unreadCount
);
JSONObject
jsonObject
=
new
JSONObject
(
chatMessageMap
);
resultJsonArray
.
put
(
jsonObject
);
}
String
messageListStr
=
resultJsonArray
.
toString
();
return
messageListStr
;
}
public
String
getMessagesFromMessageId
(
Integer
roomId
,
String
messageId
)
{
List
<
ChatMessageDto
>
chatMessageDtoList
=
chatMessageDao
.
getChatMessageFromMessageId
(
roomId
,
messageId
);
JSONArray
resultJsonArray
=
new
JSONArray
();
for
(
ChatMessageDto
chatMessageDto
:
chatMessageDtoList
)
{
Map
<
String
,
Object
>
chatMessageMap
=
new
HashMap
<
String
,
Object
>();
chatMessageMap
.
put
(
ABookCommConstants
.
KEY
.
CHAT_ROOM_ID
,
chatMessageDto
.
chatRoomId
);
chatMessageMap
.
put
(
ABookCommConstants
.
KEY
.
LOGIN_ID
,
chatMessageDto
.
shopMemberName
);
chatMessageMap
.
put
(
ABookCommConstants
.
KEY
.
MESSAGE_ID
,
chatMessageDto
.
chatMessageId
);
chatMessageMap
.
put
(
ABookCommConstants
.
KEY
.
SHOP_MEMBER_ID
,
chatMessageDto
.
shopMemberId
);
if
(
ABookCommConstants
.
FLAG
.
MESSAGE_TYPE
.
PHOTO
.
equals
(
chatMessageDto
.
messageType
)
||
ABookCommConstants
.
FLAG
.
MESSAGE_TYPE
.
VIDEO
.
equals
(
chatMessageDto
.
messageType
))
{
chatMessageMap
.
put
(
ABookCommConstants
.
KEY
.
MESSAGE
,
getFileUrlPath
(
chatMessageDto
.
message
));
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/ChatWebViewActivity.java
View file @
40c8c327
...
...
@@ -1672,6 +1672,23 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
public
void
finishPip
()
{
finishPIPmode
();
}
@JavascriptInterface
public
void
updatePreMessage
(
String
messageId
)
throws
NetworkDisconnectedException
,
AcmsException
{
if
(
messageId
.
equals
(
"0"
))
{
return
;
}
updateMessageFromMessageId
(
messageId
);
}
@JavascriptInterface
public
String
getMessageListFromMessageId
(
String
messageId
)
{
if
(
messageId
.
equals
(
"0"
))
{
return
""
;
}
String
messageListStr
=
communicationLogic
.
getMessagesFromMessageId
(
roomId
.
intValue
(),
messageId
);
return
messageListStr
;
}
}
/**
...
...
@@ -1995,4 +2012,14 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
UnreadCountJSON
resultJson
=
AcmsClient
.
getInstance
(
ABVEnvironment
.
getInstance
().
networkAdapter
).
getMessagesUnreadCount
(
sid
,
Integer
.
toString
(
roomId
.
intValue
()));
communicationLogic
.
updateUnreadCount
(
resultJson
.
chatMessageDtoArrayList
);
}
public
void
updateMessageFromMessageId
(
String
messageId
)
throws
NetworkDisconnectedException
,
AcmsException
{
MessageInfoListJSON
resultJson
=
AcmsClient
.
getInstance
(
ABVEnvironment
.
getInstance
().
networkAdapter
).
getMessages
(
sid
,
Integer
.
toString
(
roomId
.
intValue
()),
messageId
,
null
);
for
(
ChatMessageDto
chatMessageDto
:
resultJson
.
chatMessageDtoArrayList
)
{
chatMessageDto
.
chatRoomId
=
roomId
.
intValue
();
}
communicationLogic
.
insertMessageList
(
resultJson
.
chatMessageDtoArrayList
);
communicationLogic
.
insertShopMember
(
resultJson
.
shopMemberDtoArrayList
);
updateUnreadCount
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment