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
9922d073
Commit
9922d073
authored
Mar 01, 2023
by
Kazuyuki Hida
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/contract/sato/1.0.300_52170_unlock_icon2' into 'contract/sato/1.0.300'
いろいろな不具合を修正 See merge request
!299
parents
7a5fdf31
00fe6ff1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
72 additions
and
11 deletions
+72
-11
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
+34
-2
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/UnlockReportLogic.java
+1
-1
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVContentViewActivity.java
+8
-3
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/ABookCheckWebViewHelper.java
+11
-5
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/data/dao/TaskReportDao.java
View file @
9922d073
...
...
@@ -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 @
9922d073
...
...
@@ -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,17 @@ public class OperationLogic extends AbstractLogic {
}
throw
ex
;
}
catch
(
Exception
ex
)
{
throw
ex
;
Logger
.
e
(
TAG
,
ex
);
if
(
ex
instanceof
NetworkDisconnectedException
)
{
// オフラインの場合、エラー扱いにしないで、設問の状況から、taskStatusを推測する
taskReportDto
.
taskStatus
=
recoveryTaskStatus
(
taskReportDto
.
jsonData
);
taskReportDto
.
dataSendFlg
=
true
;
mTaskReportDao
.
update
(
taskReportDto
);
// CMSへの送信は打ち切り
return
;
}
else
{
throw
ex
;
}
}
finally
{
if
(
zipFile
!=
null
)
{
zipFile
.
delete
();
...
...
@@ -1522,6 +1533,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 @
9922d073
...
...
@@ -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/common/activity/ABVContentViewActivity.java
View file @
9922d073
...
...
@@ -90,8 +90,10 @@ import jp.agentec.adf.util.FileUtil;
import
jp.agentec.adf.util.StringUtil
;
import
static
jp
.
agentec
.
abook
.
abv
.
bl
.
acms
.
client
.
json
.
OperationDataJSON
.
Message
;
import
static
jp
.
agentec
.
abook
.
abv
.
bl
.
acms
.
client
.
json
.
OperationDataJSON
.
ReportStartDate
;
import
static
jp
.
agentec
.
abook
.
abv
.
bl
.
acms
.
client
.
json
.
OperationDataJSON
.
ReportStatus
;
import
static
jp
.
agentec
.
abook
.
abv
.
bl
.
acms
.
client
.
json
.
OperationDataJSON
.
TaskKey
;
import
static
jp
.
agentec
.
abook
.
abv
.
bl
.
acms
.
client
.
json
.
OperationDataJSON
.
TaskReportId
;
public
abstract
class
ABVContentViewActivity
extends
ABVAuthenticatedActivity
{
...
...
@@ -990,7 +992,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
try
{
logic
.
createJsonForOperationContent
(
operationDto
.
operationId
,
mContentPath
,
operationDto
.
reportType
==
Constant
.
ReportType
.
RoutineTask
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
(
);
Logger
.
e
(
TAG
,
e
.
getLocalizedMessage
()
);
}
// コールバック
ReportStatusLogic
.
TaskReportExtParam
extParam
=
ReportStatusLogic
.
TaskReportExtParam
.
pick
();
...
...
@@ -1121,8 +1123,11 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
// アンロック
UnlockReportLogic
.
Result
r
=
UnlockReportLogic
.
newInstance
().
unlock
(
taskKey
,
taskReportId
,
startDate
);
// JSコールバック
// アンロックの失敗は無視
afterABookCheckApi
(
mCmd
,
mTaskKey
,
0
,
""
,
"{'reportStatus':0}"
);
JSONObject
extParam
=
new
JSONObject
();
extParam
.
put
(
ReportStatus
,
0
);
extParam
.
put
(
TaskReportId
,
taskReportId
);
extParam
.
put
(
ReportStartDate
,
DateTimeUtil
.
toStringInTimeZone
(
startDate
,
DateTimeFormat
.
yyyyMMddHHmmss_hyphen
,
"UTC"
));
afterABookCheckApi
(
mCmd
,
mTaskKey
,
0
,
""
,
extParam
.
toString
());
}
}
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/ABookCheckWebViewHelper.java
View file @
9922d073
...
...
@@ -98,20 +98,26 @@ 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
)
{
operationDao
.
countUpCompleted
(
operationId
);
boolean
nowWorking
=
taskReportDao
.
isWorking
(
taskKey
,
reportId
,
startDate
);
if
(!
isWorking
&&
nowWorking
)
{
operationDao
.
countUpWorking
(
operationId
);
}
else
{
operationDao
.
countUpCompleted
(
operationId
);
}
}
break
;
}
...
...
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