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
b46fc80c
Commit
b46fc80c
authored
Jan 06, 2023
by
Kazuyuki Hida
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
割り込みの仕事が入ったので、いったんコミット
parent
bca9e56d
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
372 additions
and
12 deletions
+372
-12
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/AcmsClient.java
+19
-1
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/LockReportJSON.java
+86
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/UnlockReportJSON.java
+42
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/parameters/LockReportParameters.java
+53
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/parameters/UnlockReportParameters.java
+38
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/type/AcmsApis.java
+6
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/constant/ABookKeys.java
+2
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/LockReportLogic.java
+20
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/ABookCheckWebViewHelper.java
+102
-9
gradle.properties
+4
-2
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/AcmsClient.java
View file @
b46fc80c
...
...
@@ -20,6 +20,7 @@ import jp.agentec.abook.abv.bl.acms.client.json.CategoriesJSON;
import
jp.agentec.abook.abv.bl.acms.client.json.ContentCheckDeliverableJSON
;
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.LockReportJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.LogSendFlagJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.MasterDataJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.NewAppStoreLoginJSON
;
...
...
@@ -32,6 +33,7 @@ import jp.agentec.abook.abv.bl.acms.client.json.FixPushMessageJSON;
import
jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.OperationListJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.SceneEntryJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.UnlockReportJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.WorkerGroupJSON
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.AbstractAcmsLoginParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.AcmsContentParameters
;
...
...
@@ -47,11 +49,13 @@ 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
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.GetTaskFileParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.LockReportParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.NewAppStoreLoginParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.PasswordChangeParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.PostEnqueteReplyParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.SendPushMessageParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.ServerTimeParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.UnlockReportParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.UpdateDeviceTokenParameters
;
import
jp.agentec.abook.abv.bl.acms.type.AcmsApis
;
import
jp.agentec.abook.abv.bl.acms.type.LoginStatus
;
...
...
@@ -719,6 +723,18 @@ public class AcmsClient implements AcmsClientResponseListener {
return
json
;
}
public
LockReportJSON
sendLockReport
(
LockReportParameters
param
)
throws
NetworkDisconnectedException
,
AcmsException
{
HttpResponse
response
=
send
(
AcmsApis
.
ApiLockReport
,
param
);
String
json
=
response
.
httpResponseBody
;
return
new
LockReportJSON
(
json
);
}
public
UnlockReportJSON
sendUnlockReport
(
UnlockReportParameters
param
)
throws
NetworkDisconnectedException
,
AcmsException
{
HttpResponse
response
=
send
(
AcmsApis
.
ApiUnlockReport
,
param
);
String
json
=
response
.
httpResponseBody
;
return
new
UnlockReportJSON
(
json
);
}
/**********************************************************************************************/
/** 以下、共用メソッド---------------------------------------------------------------------- **/
/**********************************************************************************************/
...
...
@@ -922,7 +938,9 @@ public class AcmsClient implements AcmsClientResponseListener {
AcmsApis
.
ApiUrlNewAppStoreLogin
,
AcmsApis
.
ApiUrlAppStoreNewLogin
,
AcmsApis
.
ApiGetPushMessages
,
AcmsApis
.
ApiSendPushMessage
AcmsApis
.
ApiSendPushMessage
,
AcmsApis
.
ApiLockReport
,
AcmsApis
.
ApiUnlockReport
};
public
HttpTaskWorker
(
String
methodName
,
String
apiUrl
,
T
param
)
{
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/LockReportJSON.java
0 → 100644
View file @
b46fc80c
package
jp
.
agentec
.
abook
.
abv
.
bl
.
acms
.
client
.
json
;
import
org.json.adf.JSONObject
;
import
java.util.Date
;
import
jp.agentec.abook.abv.bl.common.exception.AcmsException
;
import
jp.agentec.adf.util.DateTimeFormat
;
import
jp.agentec.adf.util.DateTimeUtil
;
/**
* checkapi/lockReport/のレスポンスを変換するクラス
*/
public
class
LockReportJSON
extends
AcmsCommonJSON
{
private
Date
presentTimeUTC
;
private
int
reportStatus
;
private
String
reportLockUserId
;
private
String
reportLockUserName
;
private
Date
reportLockTime
;
public
LockReportJSON
(
String
jsonString
)
throws
AcmsException
{
super
(
jsonString
);
}
@Override
protected
void
parse
(
JSONObject
json
)
{
presentTimeUTC
=
dateOrNull
(
json
,
"presentTimeUTC"
);
reportStatus
=
intOrDef
(
json
,
"reportStatus"
,
999
);
reportLockUserId
=
stringOrNull
(
json
,
"reportLockUserId"
);
reportLockUserName
=
stringOrNull
(
json
,
"reportLockUserName"
);
reportLockTime
=
dateOrNull
(
json
,
"reportLockTime"
);
}
int
getHttpStatus
()
{
return
httpStatus
;
}
Date
getPresentTime
()
{
return
presentTime
;
}
public
Date
getPresentTimeUTC
()
{
return
presentTimeUTC
;
}
public
int
getReportStatus
()
{
return
reportStatus
;
}
public
String
getReportLockUserId
()
{
return
reportLockUserId
;
}
public
String
getReportLockUserName
()
{
return
reportLockUserName
;
}
public
Date
getReportLockTime
()
{
return
reportLockTime
;
}
private
int
intOrDef
(
JSONObject
json
,
String
key
,
int
def
)
{
if
(
json
.
has
(
key
))
{
return
json
.
getInt
(
key
);
}
else
{
return
def
;
}
}
private
String
stringOrNull
(
JSONObject
json
,
String
key
)
{
if
(
json
.
has
(
key
))
{
return
json
.
getString
(
key
);
}
else
{
return
null
;
}
}
private
Date
dateOrNull
(
JSONObject
json
,
String
key
)
{
if
(
json
.
has
(
key
))
{
return
DateTimeUtil
.
toDate
(
json
.
getString
(
key
),
"UTC"
,
DateTimeFormat
.
yyyyMMdd_hyphen
);
}
else
{
return
null
;
}
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/UnlockReportJSON.java
0 → 100644
View file @
b46fc80c
package
jp
.
agentec
.
abook
.
abv
.
bl
.
acms
.
client
.
json
;
import
org.json.adf.JSONObject
;
import
java.util.Date
;
import
jp.agentec.abook.abv.bl.common.exception.AcmsException
;
import
jp.agentec.adf.util.DateTimeFormat
;
import
jp.agentec.adf.util.DateTimeUtil
;
public
class
UnlockReportJSON
extends
AcmsCommonJSON
{
private
Date
presentTimeUTC
;
public
UnlockReportJSON
(
String
jsonString
)
throws
AcmsException
{
super
(
jsonString
);
}
@Override
protected
void
parse
(
JSONObject
json
)
{
presentTimeUTC
=
dateOrNull
(
json
,
"presentTimeUTC"
);
}
int
getHttpStatus
()
{
return
httpStatus
;
}
Date
getPresentTime
()
{
return
presentTime
;
}
Date
getPresentTimeUTC
()
{
return
presentTimeUTC
;
}
private
Date
dateOrNull
(
JSONObject
json
,
String
key
)
{
if
(
json
.
has
(
key
))
{
return
DateTimeUtil
.
toDate
(
json
.
getString
(
key
),
"UTC"
,
DateTimeFormat
.
yyyyMMdd_hyphen
);
}
else
{
return
null
;
}
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/parameters/LockReportParameters.java
0 → 100644
View file @
b46fc80c
package
jp
.
agentec
.
abook
.
abv
.
bl
.
acms
.
client
.
parameters
;
import
java.util.Date
;
/**
* checkapi/lockReport/のリクエストに使うパラメータ
*/
public
class
LockReportParameters
extends
AcmsParameters
{
private
String
sid
;
private
String
taskKey
;
private
Long
taskReportId
;
private
Date
reportStartDate
;
private
String
userId
;
private
String
userName
;
public
LockReportParameters
(
String
sid
,
String
taskKey
,
Long
taskReportId
,
Date
reportStartDate
,
String
userId
,
String
userName
)
{
super
(
sid
);
this
.
taskKey
=
taskKey
;
this
.
taskReportId
=
taskReportId
;
this
.
reportStartDate
=
reportStartDate
;
this
.
userId
=
userId
;
this
.
userName
=
userName
;
}
public
String
getTaskKey
()
{
return
taskKey
;
}
public
Long
getTaskReportId
()
{
return
taskReportId
;
}
public
Date
getReportStartDate
()
{
return
reportStartDate
;
}
public
String
getUserId
()
{
return
userId
;
}
public
String
getUserName
()
{
return
userName
;
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/parameters/UnlockReportParameters.java
0 → 100644
View file @
b46fc80c
package
jp
.
agentec
.
abook
.
abv
.
bl
.
acms
.
client
.
parameters
;
import
java.util.Date
;
/**
* checkapi/unlockReport/のリクエストに使うパラメータ
*/
public
class
UnlockReportParameters
extends
AcmsParameters
{
private
String
taskKey
;
private
Long
taskReportId
;
private
Date
reportStartDate
;
public
UnlockReportParameters
(
String
sid
,
String
taskKey
,
Long
taskReportId
,
Date
reportStartDate
)
{
super
(
sid
);
this
.
taskKey
=
taskKey
;
this
.
taskReportId
=
taskReportId
;
this
.
reportStartDate
=
reportStartDate
;
}
String
getTaskKey
()
{
return
taskKey
;
}
Long
getTaskReportId
()
{
return
taskReportId
;
}
Date
getReportStartDate
()
{
return
reportStartDate
;
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/type/AcmsApis.java
View file @
b46fc80c
...
...
@@ -160,6 +160,11 @@ public class AcmsApis {
public
static
final
String
ApiQuickReportSearch
=
"quickReportSearch"
;
// 簡易帳票リビジョン一覧取得
public
static
final
String
ApiQuickReportRevision
=
"quickReportRevision"
;
// 報告・点検のロック
public
static
final
String
ApiLockReport
=
"lockReport"
;
// 報告・点検のロック解除
public
static
final
String
ApiUnlockReport
=
"unlockReport"
;
// download
/**
* コンテンツのZIPファイルを取得<br>
...
...
@@ -182,6 +187,7 @@ public class AcmsApis {
public
static
final
String
GetTaskFileUrlFormat
=
"%s/%s/checkapi/getTaskFile"
;
/**
* APIのURLを完成します。
* @param host ACMSのFQDNです。
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/constant/ABookKeys.java
View file @
b46fc80c
...
...
@@ -34,6 +34,8 @@ public class ABookKeys {
public
static
final
String
CMD_MOVE_PAGE
=
"movePage"
;
public
static
final
String
CMD_SHOW_RELATED_CONTENT
=
"showRelatedContent"
;
public
static
final
String
CMD_PAGE_NUM
=
"pageNum"
;
public
static
final
String
CMD_LOCK_REPORT
=
"lockReport"
;
public
static
final
String
CMD_UNLOCK_REPORT
=
"unlockReport"
;
public
static
final
String
GPS_TYPE
=
"gpsType"
;
public
static
final
String
STATUS_CODE
=
"statusCode"
;
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/LockReportLogic.java
0 → 100644
View file @
b46fc80c
package
jp
.
agentec
.
abook
.
abv
.
bl
.
logic
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.LockReportParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.UnlockReportParameters
;
public
class
LockReportLogic
extends
AbstractLogic
{
public
static
LockReportLogic
newInstance
()
{
return
new
LockReportLogic
();
}
public
void
lock
(
LockReportParameters
param
)
{
}
public
void
unlock
(
UnlockReportParameters
param
)
{
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/ABookCheckWebViewHelper.java
View file @
b46fc80c
...
...
@@ -19,15 +19,19 @@ import java.util.Date;
import
java.util.List
;
import
java.util.Map
;
import
jp.agentec.abook.abv.bl.acms.client.AcmsClient
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.LockReportParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.UnlockReportParameters
;
import
jp.agentec.abook.abv.bl.common.ABVEnvironment
;
import
jp.agentec.abook.abv.bl.common.Callback
;
import
jp.agentec.abook.abv.bl.common.CommonExecutor
;
import
jp.agentec.abook.abv.bl.common.Constant
;
import
jp.agentec.abook.abv.bl.common.constant.ABookKeys
;
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
;
import
jp.agentec.abook.abv.bl.common.log.Logger
;
import
jp.agentec.abook.abv.bl.common.nw.NetworkAdapter
;
import
jp.agentec.abook.abv.bl.data.ABVDataCache
;
import
jp.agentec.abook.abv.bl.dto.OperationDto
;
import
jp.agentec.abook.abv.bl.dto.OperationTaskDto
;
import
jp.agentec.abook.abv.bl.dto.TaskDto
;
...
...
@@ -37,7 +41,6 @@ import jp.agentec.abook.abv.bl.logic.OperationLogic;
import
jp.agentec.abook.abv.launcher.android.R
;
import
jp.agentec.abook.abv.ui.common.activity.ABVContentViewActivity
;
import
jp.agentec.abook.abv.ui.common.appinfo.AppDefType
;
import
jp.agentec.abook.abv.ui.common.constant.ErrorCode
;
import
jp.agentec.abook.abv.ui.common.constant.ErrorMessage
;
import
jp.agentec.abook.abv.ui.common.util.PatternStringUtil
;
import
jp.agentec.abook.abv.ui.common.util.ABVToastUtil
;
...
...
@@ -70,15 +73,15 @@ public class ABookCheckWebViewHelper extends ABookHelper {
* parameterによって処理を分ける
*
* @param context ABVContentViewActivity
* @param cmd
* @param cmd
コマンド
* @param taskKey タスクキー
* @param enableReportHistory
* @param param
* @param enableReportHistory
履歴を残すかどうか
* @param param
パラメータ
* @param operationId プロジェクトID
* @param contentPath
* @param reportType
* @param finishCallback
* @param taskReportLevel
* @param contentPath
添付資料のパス
* @param reportType
報告タイプ
* @param finishCallback
最後に呼ぶコールバック
* @param taskReportLevel
作業の報告レベル
*/
public
void
doABookCheckParam
(
ABVContentViewActivity
context
,
String
cmd
,
String
taskKey
,
int
enableReportHistory
,
Map
<
String
,
String
>
param
,
long
operationId
,
String
contentPath
,
long
contentId
,
int
reportType
,
Callback
finishCallback
,
int
taskReportLevel
)
throws
IOException
{
int
taskReportSendId
=
0
;
...
...
@@ -139,6 +142,12 @@ public class ABookCheckWebViewHelper extends ABookHelper {
FileUtil
.
delete
(
ABVEnvironment
.
getInstance
().
getTempTaskDirPath
(
contentId
,
taskKey
));
mFinishCallback
.
callback
(
false
);
break
;
case
ABookKeys
.
CMD_LOCK_REPORT
:
sendLockReport
(
param
);
break
;
case
ABookKeys
.
CMD_UNLOCK_REPORT
:
sendUnlockReport
(
param
);
break
;
}
}
...
...
@@ -550,4 +559,88 @@ public class ABookCheckWebViewHelper extends ABookHelper {
return
rotationAngle
;
}
private
void
sendLockReport
(
Map
<
String
,
String
>
param
)
{
sendLockReport
(
param
.
get
(
"sid"
),
param
.
get
(
"taskKey"
),
longOrNull
(
param
.
get
(
"taskReportId"
)),
dateOrNull
(
param
.
get
(
"reportStartDate"
)),
param
.
get
(
"userId"
),
param
.
get
(
"userName"
)
);
}
private
void
sendLockReport
(
String
sid
,
String
taskKey
,
Long
taskReportId
,
Date
reportStartDate
,
String
userId
,
String
userName
)
{
ABVDataCache
cache
=
ABVDataCache
.
getInstance
();
NetworkAdapter
adapter
=
ABVEnvironment
.
getInstance
().
networkAdapter
;
AcmsClient
client
=
AcmsClient
.
getInstance
(
cache
.
getUrlPath
(),
adapter
);
LockReportParameters
param
=
new
LockReportParameters
(
sid
,
taskKey
,
taskReportId
,
reportStartDate
,
userId
,
userName
);
try
{
client
.
sendLockReport
(
param
);
}
catch
(
Exception
e
)
{
// todo
}
}
private
void
sendUnlockReport
(
Map
<
String
,
String
>
param
)
{
sendUnlockReport
(
param
.
get
(
"sid"
),
param
.
get
(
"taskKey"
),
longOrNull
(
param
.
get
(
"taskReportId"
)),
dateOrNull
(
param
.
get
(
"reportStartDate"
))
);
}
private
void
sendUnlockReport
(
String
sid
,
String
taskKey
,
Long
taskReportId
,
Date
reportStartDate
)
{
ABVDataCache
cache
=
ABVDataCache
.
getInstance
();
NetworkAdapter
adapter
=
ABVEnvironment
.
getInstance
().
networkAdapter
;
AcmsClient
client
=
AcmsClient
.
getInstance
(
cache
.
getUrlPath
(),
adapter
);
UnlockReportParameters
param
=
new
UnlockReportParameters
(
sid
,
taskKey
,
taskReportId
,
reportStartDate
);
try
{
client
.
sendUnlockReport
(
param
);
}
catch
(
Exception
e
)
{
// todo
}
}
private
Long
longOrNull
(
String
s
)
{
try
{
return
Long
.
valueOf
(
s
);
}
catch
(
Exception
e
)
{
return
null
;
}
}
private
Date
dateOrNull
(
String
s
)
{
try
{
return
DateTimeUtil
.
toDate
(
s
,
"UTC"
,
DateTimeFormat
.
yyyyMMdd_hyphen
);
}
catch
(
Exception
e
)
{
return
null
;
}
}
}
gradle.properties
View file @
b46fc80c
...
...
@@ -39,8 +39,10 @@ app_versioncode=1
#cms server
#acms_address=https://check.abookcloud.com/acms
#download_server_address=https://check.abookcloud.com/acms
acms_address
=
https://abook188-1.abook.bz/acms
download_server_address
=
https://abook188-1.abook.bz/acms
#acms_address=https://abook188-1.abook.bz/acms
#download_server_address=https://abook188-1.abook.bz/acms
acms_address
=
http://10.0.2.2:8080/acms
download_server_address
=
http://10.0.2.2:8080/acms
#syncview server
websocket_server_http_url
=
https://abook188-1.abook.bz/v1
...
...
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