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
8a7b628a
Commit
8a7b628a
authored
Jun 11, 2021
by
Lee Munkyeong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
性能改善
parent
f4db91dd
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
29 additions
and
54 deletions
+29
-54
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/AcmsClient.java
+2
-3
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/GroupListJSON.java
+3
-9
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/parameters/GetGroupInfoParameters.java
+1
-2
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/constant/ABookCommConstants.java
+3
-1
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ChatGroupDao.java
+1
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ShopMemberDao.java
+1
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/CommunicationLogic.java
+11
-5
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/ChatWebViewActivity.java
+7
-34
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/AcmsClient.java
View file @
8a7b628a
...
...
@@ -597,14 +597,13 @@ public class AcmsClient implements AcmsClientResponseListener {
* 全てのグループ更新。
*
* @param sid
* @param groupId
* @param updatedDate
* @return
* @throws NetworkDisconnectedException
* @throws AcmsException
*/
public
GroupListJSON
getGroupInfo
(
String
sid
,
String
groupId
,
String
updatedDate
)
throws
NetworkDisconnectedException
,
AcmsException
{
HttpResponse
response
=
send
(
AcmsApis
.
ApigetUser
,
new
GetGroupInfoParameters
(
sid
,
AcmsApis
.
UserCmds
.
getGroupInfo
,
groupId
,
updatedDate
));
public
GroupListJSON
getGroupInfo
(
String
sid
,
String
updatedDate
)
throws
NetworkDisconnectedException
,
AcmsException
{
HttpResponse
response
=
send
(
AcmsApis
.
ApigetUser
,
new
GetGroupInfoParameters
(
sid
,
AcmsApis
.
UserCmds
.
getGroupInfo
,
updatedDate
));
GroupListJSON
json
=
new
GroupListJSON
(
response
.
httpResponseBody
);
return
json
;
}
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/GroupListJSON.java
View file @
8a7b628a
...
...
@@ -15,7 +15,7 @@ public class GroupListJSON extends AcmsCommonJSON {
public
ArrayList
<
ChatGroupDto
>
groupList
;
public
String
allGroupLastUpdate
Date
;
public
String
lastRequest
Date
;
public
GroupListJSON
(
String
jsonString
)
throws
AcmsException
{
super
(
jsonString
);
...
...
@@ -46,9 +46,6 @@ public class GroupListJSON extends AcmsCommonJSON {
}
groupDto
.
groupName
=
groupJSON
.
getString
(
ABookCommConstants
.
KEY
.
GROUP_NAME
);
groupDto
.
delFlg
=
groupJSON
.
getInt
(
ABookCommConstants
.
KEY
.
DEL_FLG
);
if
(
groupJSON
.
has
(
ABookCommConstants
.
KEY
.
GROUP_INFO_LAST_UPDATE_DATE
))
{
groupDto
.
updateDate
=
groupJSON
.
getString
(
ABookCommConstants
.
KEY
.
GROUP_INFO_LAST_UPDATE_DATE
);
}
if
(
groupJSON
.
has
(
ABookCommConstants
.
KEY
.
GROUP_MEMBER_LIST
))
{
JSONArray
groupMemberJsonArray
=
groupJSON
.
getJSONArray
(
ABookCommConstants
.
KEY
.
GROUP_MEMBER_LIST
);
ArrayList
<
ShopMemberDto
>
groupMembers
=
new
ArrayList
<
ShopMemberDto
>();
...
...
@@ -62,17 +59,14 @@ public class GroupListJSON extends AcmsCommonJSON {
if
(
groupMember
.
has
(
ABookCommConstants
.
KEY
.
PROFILE_IMAGE_PATH
))
{
shopMemberDto
.
profileUrl
=
groupMember
.
getString
(
ABookCommConstants
.
KEY
.
PROFILE_IMAGE_PATH
);
}
// ArrayList groupIds = new ArrayList();
// groupIds.add(groupDto.groupId);
// shopMemberDto.groupIdList = groupIds;
groupMembers
.
add
(
shopMemberDto
);
}
groupDto
.
groupMembers
=
groupMembers
;
}
groupList
.
add
(
groupDto
);
}
if
(
json
.
getJSONObject
(
ABookCommConstants
.
KEY
.
BODY
).
has
(
ABookCommConstants
.
KEY
.
GROUP_INFO_LAST_UPDATE
_DATE
))
{
allGroupLastUpdateDate
=
json
.
getJSONObject
(
ABookCommConstants
.
KEY
.
BODY
).
getString
(
ABookCommConstants
.
KEY
.
GROUP_INFO_LAST_UPDATE
_DATE
);
if
(
json
.
getJSONObject
(
ABookCommConstants
.
KEY
.
BODY
).
has
(
ABookCommConstants
.
KEY
.
LAST_REQUEST
_DATE
))
{
lastRequestDate
=
json
.
getJSONObject
(
ABookCommConstants
.
KEY
.
BODY
).
getString
(
ABookCommConstants
.
KEY
.
LAST_REQUEST
_DATE
);
}
}
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/parameters/GetGroupInfoParameters.java
View file @
8a7b628a
...
...
@@ -38,10 +38,9 @@ public class GetGroupInfoParameters extends HttpParameterObject {
this
.
cmd
=
cmd
;
}
public
GetGroupInfoParameters
(
String
sid
,
String
cmd
,
String
groupId
,
String
updatedDate
)
{
public
GetGroupInfoParameters
(
String
sid
,
String
cmd
,
String
updatedDate
)
{
this
.
sid
=
sid
;
this
.
cmd
=
cmd
;
this
.
groupIds
=
groupId
;
this
.
updatedDate
=
updatedDate
;
}
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/constant/ABookCommConstants.java
View file @
8a7b628a
...
...
@@ -55,7 +55,7 @@ public interface ABookCommConstants {
String
LAST_MESSAGE_INFO
=
"lastMessageInfo"
;
String
FAVORITE_USER_IDS
=
"favoriteUserIds"
;
String
FAVORITE_GROUP_IDS
=
"favoriteGroupIds"
;
String
GROUP_INFO_LAST_UPDATE_DATE
=
"groupInfoLastUpdate
Date"
;
String
LAST_REQUEST_DATE
=
"lastRequest
Date"
;
String
ARCHIVE_INFO_LIST
=
"archiveInfoList"
;
String
ARCHIVE_INFO
=
"archiveInfo"
;
...
...
@@ -80,6 +80,8 @@ public interface ABookCommConstants {
String
MY_SHOPE_MEMBER_ID
=
"myShopMemberId"
;
String
ROOT_GROUP_ID
=
"rootGroupId"
;
String
GROUP_MEMBER_UPDATED_DATE
=
"groupMemberUpdatedDate"
;
String
HTTP_STATUS
=
"httpStatus"
;
interface
API_KIND
{
String
USER
=
"user"
;
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ChatGroupDao.java
View file @
8a7b628a
...
...
@@ -283,6 +283,7 @@ public class ChatGroupDao extends AbstractCommunicationDao {
beginTransaction
();
for
(
ChatGroupDto
groupDto
:
groupList
)
{
update
(
sql
.
toString
(),
new
Object
[]
{
groupDto
.
groupId
});
update
(
"delete from r_shop_member_group where group_id = ? "
,
new
Object
[]
{
groupDto
.
groupId
});
}
commit
();
}
catch
(
Exception
e
)
{
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ShopMemberDao.java
View file @
8a7b628a
...
...
@@ -107,6 +107,7 @@ public class ShopMemberDao extends AbstractCommunicationDao {
public
void
insertShopMemberGroupRelation
(
Integer
groupId
,
List
<
ShopMemberDto
>
dtoList
)
{
try
{
update
(
"delete from r_shop_member_group where group_id = ? "
,
new
Object
[]
{
groupId
});
for
(
ShopMemberDto
dto
:
dtoList
)
{
insert
(
"insert or replace into r_shop_member_group (shop_member_id, group_id) values ("
+
dto
.
shopMemberId
+
",?)"
,
new
Integer
[]{
groupId
});
}
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/CommunicationLogic.java
View file @
8a7b628a
...
...
@@ -827,8 +827,8 @@ public class CommunicationLogic extends AbstractLogic {
}
public
void
updateGroup
(
List
<
ChatGroupDto
>
GroupList
)
{
List
<
ChatGroupDto
>
existGroupList
=
chatGroupDao
.
getAllGroups
();
Map
<
Integer
,
ChatGroupDto
>
existGroupMap
=
convertGroupListToMap
(
existGroupList
);
ArrayList
<
ChatGroupDto
>
insertGroupList
=
new
ArrayList
<
ChatGroupDto
>();
ArrayList
<
ChatGroupDto
>
deleteGroupList
=
new
ArrayList
<
ChatGroupDto
>();
ArrayList
<
ChatGroupDto
>
updateGroupList
=
new
ArrayList
<
ChatGroupDto
>();
...
...
@@ -838,7 +838,7 @@ public class CommunicationLogic extends AbstractLogic {
deleteGroupList
.
add
(
chatGroupDto
);
continue
;
}
if
(
chatGroupDao
.
getGroup
(
chatGroupDto
.
groupId
)
==
null
)
{
if
(
existGroupMap
.
get
(
chatGroupDto
.
groupId
)
==
null
)
{
insertGroupList
.
add
(
chatGroupDto
);
}
else
{
updateGroupList
.
add
(
chatGroupDto
);
...
...
@@ -847,13 +847,11 @@ public class CommunicationLogic extends AbstractLogic {
continue
;
}
groupMembersMap
.
put
(
chatGroupDto
.
groupId
,
chatGroupDto
.
groupMembers
);
//insertShopMember(chatGroupDto.groupMembers);
}
insertShopMemberByMap
(
groupMembersMap
);
chatGroupDao
.
insertGroupList
(
insertGroupList
);
chatGroupDao
.
updateGroupList
(
updateGroupList
);
chatGroupDao
.
deleteGroupList
(
deleteGroupList
);
insertShopMemberByMap
(
groupMembersMap
);
}
public
ShopMemberDto
getMyShopMemberDto
()
{
...
...
@@ -1083,4 +1081,12 @@ public class CommunicationLogic extends AbstractLogic {
}
return
resultJsonArray
.
toString
();
}
public
Map
<
Integer
,
ChatGroupDto
>
convertGroupListToMap
(
List
<
ChatGroupDto
>
groupList
)
{
Map
<
Integer
,
ChatGroupDto
>
map
=
new
HashMap
<
Integer
,
ChatGroupDto
>();
for
(
ChatGroupDto
group
:
groupList
)
{
map
.
put
(
group
.
groupId
,
group
);
}
return
map
;
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/ChatWebViewActivity.java
View file @
8a7b628a
...
...
@@ -229,7 +229,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
CommonExecutor
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
communicationLogic
.
initChatData
();
try
{
updateMyInfoFromServer
();
updateAllGroupInfo
();
...
...
@@ -1023,14 +1022,8 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
}
@JavascriptInterface
public
void
updateGroupInfo
(
String
groupId
)
throws
NetworkDisconnectedException
,
AcmsException
{
updateGroupInfoFromServer
(
groupId
);
}
@JavascriptInterface
public
void
updateGroupUser
()
throws
NetworkDisconnectedException
,
AcmsException
{
updateGroupInfoFromServer
(
communicationLogic
.
getMyGroupIds
());
updateGroupInfoFromServer
();
}
@JavascriptInterface
...
...
@@ -1768,30 +1761,16 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
return
true
;
}
private
void
updateGroupInfoFromServer
(
String
groupIds
)
throws
NetworkDisconnectedException
,
AcmsException
{
private
void
updateGroupInfoFromServer
()
throws
NetworkDisconnectedException
,
AcmsException
{
ArrayList
<
String
>
checkSumList
=
new
ArrayList
<
String
>();
SharedPreferences
pref
=
getSharedPreferences
(
ABookCommConstants
.
TAG
,
MODE_PRIVATE
);
for
(
String
groupId
:
groupIds
.
split
(
","
))
{
//checkSumList.add(pref.getString(groupId,DEFAULT_CHECKSUM));
checkSumList
.
add
(
DEFAULT_CHECKSUM
);
}
String
checkSumListStr
=
StringUtil
.
join
(
","
,
checkSumList
);
if
(
groupIds
.
equals
(
ABookCommConstants
.
FLAG
.
GROUP_REQUEST_ALL
.
toString
()))
{
checkSumListStr
=
DEFAULT_CHECKSUM
;
}
String
lastUpdatedDate
=
pref
.
getString
(
ABookCommConstants
.
KEY
.
GROUP_MEMBER_UPDATED_DATE
,
DEFAULT_CHECKSUM
);
try
{
GroupListJSON
resultJson
=
AcmsClient
.
getInstance
(
ABVEnvironment
.
getInstance
().
networkAdapter
).
getGroupInfo
(
sid
,
groupIds
,
checkSumListStr
);
GroupListJSON
resultJson
=
AcmsClient
.
getInstance
(
ABVEnvironment
.
getInstance
().
networkAdapter
).
getGroupInfo
(
sid
,
lastUpdatedDate
);
if
(
CollectionUtil
.
isNotEmpty
(
resultJson
.
groupList
))
{
SharedPreferences
.
Editor
editor
=
pref
.
edit
();
communicationLogic
.
updateGroup
(
resultJson
.
groupList
);
if
(
groupIds
.
equals
(
ABookCommConstants
.
FLAG
.
GROUP_REQUEST_ALL
.
toString
()))
{
editor
.
putString
(
ABookCommConstants
.
FLAG
.
GROUP_REQUEST_ALL
.
toString
(),
resultJson
.
allGroupLastUpdateDate
);
}
else
{
for
(
ChatGroupDto
groupDto
:
resultJson
.
groupList
)
{
editor
.
putString
(
Integer
.
toString
(
groupDto
.
groupId
),
groupDto
.
updateDate
);
}
}
SharedPreferences
.
Editor
editor
=
pref
.
edit
();
editor
.
putString
(
ABookCommConstants
.
KEY
.
GROUP_MEMBER_UPDATED_DATE
,
resultJson
.
lastRequestDate
);
editor
.
commit
();
}
}
catch
(
AcmsException
e
)
{
...
...
@@ -1811,13 +1790,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
}
private
void
updateAllGroupInfo
()
throws
NetworkDisconnectedException
,
AcmsException
{
updateGroupInfoFromServer
(
ABookCommConstants
.
FLAG
.
GROUP_REQUEST_ALL
.
toString
());
List
<
ChatGroupDto
>
groupList
=
communicationLogic
.
getAllGroup
();
for
(
ChatGroupDto
group
:
groupList
)
{
updateGroupInfoFromServer
(
Integer
.
toString
(
group
.
groupId
));
}
int
test
=
1
;
updateGroupInfoFromServer
();
}
private
void
updateFavoriteInfo
()
throws
NetworkDisconnectedException
,
AcmsException
{
...
...
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