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
07fe9846
Commit
07fe9846
authored
Jun 19, 2019
by
Jeong Gilmo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#33721 絞り検索のAPIとの連携
- 絞り検索のマスタデータを受信 - 受信したデータをJSONファイルの生成
parent
bee3942e
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
156 additions
and
1 deletions
+156
-1
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/AcmsClient.java
+15
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/ApertureMasterDataJSON.java
+50
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/parameters/GetApertureMasterDataParameters.java
+21
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/type/AcmsApis.java
+4
-1
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/ABVDataCache.java
+6
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/OperationLogic.java
+18
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/launcher/android/ABVApplication.java
+6
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/appinfo/AppDefType.java
+2
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationListActivity.java
+34
-0
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/AcmsClient.java
View file @
07fe9846
...
...
@@ -22,6 +22,7 @@ import jp.agentec.abook.abv.bl.acms.client.json.ContentVersionsJSON;
import
jp.agentec.abook.abv.bl.acms.client.json.GroupsJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.LogSendFlagJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.NewAppStoreLoginJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.ApertureMasterDataJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.RequirePasswordChangeJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.ResultJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.ServerTimeZoneJSON
;
...
...
@@ -41,6 +42,7 @@ import jp.agentec.abook.abv.bl.acms.client.parameters.ContentReadingLogParameter
import
jp.agentec.abook.abv.bl.acms.client.parameters.EnqueteReplyParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.EnterpriseLoginParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.EnterpriseNewLoginParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.GetApertureMasterDataParameters
;
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.GetOperationDataParameters
;
...
...
@@ -963,4 +965,17 @@ public class AcmsClient implements AcmsClientResponseListener {
}
}
}
/**
* ACMSから、絞り検索マスタデータ情報を取得します。
* @param param {@link AcmsParameters} オブジェクトです。
* @return 絞り検索マスタデータを格納したリストを返します。
* @throws NetworkDisconnectedException
* @throws AcmsException
*/
public
ApertureMasterDataJSON
getApertureMasterData
(
GetApertureMasterDataParameters
param
)
throws
NetworkDisconnectedException
,
AcmsException
{
HttpResponse
response
=
send
(
AcmsApis
.
ApiGetApertureMasterData
,
param
);
ApertureMasterDataJSON
json
=
new
ApertureMasterDataJSON
(
response
.
httpResponseBody
);
return
json
;
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/ApertureMasterDataJSON.java
0 → 100644
View file @
07fe9846
package
jp
.
agentec
.
abook
.
abv
.
bl
.
acms
.
client
.
json
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
import
jp.agentec.abook.abv.bl.acms.client.AcmsClient
;
import
jp.agentec.abook.abv.bl.common.exception.AcmsException
;
import
jp.agentec.abook.abv.bl.common.exception.JSONValidationException
;
import
jp.agentec.abook.abv.bl.common.log.Logger
;
import
jp.agentec.abook.abv.bl.dto.WorkerGroupDto
;
import
jp.agentec.adf.util.DateTimeFormat
;
import
jp.agentec.adf.util.DateTimeUtil
;
import
org.json.adf.JSONArray
;
import
org.json.adf.JSONObject
;
/**
* {@link AcmsClient#contentVersion} の戻り値です。
* @author Taejin Hong
* @version 1.0.0
*/
public
class
ApertureMasterDataJSON
extends
AcmsCommonJSON
{
public
static
final
String
operationLastEditDate
=
"operationLastEditDate"
;
public
static
final
String
ApertureData
=
"apertureData"
;
public
Date
lastEditDate
;
public
JSONObject
apertureJson
;
public
ApertureMasterDataJSON
(
String
jsonString
)
throws
AcmsException
{
super
(
jsonString
);
}
@Override
protected
void
parse
(
JSONObject
json
)
throws
JSONValidationException
{
// 絞り検索の日付を取得
if
(
json
.
has
(
operationLastEditDate
))
{
lastEditDate
=
DateTimeUtil
.
toDate
(
json
.
getString
(
operationLastEditDate
),
"UTC"
,
DateTimeFormat
.
yyyyMMddHHmmss_hyphen
);
}
// 絞り検索のデータを取得
if
(
json
.
has
(
ApertureData
))
{
JSONArray
apertureList
=
json
.
getJSONArray
(
ApertureData
);
for
(
int
i
=
0
;
i
<
apertureList
.
length
();
i
++)
{
apertureJson
=
apertureList
.
getJSONObject
(
i
);
json
.
getJSONArray
(
ApertureData
);
Logger
.
e
(
apertureJson
.
toString
());
}
}
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/parameters/GetApertureMasterDataParameters.java
0 → 100644
View file @
07fe9846
package
jp
.
agentec
.
abook
.
abv
.
bl
.
acms
.
client
.
parameters
;
/**
* Created by leej on 2018/09/10.
*/
public
class
GetApertureMasterDataParameters
extends
AcmsParameters
{
private
long
operationId
;
public
GetApertureMasterDataParameters
(
String
sid
,
long
operationId
)
{
super
(
sid
);
this
.
operationId
=
operationId
;
}
public
long
getOperationId
()
{
return
operationId
;
}
}
\ No newline at end of file
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/type/AcmsApis.java
View file @
07fe9846
...
...
@@ -153,6 +153,8 @@ public class AcmsApis {
// 定期点検データ送信
public
static
final
String
ApiSendRoutineTaskData
=
"routineTaskData"
;
// 絞り検索マスタデータ取得
public
static
final
String
ApiGetApertureMasterData
=
"getApertureMasterData"
;
// download
/**
...
...
@@ -196,7 +198,8 @@ public class AcmsApis {
apiValue
=
Constant
.
ApiValue
.
nuapi
;
}
else
if
(
methodName
.
equals
(
ApiOperationList
)
||
methodName
.
equals
(
ApiWorkingGroupList
)
||
methodName
.
equals
(
ApiSendTaskData
)
||
methodName
.
equals
(
ApiGetOperationData
)
||
methodName
.
equals
(
ApiGetTaskFile
)
||
methodName
.
equals
(
ApiSceneEntry
)
||
methodName
.
equals
(
ApiTaskContentEntry
)
||
methodName
.
equals
(
ApiSendPushMessage
)
||
methodName
.
equals
(
ApiGetPushMessages
)
||
methodName
.
equals
(
ApiSendRoutineTaskData
))
{
methodName
.
equals
(
ApiSendPushMessage
)
||
methodName
.
equals
(
ApiGetPushMessages
)
||
methodName
.
equals
(
ApiSendRoutineTaskData
)
||
methodName
.
equals
(
ApiGetApertureMasterData
))
{
// 絞り検索マスタデータ取得のAPI
apiValue
=
Constant
.
ApiValue
.
checkapi
;
}
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/ABVDataCache.java
View file @
07fe9846
...
...
@@ -39,6 +39,10 @@ public class ABVDataCache {
private
Date
lastPresentTime
=
DateTimeUtil
.
getCurrentDate
();
// 最後の通信時に取得したサーバの時間
private
static
final
int
SEVER_ALERT_INTERVAL
=
30
;
//システム日付チェック前後期間(分)
// Serverから取得したapertureMasterDataのfetchDateを一時的に保存するための変数
public
String
tempApertureMasterDataFetchDate
=
null
;
/**
* 未指定ジャンルのID
* @since 1.0.0
...
...
@@ -233,6 +237,8 @@ public class ABVDataCache {
defaultCategoryId
=
-
1
;
defaultGroupId
=
-
1
;
urlPath
=
null
;
// 絞り検索の取得日付を初期化
tempApertureMasterDataFetchDate
=
null
;
}
public
void
setLastPresentTime
(
Date
lasttime
)
{
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/OperationLogic.java
View file @
07fe9846
...
...
@@ -1597,4 +1597,22 @@ public class OperationLogic extends AbstractLogic {
mTaskDao
.
insert
(
taskDto
);
}
}
/**
* 絞り検索のjsonファイル
* apertureMaster.jsonを作成
*
* @param json
* @param contentPath
* @throws IOException
*/
public
void
createJsonForApertureData
(
JSONObject
json
,
String
contentPath
)
throws
IOException
{
try
{
FileUtil
.
createFile
(
contentPath
+
"/apertureMaster.json"
,
json
.
toString
());
}
catch
(
IOException
e
)
{
Logger
.
e
(
TAG
,
"createJsonForapertureMaster error : "
,
e
);
throw
e
;
}
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/launcher/android/ABVApplication.java
View file @
07fe9846
...
...
@@ -8,7 +8,10 @@ import android.support.multidex.MultiDexApplication;
import
jp.agentec.abook.abv.bl.common.ABVEnvironment
;
import
jp.agentec.abook.abv.bl.common.log.Logger
;
import
jp.agentec.abook.abv.bl.data.ABVDataCache
;
import
jp.agentec.abook.abv.cl.helper.ABVUncaughtExceptionHandler
;
import
jp.agentec.abook.abv.cl.util.PreferenceUtil
;
import
jp.agentec.abook.abv.ui.common.appinfo.AppDefType
;
import
jp.agentec.abook.abv.ui.common.util.Initializer
;
import
jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper
;
import
jp.agentec.adf.util.FileUtil
;
...
...
@@ -49,6 +52,9 @@ public class ABVApplication extends MultiDexApplication {
//添付ファイル臨時保存場所削除
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getCacheTempAttachedImageDirPath
());
// 絞り検索のfetchDateをローカルに保存された値を取得して設定する
ABVDataCache
.
getInstance
().
tempApertureMasterDataFetchDate
=
PreferenceUtil
.
getUserPref
(
this
,
AppDefType
.
UserPrefKey
.
APERTURE_MASTER_DATA_FETCH_DATE
,
null
);
}
@Override
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/appinfo/AppDefType.java
View file @
07fe9846
...
...
@@ -56,6 +56,8 @@ public interface AppDefType {
String
OPERATION_REPORT_TYPES
=
"operationReportTypes"
;
String
RESOURCE_PATTERN_TYPE
=
"resourcePatternType"
;
// 文言リソースパターン
String
APERTURE_MASTER_DATA_FETCH_DATE
=
"apertureMasterDataFetchDate"
;
// 絞り検索マスタデータのFetchDate
}
/**
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationListActivity.java
View file @
07fe9846
...
...
@@ -55,7 +55,9 @@ import java.util.Date;
import
java.util.List
;
import
jp.agentec.abook.abv.bl.acms.client.AcmsClient
;
import
jp.agentec.abook.abv.bl.acms.client.json.ApertureMasterDataJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.GetApertureMasterDataParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.GetOperationDataParameters
;
import
jp.agentec.abook.abv.bl.acms.type.DownloadStatusType
;
import
jp.agentec.abook.abv.bl.acms.type.OperationType
;
...
...
@@ -185,6 +187,9 @@ public class OperationListActivity extends ABVUIActivity {
private
ArrayList
<
Integer
>
mAllOperationReportTypes
;
// 絞り検索マスタデータ
private
Date
mApertureLastEditDate
;
// ビューの作成
private
class
ReloadHandler
implements
Runnable
{
@Override
...
...
@@ -632,6 +637,9 @@ public class OperationListActivity extends ABVUIActivity {
mOperationLogic
.
createJsonForOpenABookCheckPano
(
operationDto
.
operationId
,
operationDto
.
contentId
,
contentPath
);
mOperationLogic
.
createJsonForOperationContent
(
operationDto
.
operationId
,
contentPath
,
operationDto
.
reportType
==
ReportType
.
RoutineTask
);
// 絞り検索マスタデータを受信、JSONファイルを生成
mApertureLastEditDate
=
receptionApertureMasterData
(
operationDto
.
operationId
,
contentPath
);
// サーバ作業後、対応必要
StringBuffer
path
=
new
StringBuffer
();
path
.
append
(
contentPath
);
...
...
@@ -1912,4 +1920,30 @@ public class OperationListActivity extends ABVUIActivity {
imgBtn
.
setImageDrawable
(
getRDrawable
(
R
.
drawable
.
ic_filter_selected
));
}
}
/**
* 絞り検索マスタデータの受信
* @param operationId
* @return
* @throws NetworkDisconnectedException
* @throws ABVException
* @throws IOException
* @throws InterruptedException
* @throws NoSuchAlgorithmException
* @throws ZipException
*/
public
Date
receptionApertureMasterData
(
long
operationId
,
String
contentPath
)
throws
NetworkDisconnectedException
,
ABVException
,
IOException
{
// 絞り検索のためparamを設定
GetApertureMasterDataParameters
param
=
new
GetApertureMasterDataParameters
(
ABVDataCache
.
getInstance
().
getMemberInfo
().
sid
,
operationId
);
// 絞り検索した日付の保存
Date
lastEditDate
;
// JSONデータのparsing
ApertureMasterDataJSON
json
=
AcmsClient
.
getInstance
(
ABVDataCache
.
getInstance
().
getUrlPath
(),
ABVEnvironment
.
getInstance
().
networkAdapter
).
getApertureMasterData
(
param
);
// JSONファイルを生成
mOperationLogic
.
createJsonForApertureData
(
json
.
apertureJson
,
contentPath
);
// 絞り検索した日付を取得
lastEditDate
=
json
.
lastEditDate
;
return
lastEditDate
;
}
}
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