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
b80b9811
Commit
b80b9811
authored
Mar 30, 2021
by
Lee Munkyeong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Chat UI
parent
00d90361
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
18 deletions
+51
-18
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ChatRoomDao.java
+1
-1
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ShopMemberDao.java
+2
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/CommunicationLogic.java
+7
-1
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/ChatWebviewActivity.java
+28
-15
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/LoginActivity.java
+13
-1
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ChatRoomDao.java
View file @
b80b9811
...
...
@@ -127,8 +127,8 @@ public class ChatRoomDao extends AbstractDao {
public
void
deleteChatRoom
()
{
try
{
beginTransaction
();
delete
(
"t_chat_room"
,
null
,
null
);
delete
(
"r_chat_room_shop_member"
,
null
,
null
);
delete
(
"t_chat_room"
,
null
,
null
);
commit
();
}
catch
(
Exception
e
)
{
rollback
();
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ShopMemberDao.java
View file @
b80b9811
...
...
@@ -202,6 +202,8 @@ public class ShopMemberDao extends AbstractDao {
public
void
deleteShopMember
()
{
try
{
beginTransaction
();
delete
(
"r_collaboration_member"
,
null
,
null
);
delete
(
"r_shop_member_group"
,
null
,
null
);
delete
(
"m_shop_member"
,
null
,
null
);
commit
();
}
catch
(
Exception
e
)
{
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/CommunicationLogic.java
View file @
b80b9811
...
...
@@ -106,7 +106,7 @@ public class CommunicationLogic extends AbstractLogic {
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_
IMAGE_PATH
,
chatMessageDto
.
profileUrl
);
chatMessageMap
.
put
(
ABookCommConstants
.
KEY
.
PROFILE_
URL
,
chatMessageDto
.
profileUrl
);
chatMessageMap
.
put
(
ABookCommConstants
.
KEY
.
SELF_FLG
,
chatMessageDto
.
selfFlg
);
JSONObject
jsonObject
=
new
JSONObject
(
chatMessageMap
);
resultJsonArray
.
put
(
jsonObject
);
...
...
@@ -498,4 +498,10 @@ public class CommunicationLogic extends AbstractLogic {
}
groupDao
.
updateFavoriteGroupList
(
groupDtos
);
}
public
void
clearAllData
()
{
chatMessageDao
.
deleteChatMessage
();
chatRoomDao
.
deleteChatRoom
();
shopMemberDao
.
deleteShopMember
();
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/ChatWebviewActivity.java
View file @
b80b9811
...
...
@@ -51,6 +51,7 @@ import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
import
jp.agentec.abook.abv.bl.common.log.Logger
;
import
jp.agentec.abook.abv.bl.data.ABVDataCache
;
import
jp.agentec.abook.abv.bl.dto.ChatMessageDto
;
import
jp.agentec.abook.abv.bl.dto.ChatRoomDto
;
import
jp.agentec.abook.abv.bl.dto.GroupDto
;
import
jp.agentec.abook.abv.bl.dto.PushMessageDto
;
import
jp.agentec.abook.abv.bl.dto.ShopMemberDto
;
...
...
@@ -746,6 +747,19 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
}
@JavascriptInterface
public
void
joinRoom
(
String
joinRoomId
,
String
joinRoomName
)
{
roomId
=
Long
.
parseLong
(
joinRoomId
);
roomName
=
joinRoomName
;
System
.
out
.
println
(
"-----------joinROOM ON android-------"
+
roomId
+
"-"
+
roomName
);
mChatWebView
.
post
(
new
Runnable
()
{
@Override
public
void
run
()
{
mChatWebView
.
loadUrl
(
CHAT_ROOM_PAGE_URL
);
}
});
}
@JavascriptInterface
public
void
updateMessages
(
String
roomId
)
throws
NetworkDisconnectedException
,
AcmsException
{
MessageInfoListJSON
resultJson
=
AcmsClient
.
getInstance
(
ABVEnvironment
.
getInstance
().
networkAdapter
).
getMessages
(
sid
,
roomId
);
...
...
@@ -769,19 +783,6 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
}
@JavascriptInterface
public
void
joinRoom
(
String
joinRoomId
,
String
joinRoomName
)
{
roomId
=
Long
.
parseLong
(
joinRoomId
);
roomName
=
joinRoomName
;
System
.
out
.
println
(
"-----------joinROOM ON android-------"
+
roomId
+
"-"
+
roomName
);
mChatWebView
.
post
(
new
Runnable
()
{
@Override
public
void
run
()
{
mChatWebView
.
loadUrl
(
CHAT_ROOM_PAGE_URL
);
}
});
}
@JavascriptInterface
public
String
getMyInfo
()
{
String
myInfoStr
=
communicationLogic
.
getMyInfo
();
return
myInfoStr
;
...
...
@@ -917,8 +918,10 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
private
void
updateMyInfoFromServer
()
throws
NetworkDisconnectedException
,
AcmsException
{
MyInfoJSON
resultJson
=
AcmsClient
.
getInstance
(
ABVEnvironment
.
getInstance
().
networkAdapter
).
getMyInfo
(
sid
);
if
(
resultJson
.
shopMemberDto
!=
null
)
{
communicationLogic
.
insertMyInfo
(
resultJson
.
shopMemberDto
);
}
}
private
void
updateUserInfoFromServer
(
String
shopMemberId
)
throws
NetworkDisconnectedException
,
AcmsException
{
MyInfoJSON
resultJson
=
AcmsClient
.
getInstance
(
ABVEnvironment
.
getInstance
().
networkAdapter
).
getNameCard
(
sid
,
shopMemberId
);
...
...
@@ -927,6 +930,10 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
private
boolean
insertFavoriteUser
(
String
shopMemberId
)
throws
NetworkDisconnectedException
,
AcmsException
{
boolean
result
=
AcmsClient
.
getInstance
(
ABVEnvironment
.
getInstance
().
networkAdapter
).
insertFavoriteUser
(
sid
,
Integer
.
parseInt
(
shopMemberId
));
if
(!
result
)
{
return
false
;
}
List
<
Integer
>
shopMeberIds
=
new
ArrayList
<>();
shopMeberIds
.
add
(
Integer
.
parseInt
(
shopMemberId
));
communicationLogic
.
updateFavoriteUser
(
shopMeberIds
);
return
result
;
}
...
...
@@ -962,10 +969,12 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
for
(
String
groupId
:
groupIds
.
split
(
","
))
{
checkSumList
.
add
(
pref
.
getString
(
groupId
,
DEFAULT_CHECKSUM
));
}
String
checkSumListStr
=
StringUtil
.
join
(
","
,
checkSumList
);
if
(
groupIds
.
equals
(
ABookCommConstants
.
FLAG
.
GROUP_REQUEST_ALL
.
toString
()))
{
checkSumListStr
=
DEFAULT_CHECKSUM
;
}
try
{
GroupListJSON
resultJson
=
AcmsClient
.
getInstance
(
ABVEnvironment
.
getInstance
().
networkAdapter
).
getGroupInfo
(
sid
,
groupIds
,
checkSumListStr
);
if
(
CollectionUtil
.
isNotEmpty
(
resultJson
.
groupList
))
{
SharedPreferences
.
Editor
editor
=
pref
.
edit
();
communicationLogic
.
updateGroup
(
resultJson
.
groupList
);
...
...
@@ -978,6 +987,10 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
}
editor
.
commit
();
}
}
catch
(
AcmsException
e
)
{
e
.
printStackTrace
();
}
}
private
void
updateFavoriteUser
()
throws
NetworkDisconnectedException
,
AcmsException
{
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/LoginActivity.java
View file @
b80b9811
...
...
@@ -10,6 +10,7 @@ import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import
jp.agentec.abook.abv.bl.common.CommonExecutor
;
import
jp.agentec.abook.abv.bl.common.Constant
;
import
jp.agentec.abook.abv.bl.common.Constant.ExceptionDetailMessage
;
import
jp.agentec.abook.abv.bl.common.constant.ABookCommConstants
;
import
jp.agentec.abook.abv.bl.common.exception.ABVException
;
import
jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode
;
import
jp.agentec.abook.abv.bl.common.exception.AcmsException
;
...
...
@@ -24,6 +25,7 @@ import jp.agentec.abook.abv.bl.download.ContentRefresher;
import
jp.agentec.abook.abv.bl.dto.MemberInfoDto
;
import
jp.agentec.abook.abv.bl.dto.PasswordLockInfoDto
;
import
jp.agentec.abook.abv.bl.logic.AbstractLogic
;
import
jp.agentec.abook.abv.bl.logic.CommunicationLogic
;
import
jp.agentec.abook.abv.bl.logic.ContractLogic
;
import
jp.agentec.abook.abv.bl.logic.OperationLogic
;
import
jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic
;
...
...
@@ -41,6 +43,7 @@ import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import
jp.agentec.adf.util.StringUtil
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.content.SharedPreferences
;
import
android.content.SharedPreferences.Editor
;
import
android.os.Bundle
;
import
android.view.Gravity
;
...
...
@@ -66,7 +69,7 @@ public class LoginActivity extends ABVLoginActivity {
private
static
final
String
TAG
=
"LoginActivity"
;
private
UserAuthenticateLogic
userAuthenticateLogic
;
private
CommunicationLogic
communicationLogic
;
private
MemberInfoDao
memberInfoDao
;
private
ContractLogic
contractLogic
;
...
...
@@ -99,6 +102,7 @@ public class LoginActivity extends ABVLoginActivity {
contractLogic
=
AbstractLogic
.
getLogic
(
ContractLogic
.
class
);
userAuthenticateLogic
=
AbstractLogic
.
getLogic
(
UserAuthenticateLogic
.
class
);
communicationLogic
=
AbstractLogic
.
getLogic
(
CommunicationLogic
.
class
);
memberInfoDao
=
AbstractDao
.
getDao
(
MemberInfoDao
.
class
);
imm
=
(
InputMethodManager
)
getSystemService
(
INPUT_METHOD_SERVICE
);
...
...
@@ -635,6 +639,7 @@ public class LoginActivity extends ABVLoginActivity {
// ユーザ変更があった場合、チャットのルーム情報をクリアする
clearChatLastRoom
();
abookCommClear
();
//ユーザ変更があった場合、FetchDateをクリアする
AcmsDao
dao
=
AbstractDao
.
getDao
(
AcmsDao
.
class
);
...
...
@@ -715,4 +720,11 @@ public class LoginActivity extends ABVLoginActivity {
// 最後のチャットのルーム
PreferenceUtil
.
putUserPref
(
getApplicationContext
(),
UserPrefKey
.
CHAT_LAST_ROOMID
,
""
);
}
// AbookComm関連のデータをクリア
private
void
abookCommClear
()
{
//CheckSumクリア
deleteSharedPreferences
(
ABookCommConstants
.
TAG
);
communicationLogic
.
clearAllData
();
}
}
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