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
e7e39533
Commit
e7e39533
authored
Apr 09, 2021
by
Lee Munkyeong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
アーカイブ実装
parent
4146f156
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
202 additions
and
25 deletions
+202
-25
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/AcmsClient.java
+17
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/ArchiveListJSON.java
+59
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/parameters/GetArchivesParameters.java
+54
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/type/AcmsApis.java
+7
-1
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/constant/ABookCommConstants.java
+8
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ArchiveDao.java
+12
-13
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/tables/TArchive.java
+5
-5
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/ArchiveDto.java
+7
-6
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/CommunicationLogic.java
+18
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/ChatWebviewActivity.java
+15
-0
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/AcmsClient.java
View file @
e7e39533
...
...
@@ -16,6 +16,7 @@ import jp.agentec.abook.abv.bl.acms.client.json.AcmsCommonJSON;
import
jp.agentec.abook.abv.bl.acms.client.json.AcmsMessageJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.ApertureMasterDataJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.AppLatestVersionJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.ArchiveListJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.AuthLevelJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.CategoriesJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.ChangeRoomNameJSON
;
...
...
@@ -58,6 +59,7 @@ import jp.agentec.abook.abv.bl.acms.client.parameters.EnterpriseNewLoginParamete
import
jp.agentec.abook.abv.bl.acms.client.parameters.FavoriteGroupParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.FavoriteUserParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.GetApertureMasterDataParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.GetArchivesParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.GetContentParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.GetEnqueteReplyParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.GetFavoriteParameters
;
...
...
@@ -749,6 +751,21 @@ public class AcmsClient implements AcmsClientResponseListener {
}
/**
* アーカイブ取得
*
* @param sid
* @param updateDate
* @return
* @throws NetworkDisconnectedException
* @throws AcmsException
*/
public
ArchiveListJSON
getArchives
(
String
sid
,
String
updateDate
)
throws
NetworkDisconnectedException
,
AcmsException
{
HttpResponse
response
=
send
(
AcmsApis
.
ApigetArchive
,
new
GetArchivesParameters
(
sid
,
AcmsApis
.
ArchiveCmds
.
getArchive
,
updateDate
));
ArchiveListJSON
json
=
new
ArchiveListJSON
(
response
.
httpResponseBody
);
return
json
;
}
/**
* 作業報告データ送信
* @param sid
* @param operationId
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/ArchiveListJSON.java
0 → 100644
View file @
e7e39533
package
jp
.
agentec
.
abook
.
abv
.
bl
.
acms
.
client
.
json
;
import
org.json.adf.JSONArray
;
import
org.json.adf.JSONObject
;
import
java.util.ArrayList
;
import
jp.agentec.abook.abv.bl.common.constant.ABookCommConstants
;
import
jp.agentec.abook.abv.bl.common.exception.AcmsException
;
import
jp.agentec.abook.abv.bl.common.exception.JSONValidationException
;
import
jp.agentec.abook.abv.bl.dto.ArchiveDto
;
import
jp.agentec.abook.abv.bl.dto.ChatGroupDto
;
import
jp.agentec.abook.abv.bl.dto.ShopMemberDto
;
import
jp.agentec.adf.util.DateTimeUtil
;
public
class
ArchiveListJSON
extends
AcmsCommonJSON
{
public
ArrayList
<
ArchiveDto
>
archiveList
;
public
String
archiveLastUpdateDate
;
public
ArchiveListJSON
(
String
jsonString
)
throws
AcmsException
{
super
(
jsonString
);
}
@Override
protected
void
parse
(
JSONObject
json
)
throws
JSONValidationException
{
// ルーム一覧情報を取得
if
(!
json
.
has
(
ABookCommConstants
.
KEY
.
BODY
))
{
return
;
}
if
(!
json
.
getJSONObject
(
ABookCommConstants
.
KEY
.
BODY
).
has
(
ABookCommConstants
.
KEY
.
ARCHIVE_INFO_LIST
))
{
return
;
}
JSONArray
archiveListJsonArray
=
json
.
getJSONObject
(
ABookCommConstants
.
KEY
.
BODY
).
getJSONArray
(
ABookCommConstants
.
KEY
.
ARCHIVE_INFO_LIST
);
if
(
archiveListJsonArray
==
null
)
{
return
;
}
archiveList
=
new
ArrayList
<
ArchiveDto
>();
for
(
int
listCount
=
0
;
listCount
<
archiveListJsonArray
.
length
();
listCount
++)
{
if
(
archiveListJsonArray
.
getJSONObject
(
listCount
).
length
()
==
0
)
{
break
;
}
JSONObject
archiveJSON
=
archiveListJsonArray
.
getJSONObject
(
listCount
);
ArchiveDto
archiveDto
=
new
ArchiveDto
();
archiveDto
.
archiveId
=
archiveJSON
.
getInt
(
ABookCommConstants
.
KEY
.
ARCHIVE_ID
);
archiveDto
.
archiveName
=
archiveJSON
.
getString
(
ABookCommConstants
.
KEY
.
ARCHIVE_NAME
);
archiveDto
.
archiveType
=
archiveJSON
.
getInt
(
ABookCommConstants
.
KEY
.
ARCHIVE_TYPE
);
archiveDto
.
archiveDate
=
DateTimeUtil
.
millToDateString
(
archiveJSON
.
getJSONObject
(
ABookCommConstants
.
KEY
.
TIME
)
.
getLong
(
ABookCommConstants
.
KEY
.
TIME
));
archiveDto
.
delFlg
=
archiveJSON
.
getInt
(
ABookCommConstants
.
KEY
.
ARCHIVE_ID
);
archiveList
.
add
(
archiveDto
);
}
if
(
json
.
getJSONObject
(
ABookCommConstants
.
KEY
.
BODY
).
has
(
ABookCommConstants
.
KEY
.
ARCHIVE_INFO_LAST_UPDATE_DATE
))
{
archiveLastUpdateDate
=
json
.
getJSONObject
(
ABookCommConstants
.
KEY
.
BODY
).
getString
(
ABookCommConstants
.
KEY
.
ARCHIVE_INFO_LAST_UPDATE_DATE
);
}
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/parameters/GetArchivesParameters.java
0 → 100644
View file @
e7e39533
package
jp
.
agentec
.
abook
.
abv
.
bl
.
acms
.
client
.
parameters
;
import
jp.agentec.adf.net.http.HttpParameterObject
;
/**
* ACMSのAPIに渡す共通的なパラメータを格納します。ACMSのAPIのパラメータ用クラスを作成するときはこのクラスを継承してください。<br>
* ただし、このクラスはログイン状態の確認用として使われる {@link GetArchivesParameters#sid} を持っているため、ログイン用のパラメータ {@link MobileLoginParameters} は、このクラスを継承する必要はありません。
* @author Taejin Hong
* @version 1.0.0
*/
public
class
GetArchivesParameters
extends
HttpParameterObject
{
/**
* セッションID
* @since 1.0.0
*/
private
String
sid
;
private
String
cmd
;
private
String
updatedDate
;
/**
* {@link GetArchivesParameters} のインスタンスを初期化します。
* @param sid ログインした時のセッションIDです。
* @param cmd Apiリクエストに必要なコマンド(ABOOK COMM専用)。
* @since 1.0.0
*/
public
GetArchivesParameters
(
String
sid
,
String
cmd
,
String
updatedDate
)
{
this
.
sid
=
sid
;
this
.
cmd
=
cmd
;
this
.
updatedDate
=
updatedDate
;
}
/**
* セッションIDを返します。
* @return ログインした時のセッションIDです。
* @since 1.0.0
*/
public
String
getSid
()
{
return
sid
;
}
/**
* コマンドを返します。
* @return ログインした時のセッションIDです。
* @since 1.0.0
*/
public
String
getCmd
()
{
return
cmd
;
}
public
String
getUpdatedDate
()
{
return
updatedDate
;
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/type/AcmsApis.java
View file @
e7e39533
...
...
@@ -174,6 +174,7 @@ public class AcmsApis {
public
static
final
String
ApigetUser
=
"user"
;
public
static
final
String
ApigetMessage
=
"message"
;
public
static
final
String
ApigetFavorite
=
"favorite"
;
public
static
final
String
ApigetArchive
=
"archive"
;
public
static
final
class
UserCmds
{
public
static
final
String
inviteUsers
=
"3"
;
...
...
@@ -201,6 +202,11 @@ public class AcmsApis {
public
static
final
String
removeFavoriteGroup
=
"8"
;
}
public
static
final
class
ArchiveCmds
{
public
static
final
String
getArchive
=
"1"
;
public
static
final
String
getArchiveDetail
=
"2"
;
}
// download
/**
* コンテンツのZIPファイルを取得<br>
...
...
@@ -247,7 +253,7 @@ public class AcmsApis {
methodName
.
equals
(
ApiOperationGroupMaster
)
||
methodName
.
equals
(
ApiGetApertureMasterData
)
||
methodName
.
equals
(
ApiQuickReportSearch
)
||
methodName
.
equals
(
ApiQuickReportRevision
)
||
methodName
.
equals
(
ApiGetProcessData
)
||
methodName
.
equals
(
ApiDeleteProcess
))
{
apiValue
=
Constant
.
ApiValue
.
checkapi
;
}
else
if
(
methodName
.
equals
(
ApiGetChatPushData
)
||
methodName
.
equals
(
ApigetChatRooms
)
||
methodName
.
equals
(
ApigetUser
)
||
methodName
.
equals
(
ApigetMessage
)
||
methodName
.
equals
(
ApigetFavorite
))
{
// pushActionはchatapiを指定
}
else
if
(
methodName
.
equals
(
ApiGetChatPushData
)
||
methodName
.
equals
(
ApigetChatRooms
)
||
methodName
.
equals
(
ApigetUser
)
||
methodName
.
equals
(
ApigetMessage
)
||
methodName
.
equals
(
ApigetFavorite
)
||
methodName
.
equals
(
ApigetArchive
)
)
{
// pushActionはchatapiを指定
apiValue
=
Constant
.
ApiValue
.
chatapi
;
}
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/constant/ABookCommConstants.java
View file @
e7e39533
...
...
@@ -57,6 +57,14 @@ public interface ABookCommConstants {
String
FAVORITE_GROUP_IDS
=
"favoriteGroupIds"
;
String
GROUP_INFO_LAST_UPDATE_DATE
=
"groupInfoLastUpdateDate"
;
String
ARCHIVE_INFO_LIST
=
"archiveInfoList"
;
String
ARCHIVE_ID
=
"archiveId"
;
String
ARCHIVE_NAME
=
"archiveName"
;
String
ARCHIVE_DATE
=
"archiveDate"
;
String
ARCHIVE_TYPE
=
"archiveType"
;
String
SAVE_USER_ID
=
"saveUserId"
;
String
ATTEND_USER_IDS
=
"attendUserIds"
;
String
ARCHIVE_INFO_LAST_UPDATE_DATE
=
"archiveInfoLastUpdateDate"
;
String
ROOT_GROUP_ID
=
"rootGroupId"
;
String
HTTP_STATUS
=
"httpStatus"
;
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ArchiveDao.java
View file @
e7e39533
...
...
@@ -31,27 +31,26 @@ public class ArchiveDao extends AbstractDao {
if
(
column
!=
-
1
)
{
dto
.
archiveName
=
cursor
.
getString
(
column
);
}
column
=
cursor
.
getColumnIndex
(
"archive_
typ
e"
);
column
=
cursor
.
getColumnIndex
(
"archive_
dat
e"
);
if
(
column
!=
-
1
)
{
dto
.
archive
Type
=
cursor
.
getInt
(
column
);
dto
.
archive
Date
=
cursor
.
getString
(
column
);
}
column
=
cursor
.
getColumnIndex
(
"archive_
url
"
);
column
=
cursor
.
getColumnIndex
(
"archive_
type
"
);
if
(
column
!=
-
1
)
{
dto
.
archive
Url
=
cursor
.
getString
(
column
);
dto
.
archive
Type
=
cursor
.
getInt
(
column
);
}
column
=
cursor
.
getColumnIndex
(
"
collaboration
_id"
);
column
=
cursor
.
getColumnIndex
(
"
room
_id"
);
if
(
column
!=
-
1
)
{
dto
.
collaboration
Id
=
cursor
.
getInt
(
column
);
dto
.
room
Id
=
cursor
.
getInt
(
column
);
}
column
=
cursor
.
getColumnIndex
(
"s
hop_memb
er_id"
);
column
=
cursor
.
getColumnIndex
(
"s
ave_us
er_id"
);
if
(
column
!=
-
1
)
{
dto
.
s
hopMemb
erId
=
cursor
.
getInt
(
column
);
dto
.
s
aveus
erId
=
cursor
.
getInt
(
column
);
}
column
=
cursor
.
getColumnIndex
(
"a
rchive_save_path
"
);
column
=
cursor
.
getColumnIndex
(
"a
ttend_user_ids
"
);
if
(
column
!=
-
1
)
{
dto
.
a
rchiveSavePath
=
cursor
.
getString
(
column
);
dto
.
a
ttendUserIds
=
cursor
.
getString
(
column
);
}
return
dto
;
}
...
...
@@ -61,11 +60,11 @@ public class ArchiveDao extends AbstractDao {
}
public
void
insertArchive
(
ArchiveDto
dto
)
{
insert
(
"insert
into t_archive (archive_id, archive_name, archive_type, archive_url, collaboration_id, shop_member_id, archive_save_path) values (
?,?)"
,
dto
.
getInsertValues
());
insert
(
"insert
or replace into t_archive (archive_id, archive_name, archive_date, archive_type, room_id, save_user_id, attend_user_ids) values (?,?,?,?,?,
?,?)"
,
dto
.
getInsertValues
());
}
public
boolean
updateArchive
(
ArchiveDto
dto
)
{
long
count
=
update
(
"update t_archive set archive_name=?, archive_type=?,
archive_url
=?, collaboration_id=?, shop_member_id=?, archive_save_path=? where archive_id=?"
,
dto
.
getUpdateValues
());
long
count
=
update
(
"update t_archive set archive_name=?, archive_type=?,
room_id
=?, collaboration_id=?, shop_member_id=?, archive_save_path=? where archive_id=?"
,
dto
.
getUpdateValues
());
return
count
>
0
;
}
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/tables/TArchive.java
View file @
e7e39533
...
...
@@ -17,12 +17,12 @@ public class TArchive extends SQLiteTableScript {
sql
.
append
(
" create table t_archive ( "
);
sql
.
append
(
" archive_id INTEGER NOT NULL "
);
sql
.
append
(
" , archive_name VARCHAR2
(64)
"
);
sql
.
append
(
" , archive_name VARCHAR2 "
);
sql
.
append
(
" , archive_type INTEGER NOT NULL "
);
sql
.
append
(
" , archive_
url VARCHAR2
"
);
sql
.
append
(
" ,
collaboration_id INTEGER NOT NULL
"
);
sql
.
append
(
" ,
shop_member_id INTEGER NOT NULL
"
);
sql
.
append
(
" ,
archive_save_path VARCHAR2
"
);
sql
.
append
(
" , archive_
date VARCHAR2(64)
"
);
sql
.
append
(
" ,
attend_user_ids VARCHAR2
"
);
sql
.
append
(
" ,
room_id INTEGER
"
);
sql
.
append
(
" ,
save_user_id INTEGER NOT NULL
"
);
sql
.
append
(
" , PRIMARY KEY (archive_id)"
);
sql
.
append
(
" ) "
);
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/ArchiveDto.java
View file @
e7e39533
...
...
@@ -4,21 +4,22 @@ public class ArchiveDto extends AbstractDto {
public
Integer
archiveId
;
public
String
archiveName
;
public
String
archiveDate
;
public
Integer
archiveType
;
public
String
archiveUrl
;
public
Integer
collaboration
Id
;
public
Integer
shopMemberId
;
public
String
archiveSavePath
;
public
Integer
roomId
;
public
Integer
saveuser
Id
;
public
String
attendUserIds
;
public
Integer
delFlg
;
@Override
public
Object
[]
getInsertValues
()
{
return
new
Object
[]{
archiveId
,
archiveName
,
archive
Type
,
archiveUrl
,
collaborationId
,
shopMemberId
,
archiveSavePath
};
return
new
Object
[]{
archiveId
,
archiveName
,
archive
Date
,
archiveType
,
roomId
,
saveuserId
,
attendUserIds
};
}
@Override
public
Object
[]
getUpdateValues
()
{
return
new
Object
[]{
archiveName
,
archive
Type
,
archiveUrl
,
collaborationId
,
shopMemberId
,
archiveSavePath
,
archiveId
};
return
new
Object
[]{
archiveName
,
archive
Date
,
archiveType
,
roomId
,
saveuserId
,
attendUserIds
,
archiveId
};
}
@Override
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/CommunicationLogic.java
View file @
e7e39533
...
...
@@ -12,10 +12,12 @@ import java.util.stream.Collectors;
import
jp.agentec.abook.abv.bl.common.constant.ABookCommConstants
;
import
jp.agentec.abook.abv.bl.data.dao.AbstractDao
;
import
jp.agentec.abook.abv.bl.data.dao.ArchiveDao
;
import
jp.agentec.abook.abv.bl.data.dao.ChatGroupDao
;
import
jp.agentec.abook.abv.bl.data.dao.ChatMessageDao
;
import
jp.agentec.abook.abv.bl.data.dao.ChatRoomDao
;
import
jp.agentec.abook.abv.bl.data.dao.ShopMemberDao
;
import
jp.agentec.abook.abv.bl.dto.ArchiveDto
;
import
jp.agentec.abook.abv.bl.dto.ChatMessageDto
;
import
jp.agentec.abook.abv.bl.dto.ChatRoomDto
;
import
jp.agentec.abook.abv.bl.dto.ChatGroupDto
;
...
...
@@ -35,6 +37,7 @@ public class CommunicationLogic extends AbstractLogic {
private
ChatMessageDao
chatMessageDao
=
AbstractDao
.
getDao
(
ChatMessageDao
.
class
);
private
ShopMemberDao
shopMemberDao
=
AbstractDao
.
getDao
(
ShopMemberDao
.
class
);
private
ChatGroupDao
chatGroupDao
=
AbstractDao
.
getDao
(
ChatGroupDao
.
class
);
private
ArchiveDao
archiveDao
=
AbstractDao
.
getDao
(
ArchiveDao
.
class
);
/**
* {@link CommunicationLogic} クラスのインスタンスを初期化します。
...
...
@@ -654,6 +657,21 @@ public class CommunicationLogic extends AbstractLogic {
//shopMemberDao.deleteShopMemberByList(deleteList);
}
public
void
updateArchives
(
List
<
ArchiveDto
>
archiveDtoList
)
{
List
<
ArchiveDto
>
insertList
=
new
ArrayList
<
ArchiveDto
>();
List
<
ArchiveDto
>
deleteList
=
new
ArrayList
<
ArchiveDto
>();
for
(
ArchiveDto
archiveDto
:
archiveDtoList
)
{
if
(
archiveDto
.
delFlg
==
0
)
{
insertList
.
add
(
archiveDto
);
}
else
{
deleteList
.
add
(
archiveDto
);
}
}
archiveDao
.
insertArchiveList
();
archiveDao
.
deleteArchiveList
();
}
public
void
updateGroup
(
List
<
ChatGroupDto
>
GroupList
)
{
List
<
ChatGroupDto
>
existGroupList
=
chatGroupDao
.
getAllGroups
();
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/ChatWebviewActivity.java
View file @
e7e39533
...
...
@@ -39,6 +39,7 @@ import java.util.Map;
import
java.util.Objects
;
import
jp.agentec.abook.abv.bl.acms.client.AcmsClient
;
import
jp.agentec.abook.abv.bl.acms.client.json.ArchiveListJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.ChangeRoomNameJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.CreatedRoomJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.GetFavoriteGroupJSON
;
...
...
@@ -1023,6 +1024,20 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
public
void
updateFavorite
()
throws
NetworkDisconnectedException
,
AcmsException
{
updateFavoriteInfo
();
}
@JavascriptInterface
public
void
updateArchiveList
()
throws
NetworkDisconnectedException
,
AcmsException
{
SharedPreferences
pref
=
getSharedPreferences
(
ABookCommConstants
.
TAG
,
MODE_PRIVATE
);
String
updateDate
=
pref
.
getString
(
ABookCommConstants
.
KEY
.
ARCHIVE_INFO_LAST_UPDATE_DATE
,
DEFAULT_CHECKSUM
);
ArchiveListJSON
resultJson
=
AcmsClient
.
getInstance
(
ABVEnvironment
.
getInstance
().
networkAdapter
).
getArchives
(
sid
,
updateDate
);
communicationLogic
.
updateArchives
(
resultJson
.
archiveList
);
if
(
StringUtil
.
isNullOrEmpty
(
resultJson
.
archiveLastUpdateDate
))
{
return
;
}
SharedPreferences
.
Editor
editor
=
pref
.
edit
();
editor
.
putString
(
ABookCommConstants
.
KEY
.
ARCHIVE_INFO_LAST_UPDATE_DATE
,
resultJson
.
archiveLastUpdateDate
);
editor
.
commit
();
}
}
/**
...
...
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