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
1bb6e002
You need to sign in or sign up before continuing.
Commit
1bb6e002
authored
Jan 18, 2023
by
Kazuyuki Hida
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JSに渡すJSONを作るところまでできた。
parent
df49fae1
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
698 additions
and
112 deletions
+698
-112
.idea/inspectionProfiles/Agentec.xml
+6
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/DashboardStatusJSON.java
+68
-17
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/type/AcmsApis.java
+3
-1
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/ABVDataOpenHelper.java
+2
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/DBConnector.java
+1
-1
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/DatabaseVersions.java
+1
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ReportStatusDao.java
+194
-1
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/tables/TTaskReportStatus.java
+53
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/DashboardStatusDto.java
+120
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/ReportStatusDto.java
+73
-81
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/TaskReportDto.java
+6
-6
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/OperationLogic.java
+6
-2
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/ReportStatusLogic.java
+50
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/DashboardActivity.java
+115
-3
No files found.
.idea/inspectionProfiles/Agentec.xml
View file @
1bb6e002
...
@@ -155,6 +155,7 @@
...
@@ -155,6 +155,7 @@
<option
name=
"ignoreEqualsMethod"
value=
"false"
/>
<option
name=
"ignoreEqualsMethod"
value=
"false"
/>
<option
name=
"m_limit"
value=
"1"
/>
<option
name=
"m_limit"
value=
"1"
/>
</inspection_tool>
</inspection_tool>
<inspection_tool
class=
"MultipleVariablesInDeclaration"
enabled=
"true"
level=
"ERROR"
enabled_by_default=
"true"
/>
<inspection_tool
class=
"NegatedIfElse"
enabled=
"true"
level=
"ERROR"
enabled_by_default=
"true"
>
<inspection_tool
class=
"NegatedIfElse"
enabled=
"true"
level=
"ERROR"
enabled_by_default=
"true"
>
<option
name=
"m_ignoreNegatedNullComparison"
value=
"true"
/>
<option
name=
"m_ignoreNegatedNullComparison"
value=
"true"
/>
<option
name=
"m_ignoreNegatedZeroComparison"
value=
"false"
/>
<option
name=
"m_ignoreNegatedZeroComparison"
value=
"false"
/>
...
@@ -217,6 +218,7 @@
...
@@ -217,6 +218,7 @@
</inspection_tool>
</inspection_tool>
<inspection_tool
class=
"ReuseOfLocalVariable"
enabled=
"false"
level=
"ERROR"
enabled_by_default=
"false"
/>
<inspection_tool
class=
"ReuseOfLocalVariable"
enabled=
"false"
level=
"ERROR"
enabled_by_default=
"false"
/>
<inspection_tool
class=
"SSBasedInspection"
enabled=
"false"
level=
"ERROR"
enabled_by_default=
"false"
/>
<inspection_tool
class=
"SSBasedInspection"
enabled=
"false"
level=
"ERROR"
enabled_by_default=
"false"
/>
<inspection_tool
class=
"SameParameterValue"
enabled=
"false"
level=
"WARNING"
enabled_by_default=
"false"
/>
<inspection_tool
class=
"SimplifiableIfStatement"
enabled=
"false"
level=
"ERROR"
enabled_by_default=
"false"
/>
<inspection_tool
class=
"SimplifiableIfStatement"
enabled=
"false"
level=
"ERROR"
enabled_by_default=
"false"
/>
<inspection_tool
class=
"SpellCheckingInspection"
enabled=
"false"
level=
"INFO"
enabled_by_default=
"false"
>
<inspection_tool
class=
"SpellCheckingInspection"
enabled=
"false"
level=
"INFO"
enabled_by_default=
"false"
>
<option
name=
"processCode"
value=
"true"
/>
<option
name=
"processCode"
value=
"true"
/>
...
@@ -225,6 +227,7 @@
...
@@ -225,6 +227,7 @@
</inspection_tool>
</inspection_tool>
<inspection_tool
class=
"StaticCallOnSubclass"
enabled=
"true"
level=
"ERROR"
enabled_by_default=
"true"
/>
<inspection_tool
class=
"StaticCallOnSubclass"
enabled=
"true"
level=
"ERROR"
enabled_by_default=
"true"
/>
<inspection_tool
class=
"StaticFieldReferenceOnSubclass"
enabled=
"true"
level=
"ERROR"
enabled_by_default=
"true"
/>
<inspection_tool
class=
"StaticFieldReferenceOnSubclass"
enabled=
"true"
level=
"ERROR"
enabled_by_default=
"true"
/>
<inspection_tool
class=
"StringBufferReplaceableByString"
enabled=
"false"
level=
"WARNING"
enabled_by_default=
"false"
/>
<inspection_tool
class=
"StringConcatenationInFormatCall"
enabled=
"true"
level=
"ERROR"
enabled_by_default=
"true"
/>
<inspection_tool
class=
"StringConcatenationInFormatCall"
enabled=
"true"
level=
"ERROR"
enabled_by_default=
"true"
/>
<inspection_tool
class=
"StringConcatenationInMessageFormatCall"
enabled=
"true"
level=
"ERROR"
enabled_by_default=
"true"
/>
<inspection_tool
class=
"StringConcatenationInMessageFormatCall"
enabled=
"true"
level=
"ERROR"
enabled_by_default=
"true"
/>
<inspection_tool
class=
"StringConcatenationMissingWhitespace"
enabled=
"false"
level=
"ERROR"
enabled_by_default=
"false"
/>
<inspection_tool
class=
"StringConcatenationMissingWhitespace"
enabled=
"false"
level=
"ERROR"
enabled_by_default=
"false"
/>
...
@@ -239,6 +242,9 @@
...
@@ -239,6 +242,9 @@
<inspection_tool
class=
"SuspiciousNameCombination"
enabled=
"false"
level=
"ERROR"
enabled_by_default=
"false"
>
<inspection_tool
class=
"SuspiciousNameCombination"
enabled=
"false"
level=
"ERROR"
enabled_by_default=
"false"
>
<group
names=
"x,width,left,right"
/>
<group
names=
"x,width,left,right"
/>
<group
names=
"y,height,top,bottom"
/>
<group
names=
"y,height,top,bottom"
/>
<ignored>
<option
name=
"METHOD_MATCHER_CONFIG"
value=
"java.io.PrintStream,println,java.io.PrintWriter,println,java.lang.System,identityHashCode,java.sql.PreparedStatement,set.*,java.sql.ResultSet,update.*,java.sql.SQLOutput,write.*,java.lang.Integer,compare.*,java.lang.Long,compare.*,java.lang.Short,compare,java.lang.Byte,compare,java.lang.Character,compare,java.lang.Boolean,compare,java.lang.Math,.*,java.lang.StrictMath,.*"
/>
</ignored>
</inspection_tool>
</inspection_tool>
<inspection_tool
class=
"SuspiciousSystemArraycopy"
enabled=
"true"
level=
"ERROR"
enabled_by_default=
"true"
/>
<inspection_tool
class=
"SuspiciousSystemArraycopy"
enabled=
"true"
level=
"ERROR"
enabled_by_default=
"true"
/>
<inspection_tool
class=
"SuspiciousToArrayCall"
enabled=
"true"
level=
"ERROR"
enabled_by_default=
"true"
/>
<inspection_tool
class=
"SuspiciousToArrayCall"
enabled=
"true"
level=
"ERROR"
enabled_by_default=
"true"
/>
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/json/DashboardStatusJSON.java
View file @
1bb6e002
...
@@ -9,14 +9,14 @@ import java.util.List;
...
@@ -9,14 +9,14 @@ import java.util.List;
import
jp.agentec.abook.abv.bl.common.exception.AcmsException
;
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.log.Logger
;
import
jp.agentec.abook.abv.bl.dto.
Report
StatusDto
;
import
jp.agentec.abook.abv.bl.dto.
Dashboard
StatusDto
;
import
jp.agentec.adf.util.DateTimeFormat
;
import
jp.agentec.adf.util.DateTimeFormat
;
import
jp.agentec.adf.util.DateTimeUtil
;
import
jp.agentec.adf.util.DateTimeUtil
;
public
class
DashboardStatusJSON
extends
AcmsCommonJSON
{
public
class
DashboardStatusJSON
extends
AcmsCommonJSON
{
private
static
final
String
TAG
=
"DashboardStatusJSON"
;
private
static
final
String
TAG
=
"DashboardStatusJSON"
;
private
List
<
ReportStatusDto
>
reportStatuses
=
new
ArrayList
<
ReportStatusDto
>()
;
private
List
<
DashboardStatusDto
>
reportStatuses
;
public
DashboardStatusJSON
(
String
jsonString
)
throws
AcmsException
{
public
DashboardStatusJSON
(
String
jsonString
)
throws
AcmsException
{
super
(
jsonString
);
super
(
jsonString
);
...
@@ -24,23 +24,30 @@ public class DashboardStatusJSON extends AcmsCommonJSON {
...
@@ -24,23 +24,30 @@ public class DashboardStatusJSON extends AcmsCommonJSON {
@Override
@Override
protected
void
parse
(
JSONObject
json
)
{
protected
void
parse
(
JSONObject
json
)
{
// 使わないので無視 //presentTimeUTC = dateOrNull(json.getString("presentTimeUTC"));
// 使わないので無視
→
//presentTimeUTC = dateOrNull(json.getString("presentTimeUTC"));
JSONArray
oprations
=
json
.
getJSONArray
(
"operationList"
);
JSONArray
oprations
=
json
.
getJSONArray
(
"operationList"
);
reportStatuses
=
new
ArrayList
<
DashboardStatusDto
>();
for
(
int
i
=
0
;
i
<
oprations
.
length
();
i
++)
{
for
(
int
i
=
0
;
i
<
oprations
.
length
();
i
++)
{
JSONObject
opJson
=
oprations
.
getJSONObject
(
i
);
JSONObject
opJson
=
oprations
.
getJSONObject
(
i
);
try
{
try
{
Long
operationId
=
longOrNull
(
opJson
.
getString
(
"operationId"
)
);
long
operationId
=
longOrZero
(
opJson
,
"operationId"
);
String
operationName
=
opJson
.
getString
(
"operationName"
);
String
operationName
=
stringOrNull
(
opJson
,
"operationName"
);
JSONArray
reports
=
opJson
.
getJSONArray
(
"reportList"
);
JSONArray
reports
=
opJson
.
getJSONArray
(
"reportList"
);
for
(
int
j
=
0
;
j
<
reports
.
length
();
j
++)
{
for
(
int
j
=
0
;
j
<
reports
.
length
();
j
++)
{
JSONObject
repJson
=
reports
.
getJSONObject
(
j
);
JSONObject
repJson
=
reports
.
getJSONObject
(
j
);
String
taskKey
=
repJson
.
getString
(
"taskKey"
);
String
taskKey
=
stringOrNull
(
repJson
,
"taskKey"
);
Long
taskReportId
=
longOrNull
(
repJson
.
getString
(
"taskReportId"
));
Long
taskReportId
=
longOrNull
(
repJson
,
"taskReportId"
);
Date
reportStartDate
=
dateOrNull
(
repJson
.
getString
(
"reportStartDate"
));
Date
reportStartDate
=
dateOrNull
(
repJson
,
"reportStartDate"
);
int
reportStatus
=
repJson
.
getInt
(
"reportStatus"
);
int
reportStatus
=
intOrZero
(
repJson
,
"reportStatus"
);
ReportStatusDto
rep
=
new
ReportStatusDto
(
DashboardStatusDto
rep
=
new
DashboardStatusDto
(
taskKey
,
taskReportId
,
reportStartDate
,
taskKey
,
operationId
,
operationName
,
reportStatus
taskReportId
,
reportStartDate
,
operationId
,
operationName
,
reportStatus
);
);
reportStatuses
.
add
(
rep
);
reportStatuses
.
add
(
rep
);
}
}
...
@@ -50,21 +57,65 @@ public class DashboardStatusJSON extends AcmsCommonJSON {
...
@@ -50,21 +57,65 @@ public class DashboardStatusJSON extends AcmsCommonJSON {
}
}
}
}
public
List
<
Report
StatusDto
>
getReportStatuses
()
{
public
List
<
Dashboard
StatusDto
>
getReportStatuses
()
{
return
reportStatuses
;
return
reportStatuses
;
}
}
private
Long
longOrNull
(
String
s
)
{
private
Long
longOrNull
(
JSONObject
json
,
String
key
)
{
try
{
if
(
json
.
has
(
key
))
{
return
json
.
getLong
(
key
);
}
else
{
return
null
;
}
}
catch
(
Exception
e
)
{
return
null
;
}
}
private
long
longOrZero
(
JSONObject
json
,
String
key
)
{
try
{
if
(
json
.
has
(
key
))
{
return
json
.
getLong
(
key
);
}
else
{
return
0
;
}
}
catch
(
Exception
e
)
{
return
0
;
}
}
private
int
intOrZero
(
JSONObject
json
,
String
key
)
{
try
{
try
{
return
Long
.
valueOf
(
s
);
if
(
json
.
has
(
key
))
{
return
json
.
getInt
(
key
);
}
else
{
return
0
;
}
}
catch
(
Exception
e
)
{
return
0
;
}
}
private
Date
dateOrNull
(
JSONObject
json
,
String
key
)
{
try
{
if
(
json
.
has
(
key
))
{
return
DateTimeUtil
.
toDate
(
json
.
getString
(
key
),
"UTC"
,
DateTimeFormat
.
yyyyMMdd_hyphen
);
}
else
{
return
null
;
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
return
null
;
return
null
;
}
}
}
}
private
Date
dateOrNull
(
String
s
)
{
private
String
stringOrNull
(
JSONObject
json
,
String
key
)
{
try
{
try
{
return
DateTimeUtil
.
toDate
(
s
,
"UTC"
,
DateTimeFormat
.
yyyyMMdd_hyphen
);
if
(
json
.
has
(
key
))
{
return
json
.
getString
(
key
);
}
else
{
return
null
;
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
return
null
;
return
null
;
}
}
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/type/AcmsApis.java
View file @
1bb6e002
...
@@ -213,7 +213,9 @@ public class AcmsApis {
...
@@ -213,7 +213,9 @@ public class AcmsApis {
methodName
.
equals
(
ApiSendPushMessage
)
||
methodName
.
equals
(
ApiGetPushMessages
)
||
methodName
.
equals
(
ApiSendRoutineTaskData
)
||
methodName
.
equals
(
ApiSendPushMessage
)
||
methodName
.
equals
(
ApiGetPushMessages
)
||
methodName
.
equals
(
ApiSendRoutineTaskData
)
||
methodName
.
equals
(
ApiGetMasterData
)
||
methodName
.
equals
(
ApiGetMasterData
)
||
// カテゴリ選択機能、IO帳票で3つ追加
// カテゴリ選択機能、IO帳票で3つ追加
methodName
.
equals
(
ApiOperationGroupMaster
)
||
methodName
.
equals
(
ApiQuickReportSearch
)
||
methodName
.
equals
(
ApiQuickReportRevision
))
{
methodName
.
equals
(
ApiOperationGroupMaster
)
||
methodName
.
equals
(
ApiQuickReportSearch
)
||
methodName
.
equals
(
ApiQuickReportRevision
)
||
// ダッシュボード追加
methodName
.
equals
(
ApiGetDashboardStatus
))
{
apiValue
=
Constant
.
ApiValue
.
checkapi
;
apiValue
=
Constant
.
ApiValue
.
checkapi
;
}
}
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/ABVDataOpenHelper.java
View file @
1bb6e002
...
@@ -37,6 +37,7 @@ import jp.agentec.abook.abv.bl.data.tables.TEnquete;
...
@@ -37,6 +37,7 @@ import jp.agentec.abook.abv.bl.data.tables.TEnquete;
import
jp.agentec.abook.abv.bl.data.tables.TMarkingSetting
;
import
jp.agentec.abook.abv.bl.data.tables.TMarkingSetting
;
import
jp.agentec.abook.abv.bl.data.tables.TOperation
;
import
jp.agentec.abook.abv.bl.data.tables.TOperation
;
import
jp.agentec.abook.abv.bl.data.tables.TPushMessage
;
import
jp.agentec.abook.abv.bl.data.tables.TPushMessage
;
import
jp.agentec.abook.abv.bl.data.tables.TTaskReportStatus
;
import
jp.agentec.abook.abv.bl.data.tables.TSppDevice
;
import
jp.agentec.abook.abv.bl.data.tables.TSppDevice
;
import
jp.agentec.abook.abv.bl.data.tables.TTask
;
import
jp.agentec.abook.abv.bl.data.tables.TTask
;
import
jp.agentec.abook.abv.bl.data.tables.TTaskReport
;
import
jp.agentec.abook.abv.bl.data.tables.TTaskReport
;
...
@@ -97,6 +98,7 @@ public class ABVDataOpenHelper {
...
@@ -97,6 +98,7 @@ public class ABVDataOpenHelper {
iTableScripts
.
add
(
new
TTaskReportSend
());
iTableScripts
.
add
(
new
TTaskReportSend
());
iTableScripts
.
add
(
new
TTaskReportItems
());
iTableScripts
.
add
(
new
TTaskReportItems
());
iTableScripts
.
add
(
new
TPushMessage
());
iTableScripts
.
add
(
new
TPushMessage
());
iTableScripts
.
add
(
new
TTaskReportStatus
());
// SPP通信端末管理テーブルをスクリプトに追加
// SPP通信端末管理テーブルをスクリプトに追加
iTableScripts
.
add
(
new
TSppDevice
());
iTableScripts
.
add
(
new
TSppDevice
());
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/DBConnector.java
View file @
1bb6e002
...
@@ -19,7 +19,7 @@ import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
...
@@ -19,7 +19,7 @@ import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
public
class
DBConnector
{
public
class
DBConnector
{
private
static
volatile
DBConnector
dbConnector
=
null
;
private
static
volatile
DBConnector
dbConnector
=
null
;
public
static
final
String
DatabaseName
=
"ABVJE"
;
public
static
final
String
DatabaseName
=
"ABVJE"
;
public
static
final
int
DatabaseVersion
=
DatabaseVersions
.
Ver1_0_
5
;
public
static
final
int
DatabaseVersion
=
DatabaseVersions
.
Ver1_0_
7
;
protected
SQLiteDatabase
db
=
null
;
protected
SQLiteDatabase
db
=
null
;
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/DatabaseVersions.java
View file @
1bb6e002
...
@@ -8,4 +8,5 @@ public class DatabaseVersions {
...
@@ -8,4 +8,5 @@ public class DatabaseVersions {
public
static
final
int
Ver1_0_4
=
31
;
// @From 作業の進捗状況を追加
public
static
final
int
Ver1_0_4
=
31
;
// @From 作業の進捗状況を追加
public
static
final
int
Ver1_0_5
=
41
;
// @From 作業のロック、差し戻し対応
public
static
final
int
Ver1_0_5
=
41
;
// @From 作業のロック、差し戻し対応
public
static
final
int
Ver1_0_6
=
51
;
// @From 作業のロック情報を追加
public
static
final
int
Ver1_0_6
=
51
;
// @From 作業のロック情報を追加
public
static
final
int
Ver1_0_7
=
61
;
// @From ダッシュボード対応
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/ReportStatusDao.java
View file @
1bb6e002
package
jp
.
agentec
.
abook
.
abv
.
bl
.
data
.
dao
;
package
jp
.
agentec
.
abook
.
abv
.
bl
.
data
.
dao
;
public
class
ReportStatusDao
{
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.ReportStatusDto
;
import
jp.agentec.adf.util.DateTimeFormat
;
import
jp.agentec.adf.util.DateTimeUtil
;
public
class
ReportStatusDao
extends
AbstractDao
{
public
void
insert
(
DashboardStatusDto
dto
)
{
StringBuilder
sql
=
new
StringBuilder
();
sql
.
append
(
"INSERT INTO "
).
append
(
TTaskReportStatus
.
tableName
).
append
(
" ("
);
sql
.
append
(
" task_key,"
);
sql
.
append
(
" task_report_id,"
);
sql
.
append
(
" report_start_date,"
);
sql
.
append
(
" operation_id,"
);
sql
.
append
(
" operation_name,"
);
sql
.
append
(
" report_status,"
);
sql
.
append
(
" untouched_flg,"
);
sql
.
append
(
" working_flg,"
);
sql
.
append
(
" complete_ok_flg,"
);
sql
.
append
(
" complete_ng_flg,"
);
sql
.
append
(
" incomplete_flg,"
);
sql
.
append
(
" alert_flg,"
);
sql
.
append
(
" send_backed_flg)"
);
sql
.
append
(
" VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)"
);
insert
(
sql
.
toString
(),
dto
.
getInsertValues
());
}
public
void
deleteAll
()
{
execSql
(
"DELETE FROM "
+
TTaskReportStatus
.
tableName
);
}
private
StringBuilder
commonSql
()
{
StringBuilder
sql
=
new
StringBuilder
();
sql
.
append
(
"SELECT"
);
sql
.
append
(
" t_task_report_status.report_status AS report_status,"
);
sql
.
append
(
" t_task_report_status.operation_id AS operation_id,"
);
sql
.
append
(
" t_task_report_status.operation_name AS operation_name,"
);
sql
.
append
(
" t_task_report.task_key AS task_key,"
);
sql
.
append
(
" t_task.task_code AS task_code,"
);
sql
.
append
(
" t_task_report.json_data AS json_data,"
);
sql
.
append
(
" t_task_report.task_report_id AS task_report_id,"
);
sql
.
append
(
" t_task_report.report_start_date AS report_start_date,"
);
sql
.
append
(
" t_task_report.report_lock_user_id AS report_lock_user_id,"
);
sql
.
append
(
" t_task_report.report_lock_user_name AS report_lock_user_name,"
);
sql
.
append
(
" t_task_report.report_lock_time AS report_lock_time,"
);
sql
.
append
(
" t_task_report.send_back_user_id AS send_back_user_id,"
);
sql
.
append
(
" t_task_report.send_back_user_name AS send_back_user_name,"
);
sql
.
append
(
" t_task_report.send_back_comment AS send_back_comment "
);
sql
.
append
(
" FROM t_task_report "
);
sql
.
append
(
" INNER JOIN t_task "
);
sql
.
append
(
" ON t_task_report.task_key = t_task.task_key "
);
sql
.
append
(
" INNER JOIN t_task_report_status"
);
// 定期点検の場合
sql
.
append
(
" ON (t_task_report.task_report_id = t_task_report_status.task_report_id"
);
sql
.
append
(
" AND t_task_report.report_start_date = t_task_report_status.report_start_date)"
);
// 報告の場合
sql
.
append
(
" OR (t_task_report.task_key = t_task_report_status.task_key"
);
sql
.
append
(
" AND t_task_report_status.task_report_id is null"
);
sql
.
append
(
" AND t_task_report_status.report_start_date is null)"
);
return
sql
;
}
public
List
<
ReportStatusDto
>
getUntouchedReport
()
{
StringBuilder
sql
=
commonSql
();
sql
.
append
(
"WHERE t_task_report_status.untouched_flg <> 0"
);
return
rawQueryGetDtoList
(
sql
.
toString
(),
new
String
[]
{},
ReportStatusDto
.
class
);
}
public
List
<
ReportStatusDto
>
getWorkingReport
()
{
StringBuilder
sql
=
commonSql
();
sql
.
append
(
"WHERE t_task_report_status.working_flg <> 0"
);
return
rawQueryGetDtoList
(
sql
.
toString
(),
new
String
[]
{},
ReportStatusDto
.
class
);
}
public
List
<
ReportStatusDto
>
getcompleteOkReport
()
{
StringBuilder
sql
=
commonSql
();
sql
.
append
(
"WHERE t_task_report_status.complete_ok_flg <> 0"
);
return
rawQueryGetDtoList
(
sql
.
toString
(),
new
String
[]
{},
ReportStatusDto
.
class
);
}
public
List
<
ReportStatusDto
>
getCompleteNgReport
()
{
StringBuilder
sql
=
commonSql
();
sql
.
append
(
"WHERE t_task_report_status.complete_ng_flg <> 0"
);
return
rawQueryGetDtoList
(
sql
.
toString
(),
new
String
[]
{},
ReportStatusDto
.
class
);
}
public
List
<
ReportStatusDto
>
getIncompleteReport
()
{
StringBuilder
sql
=
commonSql
();
sql
.
append
(
"WHERE t_task_report_status.incomplete_flg <> 0"
);
return
rawQueryGetDtoList
(
sql
.
toString
(),
new
String
[]
{},
ReportStatusDto
.
class
);
}
public
List
<
ReportStatusDto
>
getAlertReport
()
{
StringBuilder
sql
=
commonSql
();
sql
.
append
(
"WHERE t_task_report_status.alert_flg <> 0"
);
return
rawQueryGetDtoList
(
sql
.
toString
(),
new
String
[]
{},
ReportStatusDto
.
class
);
}
public
List
<
ReportStatusDto
>
getSendBackedReport
()
{
StringBuilder
sql
=
commonSql
();
sql
.
append
(
"WHERE t_task_report_status.send_backed_flg <> 0"
);
return
rawQueryGetDtoList
(
sql
.
toString
(),
new
String
[]
{},
ReportStatusDto
.
class
);
}
public
List
<
ReportStatusDto
>
getPendingReport
()
{
// 空のリストを返しておく todo
return
new
ArrayList
<
ReportStatusDto
>();
}
@Override
protected
ReportStatusDto
convert
(
Cursor
cursor
)
{
ReportStatusDto
dto
=
new
ReportStatusDto
();
dto
.
reportStatus
=
intOrZero
(
cursor
,
"report_status"
);
dto
.
operationId
=
longOrZero
(
cursor
,
"operation_id"
);
dto
.
operationName
=
stringOrEmpty
(
cursor
,
"operation_name"
);
dto
.
taskKey
=
stringOrEmpty
(
cursor
,
"task_key"
);
dto
.
taskCode
=
stringOrNull
(
cursor
,
"task_code"
);
dto
.
taskReportInfo
=
stringOrEmpty
(
cursor
,
"json_data"
);
dto
.
taskReportId
=
longOrNull
(
cursor
,
"task_report_id"
);
dto
.
reportStartDate
=
dateOrNull
(
cursor
,
"report_start_date"
);
dto
.
reportLockUserId
=
stringOrNull
(
cursor
,
"report_lock_user_id"
);
dto
.
reportLockUserName
=
stringOrNull
(
cursor
,
"report_lock_user_name"
);
dto
.
reportLockTime
=
dateOrNull
(
cursor
,
"report_lock_time"
);
dto
.
sendBackUserId
=
stringOrNull
(
cursor
,
"send_back_user_id"
);
dto
.
sendBackUserName
=
stringOrNull
(
cursor
,
"send_back_user_name"
);
dto
.
sendBackComment
=
stringOrNull
(
cursor
,
"send_back_comment"
);
return
dto
;
}
private
String
stringOrNull
(
Cursor
cursor
,
String
name
)
{
int
column
=
cursor
.
getColumnIndex
(
name
);
if
(
column
<
0
)
{
return
null
;
}
else
{
return
cursor
.
getString
(
column
);
}
}
private
String
stringOrEmpty
(
Cursor
cursor
,
String
name
)
{
int
column
=
cursor
.
getColumnIndex
(
name
);
if
(
column
<
0
)
{
return
""
;
}
else
{
return
cursor
.
getString
(
column
);
}
}
private
Date
dateOrNull
(
Cursor
cursor
,
String
name
)
{
int
column
=
cursor
.
getColumnIndex
(
name
);
if
(
column
<
0
)
{
return
null
;
}
else
{
String
date
=
cursor
.
getString
(
column
);
return
DateTimeUtil
.
toDate
(
date
,
"UTC"
,
DateTimeFormat
.
yyyyMMdd_hyphen
);
}
}
private
int
intOrZero
(
Cursor
cursor
,
String
name
)
{
int
column
=
cursor
.
getColumnIndex
(
name
);
if
(
column
<
0
)
{
return
0
;
}
else
{
return
cursor
.
getInt
(
column
);
}
}
private
long
longOrZero
(
Cursor
cursor
,
String
name
)
{
int
column
=
cursor
.
getColumnIndex
(
name
);
if
(
column
<
0
)
{
return
0
;
}
else
{
return
cursor
.
getLong
(
column
);
}
}
private
Long
longOrNull
(
Cursor
cursor
,
String
name
)
{
int
column
=
cursor
.
getColumnIndex
(
name
);
if
(
column
<
0
)
{
return
null
;
}
else
{
return
cursor
.
getLong
(
column
);
}
}
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/tables/TTaskReportStatus.java
0 → 100644
View file @
1bb6e002
package
jp
.
agentec
.
abook
.
abv
.
bl
.
data
.
tables
;
import
java.util.ArrayList
;
import
java.util.List
;
import
jp.agentec.abook.abv.bl.common.db.SQLiteDatabase
;
import
static
jp
.
agentec
.
abook
.
abv
.
bl
.
data
.
DatabaseVersions
.
Ver1_0_7
;
public
class
TTaskReportStatus
extends
SQLiteTableScript
{
public
static
final
String
tableName
=
"t_task_report_status"
;
@Override
public
List
<
String
>
getCreateScript
(
int
version
)
{
List
<
String
>
ddl
=
new
ArrayList
<
String
>();
StringBuilder
sql
=
new
StringBuilder
();
sql
.
append
(
"CREATE TABLE "
+
tableName
+
" ( "
);
sql
.
append
(
" task_key TEXT NOT NULL DEFAULT '',"
);
sql
.
append
(
" task_code TEXT NOT NULL DEFAULT '',"
);
sql
.
append
(
" task_report_id INTEGER,"
);
sql
.
append
(
" report_start_date DATETIME,"
);
sql
.
append
(
" operation_id BIGINT NOT NULL DEFAULT 0,"
);
sql
.
append
(
" operation_name TEXT NOT NULL DEFAULT '',"
);
sql
.
append
(
" report_status INTEGER NOT NULL DEFAULT 0,"
);
sql
.
append
(
" untouched_flg INTEGER NOT NULL DEFAULT 0,"
);
// 未実施(0x01)
sql
.
append
(
" working_flg INTEGER NOT NULL DEFAULT 0,"
);
// 作業中(0x02)
sql
.
append
(
" complete_ok_flg INTEGER NOT NULL DEFAULT 0,"
);
// 作業完了 異常なし(0x04)
sql
.
append
(
" complete_ng_flg INTEGER NOT NULL DEFAULT 0,"
);
// 作業完了 異常あり(0x08)
sql
.
append
(
" incomplete_flg INTEGER NOT NULL DEFAULT 0,"
);
// 期限切れ(0x10)
sql
.
append
(
" alert_flg INTEGER NOT NULL DEFAULT 0,"
);
// アラート(0x20)
sql
.
append
(
" send_backed_flg INTEGER NOT NULL DEFAULT 0)"
);
// 差し戻し(0x40)
ddl
.
add
(
sql
.
toString
());
return
ddl
;
}
@Override
public
List
<
String
>
getUpgradeScript
(
int
oldVersion
,
int
newVersion
)
{
if
(
oldVersion
<
Ver1_0_7
)
{
return
getCreateScript
(
newVersion
);
}
else
{
return
null
;
}
}
@Override
public
List
<
String
>
getMigrationScript
(
SQLiteDatabase
databaseConnection
,
int
oldVersion
,
int
newVersion
,
Object
[]
params
)
{
return
null
;
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/DashboardStatusDto.java
0 → 100644
View file @
1bb6e002
package
jp
.
agentec
.
abook
.
abv
.
bl
.
dto
;
import
java.util.Date
;
import
jp.agentec.adf.util.DateTimeFormat
;
import
jp.agentec.adf.util.DateTimeUtil
;
public
class
DashboardStatusDto
extends
AbstractDto
{
private
static
final
int
FLG_UNTOUCHED
=
0x01
;
// 未実施(0x01)
private
static
final
int
FLG_WORKING
=
0x02
;
// 作業中(0x02)
private
static
final
int
FLG_COMPLETE_OK
=
0x04
;
// 作業完了 異常なし(0x04)
private
static
final
int
FLG_COMPLETE_NG
=
0x08
;
// 作業完了 異常あり(0x08)
private
static
final
int
FLD_INCOMPLETED
=
0x10
;
// 期限切れ(0x10)
private
static
final
int
FLG_ALERT
=
0x20
;
// アラート(0x20)
private
static
final
int
FLG_SEND_BACK
=
0x40
;
// 差し戻し(0x40)
public
static
int
UNTOUCHED
=
0
;
// 0:未実施
public
static
int
WORKING
=
1
;
// 1:作業中
public
static
int
COMPLETE_OK
=
2
;
// 2:作業完了(異常なし)
public
static
int
COMPLETE_NG
=
3
;
// 3:作業完了(異常あり)
public
static
int
INCOMPLETED
=
4
;
// 4:期限切れ
public
static
int
ALERT
=
5
;
// 5:アラート
public
static
int
SEND_BACKED
=
6
;
// 6:差し戻し
public
static
int
IN_PROGRESS
=
7
;
// 7:一時保存
// taskReportを一意にさすためのキー
private
String
taskKey
;
private
Long
taskReportId
;
private
Date
reportStartDate
;
// 一覧表示で必要な付加情報
private
long
operationId
;
private
String
operationName
;
// taskの状態を示すビットフィールド
private
int
reportStatus
;
// reportStatusの各ビットに対応するフラグ
private
int
untouchedFlg
;
private
int
workingFlg
;
private
int
completeOkFlg
;
private
int
completeNgFlg
;
private
int
incompleteFlg
;
private
int
alertFlg
;
private
int
sendBackedFlg
;
public
DashboardStatusDto
(
String
taskKey
,
Long
taskReportId
,
Date
reportStartDate
,
long
operationId
,
String
operatonName
,
int
reportStatus
)
{
this
.
taskKey
=
taskKey
;
this
.
taskReportId
=
taskReportId
;
this
.
reportStartDate
=
reportStartDate
;
this
.
operationId
=
operationId
;
this
.
operationName
=
operatonName
;
this
.
reportStatus
=
reportStatus
;
untouchedFlg
=
reportStatus
&
FLG_UNTOUCHED
;
workingFlg
=
reportStatus
&
FLG_WORKING
;
completeOkFlg
=
reportStatus
&
FLG_COMPLETE_OK
;
completeNgFlg
=
reportStatus
&
FLG_COMPLETE_NG
;
incompleteFlg
=
reportStatus
&
FLD_INCOMPLETED
;
alertFlg
=
reportStatus
&
FLG_ALERT
;
sendBackedFlg
=
reportStatus
&
FLG_SEND_BACK
;
}
@Override
public
String
[]
getKeyValues
()
{
return
new
String
[]
{
String
.
valueOf
(
taskKey
),
String
.
valueOf
(
taskReportId
),
DateTimeUtil
.
toString
(
reportStartDate
,
DateTimeFormat
.
yyyyMMdd_hyphen
)
};
}
@Override
public
Object
[]
getInsertValues
()
{
return
new
Object
[]
{
taskKey
,
taskReportId
,
reportStartDate
,
operationId
,
operationName
,
reportStatus
,
untouchedFlg
,
// 未実施(0x01)
workingFlg
,
// 作業中(0x02)
completeOkFlg
,
// 作業完了 異常なし(0x04)
completeNgFlg
,
// 作業完了 異常あり(0x08)
incompleteFlg
,
// 期限切れ(0x10)
alertFlg
,
// アラート(0x20)
sendBackedFlg
// 差し戻し(0x40)
};
}
public
String
getTaskKey
()
{
return
taskKey
;
}
public
Long
getTaskReportId
()
{
return
taskReportId
;
}
public
Date
getReportStartDate
()
{
return
reportStartDate
;
}
public
int
getReportStatus
()
{
return
reportStatus
;
}
public
long
getOperationId
()
{
return
operationId
;
}
public
String
getOperationName
()
{
return
operationName
;
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/ReportStatusDto.java
View file @
1bb6e002
...
@@ -2,95 +2,87 @@ package jp.agentec.abook.abv.bl.dto;
...
@@ -2,95 +2,87 @@ package jp.agentec.abook.abv.bl.dto;
import
java.util.Date
;
import
java.util.Date
;
import
jp.agentec.adf.util.DateTimeFormat
;
import
jp.agentec.adf.util.DateTimeUtil
;
public
class
ReportStatusDto
extends
AbstractDto
{
public
class
ReportStatusDto
extends
AbstractDto
{
private
static
final
int
FLG_UNTOUCHED
=
0x01
;
// 未実施(0x01)
public
int
reportStatus
;
private
static
final
int
FLG_WORKING
=
0x02
;
// 作業中(0x02)
public
long
operationId
;
private
static
final
int
FLG_COMPLETE_OK
=
0x04
;
// 作業完了 異常なし(0x04)
public
String
operationName
;
private
static
final
int
FLG_COMPLETE_NG
=
0x08
;
// 作業完了 異常あり(0x08)
public
String
taskKey
;
private
static
final
int
FLD_INCOMPLETED
=
0x10
;
// 期限切れ(0x10)
public
String
taskCode
;
private
static
final
int
FLG_ALERT
=
0x20
;
// アラート(0x20)
public
String
taskReportInfo
;
private
static
final
int
FLG_SEND_BACK
=
0x40
;
// 差し戻し(0x40)
public
Long
taskReportId
;
public
Date
reportStartDate
;
public
static
int
UNTOUCHED
=
0
;
// 0:未実施
public
String
reportLockUserId
;
public
static
int
WORKING
=
1
;
// 1:作業中
public
String
reportLockUserName
;
public
static
int
COMPLETE_OK
=
2
;
// 2:作業完了(異常なし)
public
Date
reportLockTime
;
public
static
int
COMPLETE_NG
=
3
;
// 3:作業完了(異常あり)
public
String
sendBackUserId
;
public
static
int
INCOMPLETED
=
4
;
// 4:期限切れ
public
String
sendBackUserName
;
public
static
int
ALERT
=
5
;
// 5:アラート
public
String
sendBackComment
;
public
static
int
SEND_BACKED
=
6
;
// 6:差し戻し
public
static
int
IN_PROGRESS
=
7
;
// 7:一時保存
// taskReportを一意にさすためのキー
private
String
taskKey
;
private
Long
taskReportId
;
private
Date
reportStartDate
;
// 一覧表示で必要な付加情報
private
long
operationId
;
private
String
operatonName
;
// taskの状態を示すビットフィールド
private
int
reportStatus
;
// reportStatusの各ビットに対応するフラグ
private
boolean
untouchedFlg
;
private
boolean
workingFlg
;
private
boolean
completeOkFlg
;
private
boolean
completeNgFlg
;
private
boolean
incompleteFlg
;
private
boolean
alertFlg
;
private
boolean
sendBackedFlg
;
public
ReportStatusDto
(
String
taskKey
,
Long
taskReportId
,
Date
reportStartDate
,
Long
operationId
,
String
operatonName
,
int
reportStatus
)
{
this
.
taskKey
=
taskKey
;
this
.
taskReportId
=
taskReportId
;
this
.
reportStartDate
=
reportStartDate
;
this
.
operationId
=
operationId
;
this
.
operatonName
=
operatonName
;
this
.
reportStatus
=
reportStatus
;
untouchedFlg
=
(
reportStatus
&
FLG_UNTOUCHED
)
!=
0
;
workingFlg
=
(
reportStatus
&
FLG_WORKING
)
!=
0
;
completeOkFlg
=
(
reportStatus
&
FLG_COMPLETE_OK
)
!=
0
;
completeNgFlg
=
(
reportStatus
&
FLG_COMPLETE_NG
)
!=
0
;
incompleteFlg
=
(
reportStatus
&
FLD_INCOMPLETED
)
!=
0
;
alertFlg
=
(
reportStatus
&
FLG_ALERT
)
!=
0
;
sendBackedFlg
=
(
reportStatus
&
FLG_SEND_BACK
)
!=
0
;
}
@Override
@Override
public
String
[]
getKeyValues
()
{
public
String
[]
getKeyValues
()
{
return
new
String
[]
{
return
new
String
[
0
];
String
.
valueOf
(
taskKey
),
String
.
valueOf
(
taskReportId
),
DateTimeUtil
.
toString
(
reportStartDate
,
DateTimeFormat
.
yyyyMMdd_hyphen
)
};
}
}
@Override
@Override
public
Object
[]
getInsertValues
()
{
public
Object
[]
getInsertValues
()
{
return
new
Object
[]
{
return
new
Object
[
0
];
taskKey
,
}
taskReportId
,
reportStartDate
,
operationId
,
public
int
getReportStatus
()
{
operatonName
,
return
reportStatus
;
reportStatus
,
}
untouchedFlg
,
// 未実施(0x01)
workingFlg
,
// 作業中(0x02)
public
long
getOperationId
()
{
completeOkFlg
,
// 作業完了 異常なし(0x04)
return
operationId
;
completeNgFlg
,
// 作業完了 異常あり(0x08)
}
incompleteFlg
,
// 期限切れ(0x10)
alertFlg
,
// アラート(0x20)
public
String
getOperationName
()
{
sendBackedFlg
// 差し戻し(0x40)
return
operationName
;
};
}
public
String
getTaskKey
()
{
return
taskKey
;
}
public
String
getTaskCode
()
{
return
taskCode
;
}
public
String
getTaskReportInfo
()
{
return
taskReportInfo
;
}
public
Long
getTaskReportId
()
{
return
taskReportId
;
}
public
Date
getReportStartDate
()
{
return
reportStartDate
;
}
public
String
getReportLockUserId
()
{
return
reportLockUserId
;
}
public
String
getReportLockUserName
()
{
return
reportLockUserName
;
}
public
Date
getReportLockTime
()
{
return
reportLockTime
;
}
public
String
getSendBackUserId
()
{
return
sendBackUserId
;
}
public
String
getSendBackUserName
()
{
return
sendBackUserName
;
}
public
String
getSendBackComment
()
{
return
sendBackComment
;
}
}
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/dto/TaskReportDto.java
View file @
1bb6e002
...
@@ -26,12 +26,12 @@ public class TaskReportDto extends AbstractDto {
...
@@ -26,12 +26,12 @@ public class TaskReportDto extends AbstractDto {
public
String
attachedFileName
;
public
String
attachedFileName
;
public
boolean
localSavedFlg
;
// 一時保存用
public
boolean
localSavedFlg
;
// 一時保存用
public
String
reportLockUserId
=
"報告ユーザID"
;
// 報告ロックユーザId
public
String
reportLockUserId
=
null
;
// 報告ロックユーザId
public
String
reportLockUserName
=
"報告ユーザ名"
;
// 報告ロックユーザ名
public
String
reportLockUserName
=
null
;
// 報告ロックユーザ名
public
Date
reportLockTime
=
n
ew
Date
();
// 報告ロック日時
public
Date
reportLockTime
=
n
ull
;
// 報告ロック日時
public
String
sendBackUserId
=
"差戻ユーザID"
;
// 差し戻しユーザId 差し戻された場合のみ
public
String
sendBackUserId
=
null
;
// 差し戻しユーザId 差し戻された場合のみ
public
String
sendBackUserName
=
"差戻ユーザ名"
;
// 差し戻しユーザ名 差し戻された場合のみ
public
String
sendBackUserName
=
null
;
// 差し戻しユーザ名 差し戻された場合のみ
public
String
sendBackComment
=
"確認コメント"
;
// 確認コメント 差し戻された場合のみ
public
String
sendBackComment
=
null
;
// 確認コメント 差し戻された場合のみ
public
int
taskStatus
=
0
;
// 状況 0:未実施、1:作業中、999:作業完了
public
int
taskStatus
=
0
;
// 状況 0:未実施、1:作業中、999:作業完了
public
int
reportStatus
=
0
;
public
int
reportStatus
=
0
;
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/OperationLogic.java
View file @
1bb6e002
...
@@ -24,8 +24,6 @@ import jp.agentec.abook.abv.bl.acms.client.json.SceneEntryJSON;
...
@@ -24,8 +24,6 @@ import jp.agentec.abook.abv.bl.acms.client.json.SceneEntryJSON;
import
jp.agentec.abook.abv.bl.acms.client.json.WorkerGroupJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.WorkerGroupJSON
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.AcmsParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.AcmsParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.GetTaskFileParameters
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.GetTaskFileParameters
;
import
jp.agentec.abook.abv.bl.acms.type.OperationSortingType
;
import
jp.agentec.abook.abv.bl.acms.type.OperationType
;
import
jp.agentec.abook.abv.bl.common.ABVEnvironment
;
import
jp.agentec.abook.abv.bl.common.ABVEnvironment
;
import
jp.agentec.abook.abv.bl.common.Constant
;
import
jp.agentec.abook.abv.bl.common.Constant
;
import
jp.agentec.abook.abv.bl.common.Callback
;
import
jp.agentec.abook.abv.bl.common.Callback
;
...
@@ -252,6 +250,12 @@ public class OperationLogic extends AbstractLogic {
...
@@ -252,6 +250,12 @@ public class OperationLogic extends AbstractLogic {
String
operationTaskDirPath
=
ABVEnvironment
.
getInstance
().
getOperationDirFile
(
deleteOperationDto
.
operationId
);
String
operationTaskDirPath
=
ABVEnvironment
.
getInstance
().
getOperationDirFile
(
deleteOperationDto
.
operationId
);
FileUtil
.
delete
(
operationTaskDirPath
);
FileUtil
.
delete
(
operationTaskDirPath
);
}
}
// 一通りの更新が終わってから、ダッシュボード用の情報を取得する
// todo
Logger
.
i
(
TAG
,
"update tasks on dashboard"
);
ReportStatusLogic
logic
=
new
ReportStatusLogic
();
logic
.
loadReportStatus
();
}
}
/**
/**
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/ReportStatusLogic.java
View file @
1bb6e002
package
jp
.
agentec
.
abook
.
abv
.
bl
.
logic
;
package
jp
.
agentec
.
abook
.
abv
.
bl
.
logic
;
import
java.util.List
;
import
jp.agentec.abook.abv.bl.acms.client.AcmsClient
;
import
jp.agentec.abook.abv.bl.acms.client.json.DashboardStatusJSON
;
import
jp.agentec.abook.abv.bl.acms.client.parameters.AcmsParameters
;
import
jp.agentec.abook.abv.bl.common.exception.AcmsException
;
import
jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException
;
import
jp.agentec.abook.abv.bl.common.log.Logger
;
import
jp.agentec.abook.abv.bl.data.dao.ReportStatusDao
;
import
jp.agentec.abook.abv.bl.dto.DashboardStatusDto
;
import
jp.agentec.abook.abv.bl.dto.ReportStatusDto
;
public
class
ReportStatusLogic
extends
AbstractLogic
{
public
class
ReportStatusLogic
extends
AbstractLogic
{
private
static
final
String
TAG
=
"ReportStatusLogic"
;
private
List
<
DashboardStatusDto
>
getDashboardStatus
()
{
if
(!
networkAdapter
.
isNetworkConnected
())
{
return
null
;
}
try
{
AcmsClient
client
=
AcmsClient
.
getInstance
(
networkAdapter
);
String
sid
=
cache
.
getMemberInfo
().
sid
;
AcmsParameters
params
=
new
AcmsParameters
(
sid
);
DashboardStatusJSON
statuses
=
client
.
getDashboardStatus
(
params
);
return
statuses
.
getReportStatuses
();
}
catch
(
NetworkDisconnectedException
e
)
{
return
null
;
}
catch
(
AcmsException
e
)
{
Logger
.
e
(
TAG
,
e
.
getLocalizedMessage
());
return
null
;
}
}
public
void
loadReportStatus
()
{
List
<
DashboardStatusDto
>
received
=
getDashboardStatus
();
if
(
received
!=
null
&&
!
received
.
isEmpty
())
{
// DBの更新
ReportStatusDao
dao
=
new
ReportStatusDao
();
dao
.
beginTransaction
();
try
{
dao
.
deleteAll
();
for
(
DashboardStatusDto
dto
:
received
)
{
dao
.
insert
(
dto
);
}
dao
.
commit
();
}
catch
(
Throwable
e
)
{
dao
.
rollback
();
}
}
}
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/DashboardActivity.java
View file @
1bb6e002
...
@@ -14,11 +14,20 @@ import android.widget.ImageButton;
...
@@ -14,11 +14,20 @@ import android.widget.ImageButton;
import
android.widget.LinearLayout
;
import
android.widget.LinearLayout
;
import
android.widget.ProgressBar
;
import
android.widget.ProgressBar
;
import
org.json.adf.JSONArray
;
import
org.json.adf.JSONObject
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
jp.agentec.abook.abv.bl.common.constant.ABookKeys
;
import
jp.agentec.abook.abv.bl.common.constant.ABookKeys
;
import
jp.agentec.abook.abv.bl.common.log.Logger
;
import
jp.agentec.abook.abv.bl.common.log.Logger
;
import
jp.agentec.abook.abv.bl.data.dao.AbstractDao
;
import
jp.agentec.abook.abv.bl.data.dao.ReportStatusDao
;
import
jp.agentec.abook.abv.bl.dto.ReportStatusDto
;
import
jp.agentec.abook.abv.launcher.android.R
;
import
jp.agentec.abook.abv.launcher.android.R
;
import
jp.agentec.abook.abv.ui.viewer.view.CheckFormWebview
;
import
jp.agentec.abook.abv.ui.viewer.view.CheckFormWebview
;
...
@@ -213,7 +222,17 @@ public class DashboardActivity extends OperationActivity {
...
@@ -213,7 +222,17 @@ public class DashboardActivity extends OperationActivity {
switch
(
cmd
)
{
switch
(
cmd
)
{
case
CMD_GET_REPORT_LIST:
{
case
CMD_GET_REPORT_LIST:
{
return
getReportList
();
try
{
String
reportStatusId
=
abookCheckParam
.
get
(
"reportStatusId"
);
if
(
reportStatusId
!=
null
)
{
return
getReportList
(
Integer
.
parseInt
(
reportStatusId
));
}
else
{
return
false
;
}
}
catch
(
Throwable
e
)
{
Logger
.
e
(
TAG
,
e
);
return
false
;
}
}
}
case
CMD_LOCK_REPORT:
{
case
CMD_LOCK_REPORT:
{
return
lockReport
();
return
lockReport
();
...
@@ -225,9 +244,102 @@ public class DashboardActivity extends OperationActivity {
...
@@ -225,9 +244,102 @@ public class DashboardActivity extends OperationActivity {
return
false
;
return
false
;
}
}
private
boolean
getReportList
()
{
private
boolean
getReportList
(
int
reportStatusId
)
{
//todo
ReportStatusDao
dao
=
AbstractDao
.
getDao
(
ReportStatusDao
.
class
);
List
<
ReportStatusDto
>
reports
=
null
;
switch
(
reportStatusId
)
{
case
0
:
{
reports
=
dao
.
getUntouchedReport
();
break
;
}
case
1
:
{
reports
=
dao
.
getWorkingReport
();
break
;
}
case
2
:
{
reports
=
dao
.
getcompleteOkReport
();
break
;
}
case
3
:
{
reports
=
dao
.
getCompleteNgReport
();
break
;
}
case
4
:
{
reports
=
dao
.
getIncompleteReport
();
break
;
}
case
5
:
{
reports
=
dao
.
getAlertReport
();
break
;
}
case
6
:
{
reports
=
dao
.
getSendBackedReport
();
break
;
}
case
7
:
{
reports
=
dao
.
getPendingReport
();
}
}
if
(
reports
!=
null
)
{
JSONObject
param
=
makeReportTree
(
reportStatusId
,
reports
);
return
true
;
return
true
;
}
else
{
return
false
;
}
}
private
JSONObject
makeReportTree
(
int
reportStatusId
,
List
<
ReportStatusDto
>
reports
)
{
JSONObject
tree
=
new
JSONObject
();
tree
.
put
(
"reportStatusId"
,
reportStatusId
);
JSONArray
operationList
=
new
JSONArray
();
tree
.
put
(
"operationList"
,
operationList
);
// operationIDで、ソートしておく
Collections
.
sort
(
reports
,
new
ReportCompalator
());
JSONObject
operation
=
null
;
for
(
ReportStatusDto
report
:
reports
)
{
if
(
operation
==
null
||
operation
.
getLong
(
"operationId"
)
!=
report
.
getOperationId
())
{
// 新しい作業の追加
operation
=
new
JSONObject
();
operation
.
put
(
"operationId"
,
report
.
getOperationId
());
operation
.
put
(
"operationName"
,
report
.
getOperationName
());
operation
.
put
(
"reportList"
,
new
JSONArray
());
tree
.
getJSONArray
(
"operationList"
).
put
(
operation
);
}
JSONObject
task
=
new
JSONObject
();
task
.
put
(
"taskKey"
,
report
.
getTaskKey
());
task
.
put
(
"taskReportInfo"
,
report
.
getTaskReportInfo
());
task
.
put
(
"taskReportId"
,
report
.
getTaskReportId
());
task
.
put
(
"reportStartDate"
,
report
.
getReportStartDate
());
task
.
put
(
"reportLockUserId"
,
report
.
getReportLockUserId
());
task
.
put
(
"reportLockUserName"
,
report
.
getReportLockUserName
());
task
.
put
(
"reportLockTime"
,
report
.
reportLockTime
);
task
.
put
(
"sendBackUserId"
,
report
.
sendBackUserId
);
task
.
put
(
"sendBackUserName"
,
report
.
sendBackUserName
);
operation
.
getJSONArray
(
"reportList"
).
put
(
task
);
}
return
tree
;
}
private
static
class
ReportCompalator
implements
Comparator
<
ReportStatusDto
>
{
@Override
public
int
compare
(
ReportStatusDto
o1
,
ReportStatusDto
o2
)
{
if
(
o1
==
null
&&
o2
==
null
)
{
return
0
;
}
else
if
(
o1
==
null
)
{
return
1
;
}
else
if
(
o2
==
null
)
{
return
-
1
;
}
return
Long
.
compare
(
o1
.
getOperationId
(),
o2
.
getOperationId
());
}
}
}
private
boolean
lockReport
()
{
private
boolean
lockReport
()
{
...
...
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