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
1eddccd8
Commit
1eddccd8
authored
Feb 28, 2023
by
Kazuyuki Hida
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
オフライン時でも報告を保存できるようにした。件数表示などもそれに準拠するようにした。
まだ、オンライン復帰後にCMSに届ける処理ができていない。
parent
b25b1fd9
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
6 deletions
+61
-6
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/TaskReportDao.java
+18
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/OperationLogic.java
+32
-1
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/UnlockReportLogic.java
+1
-1
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/ABookCheckWebViewHelper.java
+10
-4
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/TaskReportDao.java
View file @
1eddccd8
...
...
@@ -533,4 +533,22 @@ public class TaskReportDao extends AbstractDao {
}
return
count
>
0
;
}
public
boolean
isWorking
(
String
taskKey
,
int
taskReportId
,
String
reportStartDate
)
{
int
count
;
StringBuilder
sql
=
new
StringBuilder
();
sql
.
append
(
"SELECT count(*) FROM t_task_report"
);
sql
.
append
(
" WHERE task_status = 1 "
);
if
(
reportStartDate
==
null
)
{
// 報告
sql
.
append
(
" AND task_key=?"
);
count
=
rawQueryGetInt
(
sql
.
toString
(),
new
String
[]
{
taskKey
});
}
else
{
// 点検
sql
.
append
(
" AND task_report_id=?"
);
sql
.
append
(
" AND datetime(report_start_date)=datetime(?, 'utc')"
);
count
=
rawQueryGetInt
(
sql
.
toString
(),
new
String
[]
{
String
.
valueOf
(
taskReportId
),
reportStartDate
});
}
return
count
>
0
;
}
}
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/OperationLogic.java
View file @
1eddccd8
...
...
@@ -65,6 +65,7 @@ import jp.agentec.adf.util.DateTimeUtil;
import
jp.agentec.adf.util.FileUtil
;
import
jp.agentec.adf.util.StringUtil
;
import
static
jp
.
agentec
.
abook
.
abv
.
bl
.
acms
.
client
.
json
.
OperationDataJSON
.
Task
;
import
static
jp
.
agentec
.
abook
.
abv
.
bl
.
acms
.
client
.
json
.
OperationListJSON
.
OperationEndDate
;
import
static
jp
.
agentec
.
abook
.
abv
.
bl
.
acms
.
client
.
json
.
OperationListJSON
.
OperationStartDate
;
...
...
@@ -949,7 +950,7 @@ public class OperationLogic extends AbstractLogic {
if
(!
routineTaskFlg
)
{
String
jsonText
=
FileUtil
.
readTextFile
(
contentPath
+
"/"
+
ABookKeys
.
TASK_REPORT
+
".json"
);
JSONObject
jsonObject
=
new
JSONObject
(
jsonText
);
JSONArray
taskReportJsonArray
=
jsonObject
.
getJSONArray
(
ABookKeys
.
KEY_TASK_REPORT_0
);
JSONArray
taskReportJsonArray
=
jsonObject
.
has
(
ABookKeys
.
KEY_TASK_REPORT_0
)
?
jsonObject
.
getJSONArray
(
ABookKeys
.
KEY_TASK_REPORT_0
)
:
new
JSONArray
(
);
for
(
int
i
=
0
;
i
<
taskReportJsonArray
.
length
();
i
++)
{
JSONObject
taskReportJsonObject
=
taskReportJsonArray
.
getJSONObject
(
i
);
String
taskKey
=
taskReportJsonObject
.
getString
(
ABookKeys
.
TASK_KEY
);
...
...
@@ -1498,7 +1499,16 @@ public class OperationLogic extends AbstractLogic {
}
throw
ex
;
}
catch
(
Exception
ex
)
{
Logger
.
e
(
TAG
,
ex
);
if
(
ex
instanceof
NetworkDisconnectedException
)
{
// オフラインの場合、エラー扱いにしないで、設問の状況から、taskStatusを推測する
taskReportDto
.
taskStatus
=
recoveryTaskStatus
(
taskReportDto
.
jsonData
);
taskReportDto
.
dataSendFlg
=
true
;
taskReportDto
.
attachedFileSendFlg
=
true
;
mTaskReportDao
.
update
(
taskReportDto
);
}
else
{
throw
ex
;
}
}
finally
{
if
(
zipFile
!=
null
)
{
zipFile
.
delete
();
...
...
@@ -1522,6 +1532,27 @@ public class OperationLogic extends AbstractLogic {
}
}
private
int
recoveryTaskStatus
(
String
taskReportInfo
)
{
JSONObject
jsonObject
=
new
JSONObject
(
taskReportInfo
);
JSONObject
taskObject
=
jsonObject
.
getJSONObject
(
Task
);
Iterator
<
String
>
keys
=
taskObject
.
keys
();
while
(
keys
.
hasNext
())
{
String
key
=
keys
.
next
();
if
(
key
.
startsWith
(
"q_3_"
))
{
// 状況入力欄
try
{
int
taskStatus
=
Integer
.
parseInt
(
taskObject
.
getString
(
key
));
if
(
taskStatus
!=
0
&&
taskStatus
!=
999
)
{
taskStatus
=
1
;
}
return
taskStatus
;
}
catch
(
Throwable
ignored
)
{
return
0
;
}
}
}
return
0
;
}
/**
* 作業関連ディレクトリ削除
*
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/UnlockReportLogic.java
View file @
1eddccd8
...
...
@@ -27,7 +27,7 @@ public class UnlockReportLogic extends AbstractLogic {
public
Result
unlock
(
String
taskKey
,
Long
taskReportId
,
Date
reportStartDate
)
{
Result
r
=
sendUnlockReport
(
taskKey
,
taskReportId
,
reportStartDate
);
if
(
r
.
result
==
0
)
{
if
(
r
.
result
==
0
||
r
.
extParam
.
reportStatus
==
3
)
{
updateLocalDB
(
taskKey
,
taskReportId
,
reportStartDate
,
r
.
extParam
.
getReportStatus
());
}
return
r
;
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/ABookCheckWebViewHelper.java
View file @
1eddccd8
...
...
@@ -98,21 +98,27 @@ public class ABookCheckWebViewHelper extends ABookHelper {
case
ABookKeys
.
CMD_UPDATE_TASK_REPORT
:
{
// もとから作業中だったかを調べる
TaskReportDao
taskReportDao
=
AbstractDao
.
getDao
(
TaskReportDao
.
class
);
int
rportId
=
Integer
.
parseInt
(
String
.
valueOf
(
param
.
getOrDefault
(
TaskReportId
,
"0"
)));
int
r
e
portId
=
Integer
.
parseInt
(
String
.
valueOf
(
param
.
getOrDefault
(
TaskReportId
,
"0"
)));
String
startDate
=
param
.
getOrDefault
(
ReportStartDate
,
null
);
boolean
isLocalSaved
=
taskReportDao
.
isLocalSaved
(
taskKey
,
rportId
,
startDate
);
boolean
isCompleted
=
taskReportDao
.
isCompleted
(
taskKey
,
rportId
,
startDate
);
boolean
isLocalSaved
=
taskReportDao
.
isLocalSaved
(
taskKey
,
reportId
,
startDate
);
boolean
isCompleted
=
taskReportDao
.
isCompleted
(
taskKey
,
reportId
,
startDate
);
boolean
isWorking
=
taskReportDao
.
isWorking
(
taskKey
,
reportId
,
startDate
);
// 報告書の更新
insertOrUpdateTaskReport
(
taskKey
,
enableReportHistory
,
operationId
,
contentId
,
param
,
contentPath
,
reportType
,
taskReportLevel
,
false
);
copyTaskAttachedMovie
(
operationId
,
contentId
,
taskKey
,
taskReportLevel
);
sendTaskData
(
context
,
operationId
,
taskKey
,
taskReportLevel
);
// 作業ステータスのカウントを変える
// 作業ステータスのカウントを変える
todo:要リファクタリング
OperationDao
operationDao
=
AbstractDao
.
getDao
(
OperationDao
.
class
);
if
(
isLocalSaved
)
{
operationDao
.
coutUpCompletedFromWorking
(
operationId
);
}
else
if
(!
isCompleted
)
{
boolean
nowWorking
=
taskReportDao
.
isWorking
(
taskKey
,
reportId
,
startDate
);
if
(!
isWorking
&&
nowWorking
)
{
operationDao
.
countUpWorking
(
operationId
);
}
else
{
operationDao
.
countUpCompleted
(
operationId
);
}
}
break
;
}
case
ABookKeys
.
CMD_LOCAL_SAVE_TASK_REPORT
:
// 一時保存
...
...
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