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
7e1e33dd
Commit
7e1e33dd
authored
Jan 25, 2023
by
Kazuyuki Hida
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
checkapi/taskData/ のレスポンスをJSのコールバックにextParamとして渡すようにした(暫定的な実装)。
parent
e38d4b24
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
3 deletions
+62
-3
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/AcmsClient.java
+11
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/ReportStatusLogic.java
+40
-0
ABVJE_Launcher_Android/assets/dashboard
+1
-1
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVContentViewActivity.java
+10
-2
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/AcmsClient.java
View file @
7e1e33dd
package
jp
.
agentec
.
abook
.
abv
.
bl
.
acms
.
client
;
import
org.json.adf.JSONObject
;
import
java.io.File
;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
...
...
@@ -81,6 +83,7 @@ import jp.agentec.abook.abv.bl.dto.GroupDto;
import
jp.agentec.abook.abv.bl.dto.MemberInfoDto
;
import
jp.agentec.abook.abv.bl.dto.ServiceOptionDto
;
import
jp.agentec.abook.abv.bl.dto.TaskReportDto
;
import
jp.agentec.abook.abv.bl.logic.ReportStatusLogic
;
import
jp.agentec.adf.net.http.HttpDownloadState
;
import
jp.agentec.adf.net.http.HttpFileDownloader
;
import
jp.agentec.adf.net.http.HttpMultipart
;
...
...
@@ -569,6 +572,14 @@ public class AcmsClient implements AcmsClientResponseListener {
AcmsMessageJSON
json
=
new
AcmsMessageJSON
(
result
.
httpResponseBody
);
// JSのコールバックに渡すために必要な情報をストックしておく(暫定的な実装 fixme )
if
(
apiUrl
.
contains
(
AcmsApis
.
ApiSendTaskData
))
{
JSONObject
res
=
new
JSONObject
(
result
.
httpResponseBody
);
int
reportStatus
=
res
.
has
(
"reportStatus"
)
?
res
.
getInt
(
"reportStatus"
)
:
null
;
String
message
=
res
.
has
(
"message"
)
?
res
.
getString
(
"message"
)
:
null
;
ReportStatusLogic
.
TaskReportExtParam
.
stock
(
String
.
valueOf
(
reportStatus
),
message
);
}
Logger
.
d
(
TAG
,
"sendTaskData res: %s"
,
json
);
if
(
json
.
errorMessage
!=
null
)
{
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/ReportStatusLogic.java
View file @
7e1e33dd
...
...
@@ -51,4 +51,44 @@ public class ReportStatusLogic extends AbstractLogic {
}
}
}
/**
* API checkapi/taskData/で得られた、
* reportStatus
* message
* をJavaScriptのコールバックを呼び出すときに使用するため保持しておくところ。
* スレッドセーフにはなっていないし、スコープはpublicだしという行儀の悪い実装方法であるが、
* APIの呼び出しとコールバックの呼び出しが、コードとして遠くに離れているので、
* 適切な方法がないため、やむなくこのような実装になっている。
*/
public
static
class
TaskReportExtParam
{
public
String
reportStatus
;
// 0:成功、2:承認中、999:その他エラー
public
String
message
;
// reportStatus = 0 以外の時のエラーメッセージ reportStatus = 0 の時は無し
private
static
TaskReportExtParam
instance
=
null
;
public
static
void
stock
(
String
reportStatus
,
String
message
)
{
if
(
instance
==
null
)
{
instance
=
new
TaskReportExtParam
();
}
instance
.
reportStatus
=
reportStatus
;
instance
.
message
=
message
;
}
public
static
TaskReportExtParam
pick
()
{
if
(
instance
==
null
||
instance
.
reportStatus
==
null
)
{
return
null
;
}
else
{
return
instance
;
}
}
public
static
void
clear
()
{
if
(
instance
!=
null
)
{
instance
.
message
=
null
;
instance
.
reportStatus
=
null
;
}
}
}
}
dashboard
@
92bfa7ec
Subproject commit
30c9f2ce9b4bb74e8851afb11b2b4670bca6ce68
Subproject commit
92bfa7ec340bfa215d0b1f2e06ef8e318c1dddad
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVContentViewActivity.java
View file @
7e1e33dd
...
...
@@ -56,6 +56,7 @@ import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import
jp.agentec.abook.abv.bl.logic.ContentReadingLogLogic
;
import
jp.agentec.abook.abv.bl.logic.LockReportLogic
;
import
jp.agentec.abook.abv.bl.logic.OperationLogic
;
import
jp.agentec.abook.abv.bl.logic.ReportStatusLogic
;
import
jp.agentec.abook.abv.bl.logic.UnlockReportLogic
;
import
jp.agentec.abook.abv.bl.websocket.MeetingManager
;
import
jp.agentec.abook.abv.cl.environment.DeviceInfo
;
...
...
@@ -975,8 +976,15 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
afterABookCheckApi
(
mCmd
,
mTaskKey
,
0
,
""
,
null
,
isOperationPdf
());
return
null
;
}
if
(
mAddReport
)
{
// 作業追加ありの場合
if
(
mCmd
.
equals
(
ABookKeys
.
CMD_INSERT_TASK_REPORT
)
||
mCmd
.
equals
(
ABookKeys
.
CMD_UPDATE_TASK_REPORT
))
{
ReportStatusLogic
.
TaskReportExtParam
extParam
=
ReportStatusLogic
.
TaskReportExtParam
.
pick
();
JSONObject
extJson
=
new
JSONObject
();
if
(
extParam
!=
null
)
{
extJson
.
put
(
"reportStatus"
,
extParam
.
reportStatus
);
extJson
.
put
(
"message"
,
extParam
.
message
);
}
afterABookCheckApi
(
mCmd
,
mTaskKey
,
0
,
""
,
extJson
.
toString
(),
isOperationPdf
());
}
else
if
(
mAddReport
)
{
// 作業追加ありの場合
// コールバック処理のみ行う。
afterABookCheckApi
(
mCmd
,
mTaskKey
,
0
,
""
,
null
,
isOperationPdf
());
}
else
{
...
...
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