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
e38d4b24
Commit
e38d4b24
authored
Jan 24, 2023
by
Kazuyuki Hida
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ダッシュボード用のAPI(getReportStatusCount)を実装した。動作確認ができていない。
parent
5e96dcf4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
126 additions
and
45 deletions
+126
-45
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ReportStatusDao.java
+47
-1
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/ReportStatusCountDto.java
+31
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/DashboardActivity.java
+48
-44
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ReportStatusDao.java
View file @
e38d4b24
package
jp
.
agentec
.
abook
.
abv
.
bl
.
data
.
dao
;
import
org.json.adf.JSONArray
;
import
org.json.adf.JSONObject
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
jp.agentec.abook.abv.bl.common.db.Cursor
;
import
jp.agentec.abook.abv.bl.data.tables.TTaskReportStatus
;
import
jp.agentec.abook.abv.bl.dto.DashboardStatusDto
;
import
jp.agentec.abook.abv.bl.dto.ReportStatusCountDto
;
import
jp.agentec.abook.abv.bl.dto.ReportStatusDto
;
import
jp.agentec.adf.util.DateTimeFormat
;
import
jp.agentec.adf.util.DateTimeUtil
;
...
...
@@ -82,7 +87,7 @@ public class ReportStatusDao extends AbstractDao {
return
rawQueryGetDtoList
(
sql
.
toString
(),
new
String
[]
{},
ReportStatusDto
.
class
);
}
public
List
<
ReportStatusDto
>
get
c
ompleteOkReport
()
{
public
List
<
ReportStatusDto
>
get
C
ompleteOkReport
()
{
StringBuilder
sql
=
reportStatusSql
();
sql
.
append
(
"WHERE t_task_report_status.complete_ok_flg <> 0"
);
return
rawQueryGetDtoList
(
sql
.
toString
(),
new
String
[]
{},
ReportStatusDto
.
class
);
...
...
@@ -215,4 +220,45 @@ public class ReportStatusDao extends AbstractDao {
return
cursor
.
getLong
(
column
);
}
}
public
List
<
ReportStatusCountDto
>
getReportStatusCountList
()
{
List
<
ReportStatusCountDto
>
list
=
new
ArrayList
<
ReportStatusCountDto
>();
/*
0:未実施、1:作業中、
2:作業完了(異常なし)、
3:作業完了(異常あり)、
4:期限切れ、5:アラート、
6:差し戻し、7:一時保存
*/
list
.
add
(
makeDto
(
0
,
getUntouchedReport
().
size
()));
list
.
add
(
makeDto
(
1
,
getWorkingReport
().
size
()));
list
.
add
(
makeDto
(
2
,
getCompleteOkReport
().
size
()));
list
.
add
(
makeDto
(
3
,
getCompleteNgReport
().
size
()));
list
.
add
(
makeDto
(
4
,
getIncompleteReport
().
size
()));
list
.
add
(
makeDto
(
5
,
getAlertReport
().
size
()));
list
.
add
(
makeDto
(
6
,
getSendBackedReport
().
size
()));
list
.
add
(
makeDto
(
7
,
getPendingReport
().
size
()));
return
list
;
}
private
ReportStatusCountDto
makeDto
(
int
id
,
int
count
)
{
return
new
ReportStatusCountDto
(
String
.
valueOf
(
id
),
String
.
valueOf
(
count
));
}
public
JSONObject
getReportStatusCountJson
()
{
JSONArray
list
=
new
JSONArray
();
for
(
ReportStatusCountDto
dto:
getReportStatusCountList
())
{
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"reportStatusId"
,
dto
.
getReportStatusId
());
json
.
put
(
"reportStatusCount"
,
dto
.
getReportStatusCount
());
list
.
put
(
json
);
}
JSONObject
result
=
new
JSONObject
();
result
.
put
(
"reportStatusCountList"
,
list
);
return
result
;
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/ReportStatusCountDto.java
0 → 100644
View file @
e38d4b24
package
jp
.
agentec
.
abook
.
abv
.
bl
.
dto
;
public
class
ReportStatusCountDto
extends
AbstractDto
{
@Override
public
String
[]
getKeyValues
()
{
return
new
String
[
0
];
}
@Override
public
Object
[]
getInsertValues
()
{
return
new
Object
[
0
];
}
public
ReportStatusCountDto
(
String
id
,
String
count
)
{
reportStatusId
=
id
;
reportStatusCount
=
count
;
}
private
final
String
reportStatusId
;
private
final
String
reportStatusCount
;
public
String
getReportStatusId
()
{
return
reportStatusId
;
}
public
String
getReportStatusCount
()
{
return
reportStatusCount
;
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/DashboardActivity.java
View file @
e38d4b24
...
...
@@ -6,6 +6,7 @@ import android.net.Uri;
import
android.os.Bundle
;
import
android.view.View
;
import
android.view.inputmethod.EditorInfo
;
import
android.webkit.JavascriptInterface
;
import
android.webkit.WebChromeClient
;
import
android.webkit.WebSettings
;
import
android.webkit.WebView
;
...
...
@@ -74,7 +75,8 @@ public class DashboardActivity extends OperationActivity {
@Override
public
void
onClick
(
View
v
)
{
Logger
.
d
(
TAG
,
"ReloadUrl"
);
webView
.
loadUrl
(
DASHBOARD_URL
);
webView
.
loadUrl
(
"javascript:CHK_Dashboard.init()"
);
// webView.loadUrl(DASHBOARD_URL);
}
});
...
...
@@ -127,7 +129,7 @@ public class DashboardActivity extends OperationActivity {
webView
.
setWebChromeClient
(
new
ChromeClient
());
webView
.
setWebViewClient
(
new
ViewClient
());
// webView.addJavascriptInterface(jsInf
, "android");
webView
.
addJavascriptInterface
(
new
JsInf
()
,
"android"
);
Logger
.
d
(
TAG
,
"loadUrl: "
+
DASHBOARD_URL
);
}
...
...
@@ -164,47 +166,47 @@ public class DashboardActivity extends OperationActivity {
}
}
//
private class JsInf {
//
//
@JavascriptInterface
//
public void existSetLocation(String ret) {
//
Logger.d(TAG, "existSetLocation=%s", ret);
//
if (ret != null && ret.equals("true")) { // setLocationメソッドが存在する場合、ページ読み込み完了とみなす
//
isPageFinished = true;
//
} else { // 存在しない場合、ページ読み込み未完了とみなし1秒後に再度呼出しを繰り返す
//
handler.postDelayed(new Runnable() {
//
@Override
//
public void run() {
//
callExistsSetLocation();
//
}
//
}, 1000);
//
}
//
}
//
//
@JavascriptInterface
//
public void existSendLog(String ret) {
//
Logger.d(TAG, "existSendLog=%s", ret);
//
if (ret != null && ret.equals("true")) {
//
runOnUiThread(new Runnable() { // sendLogメソッドが存在する場合、呼び出す
//
@Override
//
public void run() {
//
try {
//
webView.loadUrl("javascript:sendLog()");
//
} catch (Exception e) {
//
Logger.e(TAG, "javascript:sendLog error. " + e.toString());
//
}
//
}
//
});
//
} else {
// finishActivity
();
//
}
//
}
//
//
@JavascriptInterface
//
public void getAttachedDataUrl(String taskKey, String data) {
//
commonAttachedDataUrl(taskKey, data);
//
}
//
}
private
class
JsInf
{
@JavascriptInterface
public
void
existSetLocation
(
String
ret
)
{
Logger
.
d
(
TAG
,
"existSetLocation=%s"
,
ret
);
if
(
ret
!=
null
&&
ret
.
equals
(
"true"
))
{
// setLocationメソッドが存在する場合、ページ読み込み完了とみなす
//
isPageFinished = true;
}
else
{
// 存在しない場合、ページ読み込み未完了とみなし1秒後に再度呼出しを繰り返す
handler
.
postDelayed
(
new
Runnable
()
{
@Override
public
void
run
()
{
//
callExistsSetLocation();
}
},
1000
);
}
}
@JavascriptInterface
public
void
existSendLog
(
String
ret
)
{
Logger
.
d
(
TAG
,
"existSendLog=%s"
,
ret
);
if
(
ret
!=
null
&&
ret
.
equals
(
"true"
))
{
runOnUiThread
(
new
Runnable
()
{
// sendLogメソッドが存在する場合、呼び出す
@Override
public
void
run
()
{
try
{
webView
.
loadUrl
(
"javascript:sendLog()"
);
}
catch
(
Exception
e
)
{
Logger
.
e
(
TAG
,
"javascript:sendLog error. "
+
e
.
toString
());
}
}
});
}
else
{
finish
();
}
}
@JavascriptInterface
public
void
getAttachedDataUrl
(
String
taskKey
,
String
data
)
{
//
commonAttachedDataUrl(taskKey, data);
}
}
private
class
ViewClient
extends
WebViewClient
{
...
...
@@ -302,7 +304,7 @@ public class DashboardActivity extends OperationActivity {
break
;
}
case
2
:
{
reports
=
dao
.
get
c
ompleteOkReport
();
reports
=
dao
.
get
C
ompleteOkReport
();
break
;
}
case
3
:
{
...
...
@@ -495,4 +497,6 @@ public class DashboardActivity extends OperationActivity {
return
null
;
}
}
}
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