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
4eb068c6
Commit
4eb068c6
authored
Apr 04, 2022
by
Kim Jinsung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Question #46359 eXFrame 同期エラー
同期・送信処理のパフォーマンス改善
parent
4e8470d2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
122 additions
and
50 deletions
+122
-50
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/OperationLogic.java
+0
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVAuthenticatedActivity.java
+69
-23
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVContentViewActivity.java
+25
-10
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationListActivity.java
+0
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/ABookCheckWebViewHelper.java
+28
-15
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/OzdFileHelper.java
+0
-2
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/OperationLogic.java
View file @
4eb068c6
This diff is collapsed.
Click to expand it.
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVAuthenticatedActivity.java
View file @
4eb068c6
...
...
@@ -1416,13 +1416,11 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
}
return
errorMsg
.
length
()
>
0
?
errorMsg
.
toString
()
:
null
;
}
/**
* 作業データ受信
* @param operationId
* @param progressCallback
* @return
* @param operationId
作業ID
* @param progressCallback
プログレスバー表示用コールバック
* @return
作業更新日
* @throws NetworkDisconnectedException
* @throws ABVException
* @throws IOException
...
...
@@ -1431,6 +1429,22 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
* @throws ZipException
*/
public
Date
receptionTaskData
(
long
operationId
,
Callback
progressCallback
,
StringBuilder
errorMsg
)
throws
NetworkDisconnectedException
,
ABVException
,
IOException
,
InterruptedException
,
NoSuchAlgorithmException
,
ZipException
{
return
receptionTaskData
(
operationId
,
progressCallback
,
errorMsg
,
null
);
}
/**
* 作業データ受信
* @param operationId 作業ID
* @param progressCallback プログレスバー表示用コールバック
* @param taskKey タスクキー
* @return 作業更新日
* @throws NetworkDisconnectedException
* @throws ABVException
* @throws IOException
* @throws InterruptedException
* @throws NoSuchAlgorithmException
* @throws ZipException
*/
public
Date
receptionTaskData
(
long
operationId
,
Callback
progressCallback
,
StringBuilder
errorMsg
,
String
taskKey
)
throws
NetworkDisconnectedException
,
ABVException
,
IOException
,
InterruptedException
,
NoSuchAlgorithmException
,
ZipException
{
GetOperationDataParameters
param
=
new
GetOperationDataParameters
(
ABVDataCache
.
getInstance
().
getMemberInfo
().
sid
,
operationId
);
OperationDto
operationDto
=
mOperationLogic
.
getOperation
(
operationId
);
OperationContentDto
operationContentDto
=
mOperationContentDao
.
getOperationMainContent
(
operationId
);
...
...
@@ -1441,17 +1455,24 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
OperationDataJSON
json
=
AcmsClient
.
getInstance
(
ABVDataCache
.
getInstance
().
getUrlPath
(),
ABVEnvironment
.
getInstance
().
networkAdapter
).
getOpereationData
(
param
);
//プログレスを40%進行させるための計算
in
t
progress
=
0
;
floa
t
progress
=
0
;
if
(
json
.
taskDtoList
.
size
()
!=
0
)
{
progress
=
40
/
json
.
taskDtoList
.
size
();
progress
=
40
f
/
json
.
taskDtoList
.
size
();
}
boolean
isRoutineTask
=
operationDto
.
reportType
==
Constant
.
ReportType
.
RoutineTask
;
List
<
TaskReportDto
>
localTaskReportDtoList
=
null
;
if
(
isRoutineTask
)
{
localTaskReportDtoList
=
mTaskReportDao
.
getTaskReportByOperationId
(
operationId
);
}
float
saveProgress
=
0
;
for
(
TaskDto
serverTaskDto
:
json
.
taskDtoList
)
{
//報告送信後、そのタスクのみ同期する
if
(
taskKey
!=
null
&&
!
serverTaskDto
.
taskKey
.
equals
(
taskKey
))
{
continue
;
}
List
<
TaskReportDto
>
localTaskReportList
=
mTaskReportDao
.
getTaskReportListByTaskKey
(
serverTaskDto
.
taskKey
);
//報告削除
for
(
TaskReportDto
localTaskReportDto
:
localTaskReportList
)
{
if
(!
isExistsTaskReportInList
(
serverTaskDto
.
taskReportDtoList
,
localTaskReportDto
,
isRoutineTask
))
{
if
(
isRoutineTask
)
{
...
...
@@ -1467,21 +1488,34 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
}
}
if
(
isExistsTaskInList
(
localTaskList
,
serverTaskDto
))
{
// 作業の報告更新
mTaskDao
.
update
(
serverTaskDto
);
localTaskList
.
remove
(
serverTaskDto
);
}
else
{
//タスク更新・追加
TaskDto
localTaskDto
=
mOperationLogic
.
getLocalTaskInList
(
localTaskList
,
serverTaskDto
.
taskKey
);
if
(
localTaskDto
==
null
)
{
// 作業の報告登録
mTaskDao
.
insert
(
serverTaskDto
);
}
else
{
// 作業の報告更新
if
(
mOperationLogic
.
taskDataSameCheck
(
localTaskDto
,
serverTaskDto
))
{
mTaskDao
.
update
(
serverTaskDto
);
}
localTaskList
.
remove
(
localTaskDto
);
}
// サーバーからの情報で更新
//報告更新・追加
for
(
TaskReportDto
serverTaskReportDto
:
serverTaskDto
.
taskReportDtoList
)
{
String
attachedFileName
=
serverTaskReportDto
.
attachedFileName
;
TaskReportDto
localTaskReportDto
;
TaskReportDto
localTaskReportDto
=
null
;
if
(
operationDto
.
reportType
==
Constant
.
ReportType
.
RoutineTask
)
{
localTaskReportDto
=
mTaskReportDao
.
getRoutineTaskReportUtc
(
serverTaskReportDto
.
taskKey
,
serverTaskReportDto
.
taskReportId
,
DateTimeUtil
.
toString
(
serverTaskReportDto
.
reportStartDate
,
DateTimeFormat
.
yyyyMMddHHmmss_hyphen
));
if
(
localTaskReportDtoList
!=
null
)
{
localTaskReportDto
=
mOperationLogic
.
getLocalRoutineTaskReportDtoInList
(
localTaskReportDtoList
,
serverTaskReportDto
.
taskKey
,
serverTaskReportDto
.
taskReportId
,
serverTaskReportDto
.
reportStartDate
);
if
(
localTaskReportDto
!=
null
)
{
//サーバ側からのデータが変更されているか確認
if
(
mOperationLogic
.
taskReportDataSameCheck
(
localTaskReportDto
,
serverTaskReportDto
))
{
continue
;
}
}
}
}
else
{
localTaskReportDto
=
mTaskReportDao
.
selectByTaskKey
(
serverTaskReportDto
.
taskKey
,
serverTaskReportDto
.
taskReportLevel
);
}
...
...
@@ -1513,6 +1547,9 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
if
(
localTaskReportDto
!=
null
)
{
// 報告データが存在すると作業報告を更新する
mOperationLogic
.
updateRoutineTaskReport
(
serverTaskDto
.
operationId
,
operationContentDto
.
contentId
,
serverTaskReportDto
,
false
,
false
,
localTaskReportDto
.
localSavedFlg
);
if
(
localTaskReportDtoList
!=
null
)
{
localTaskReportDtoList
.
remove
(
localTaskReportDto
);
}
}
else
{
mOperationLogic
.
insertRoutineTaskReport
(
serverTaskDto
.
operationId
,
operationContentDto
.
contentId
,
serverTaskReportDto
,
false
,
false
);
}
...
...
@@ -1548,19 +1585,28 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
}
}
if
(
progressCallback
!=
null
)
{
progressCallback
.
callback
(
new
Integer
(
progress
));
if
(
progress
>=
1
)
{
progressCallback
.
callback
(
new
Integer
((
int
)
progress
));
}
else
{
saveProgress
+=
progress
;
if
(
saveProgress
>
1
)
{
progressCallback
.
callback
(
new
Integer
((
int
)
saveProgress
));
saveProgress
=
0
f
;
}
}
}
}
// サーバーから取得した作業情報がローカルに存在しないので削除する
for
(
TaskDto
taskDto
:
localTaskList
)
{
mOperationLogic
.
deleteTaskFileData
(
operationId
,
operationContentDto
.
contentId
,
taskDto
.
taskKey
,
Constant
.
TaskReportLevel
.
ReportType
);
mTaskDao
.
delete
(
taskDto
);
if
(
taskKey
==
null
)
{
for
(
TaskDto
taskDto
:
localTaskList
)
{
mOperationLogic
.
deleteTaskFileData
(
operationId
,
operationContentDto
.
contentId
,
taskDto
.
taskKey
,
Constant
.
TaskReportLevel
.
ReportType
);
mTaskDao
.
delete
(
taskDto
);
}
}
lastEditDate
=
json
.
lastEditDate
;
if
(
progressCallback
!=
null
)
{
progressCallback
.
callback
(
new
Integer
(
40
));
}
return
lastEditDate
;
}
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVContentViewActivity.java
View file @
4eb068c6
...
...
@@ -85,6 +85,8 @@ 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
.
common
.
Constant
.
ReportType
.
RoutineTask
;
public
abstract
class
ABVContentViewActivity
extends
ABVAuthenticatedActivity
{
protected
static
GroupLogic
groupLogic
=
AbstractLogic
.
getLogic
(
GroupLogic
.
class
);
...
...
@@ -941,7 +943,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
int
taskReportId
=
0
;
String
reportStartDate
=
""
;
if
(
operationDto
.
reportType
==
Constant
.
ReportType
.
RoutineTask
&&
abookCheckParam
.
get
(
ABookKeys
.
TASK_REPORT_ID
)
!=
null
&&
abookCheckParam
.
get
(
ABookKeys
.
REPORT_START_DATE
)
!=
null
)
{
if
(
operationDto
.
reportType
==
RoutineTask
&&
abookCheckParam
.
get
(
ABookKeys
.
TASK_REPORT_ID
)
!=
null
&&
abookCheckParam
.
get
(
ABookKeys
.
REPORT_START_DATE
)
!=
null
)
{
taskReportId
=
Integer
.
parseInt
(
abookCheckParam
.
get
(
ABookKeys
.
TASK_REPORT_ID
));
reportStartDate
=
abookCheckParam
.
get
(
ABookKeys
.
REPORT_START_DATE
);
}
...
...
@@ -963,9 +965,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
try
{
if
(
StringUtil
.
equalsAny
(
mCmd
,
ABookKeys
.
CMD_INSERT_TASK_REPORT
,
ABookKeys
.
CMD_UPDATE_TASK_REPORT
))
{
// リソースパターンの適用
showProgressPopup
(
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
R
.
string
.
file_initialization
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)));
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
showProgressPopup
(
PatternStringUtil
.
patternToString
(
getApplicationContext
(),
R
.
string
.
file_initialization
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)));
}
});
}
//連続作業の全削除ボタンタップ時のインジケーター表示
if
(
StringUtil
.
equalsAny
(
mCmd
,
ABookKeys
.
CMD_DELETE_PROCESS
))
{
...
...
@@ -1012,13 +1019,21 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
@Override
public
Object
callback
(
Object
ret
)
{
final
boolean
isError
=
(
boolean
)
ret
;
closeProgressPopup
();
syncOperation
(
mOperationId
,
mReportType
,
false
);
try
{
mOperationLogic
.
createJsonForOperationContent
(
mOperationId
,
mContentPath
,
false
);
}
catch
(
IOException
e
)
{
closeProgressPopup
();
//キー項目あり設定時、送信後、同期処理
if
(
mOperationType
==
OperationType
.
LIST
)
{
//リスト作業のみ実行
if
(
mReportType
!=
RoutineTask
)
{
//定期点検以外
if
(
mCmd
.
equals
(
ABookKeys
.
CMD_INSERT_TASK_REPORT
)
||
mCmd
.
equals
(
ABookKeys
.
CMD_UPDATE_TASK_REPORT
))
{
try
{
receptionTaskData
(
mOperationId
,
null
,
null
,
mTaskKey
);
mOperationLogic
.
createJsonForOperationContent
(
mOperationId
,
mContentPath
,
false
);
}
catch
(
Exception
e
)
{
Logger
.
e
(
TAG
,
"createJsonForOperationContent error. "
+
e
);
}
}
}
}
// 報告・報告(回答)の切り替えボタンタップ、連続作業の全削除ボタンタップ
if
(
mCmd
.
equals
(
ABookKeys
.
CMD_CHANGE_TASK_REPORT
)
||
mCmd
.
equals
(
ABookKeys
.
CMD_DELETE_PROCESS
))
{
afterABookCheckApi
(
mCmd
,
mTaskKey
,
0
,
""
,
null
,
isOperationPdf
());
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationListActivity.java
View file @
4eb068c6
This diff is collapsed.
Click to expand it.
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/ABookCheckWebViewHelper.java
View file @
4eb068c6
...
...
@@ -80,7 +80,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
* @param finishCallback
* @param taskReportLevel
*/
public
void
doABookCheckParam
(
ABVContentViewActivity
context
,
String
cmd
,
String
taskKey
,
int
enableReportHistory
,
Map
<
String
,
String
>
param
,
long
operationId
,
String
contentPath
,
long
contentId
,
int
reportType
,
Callback
finishCallback
,
int
taskReportLevel
)
throws
IOException
{
public
void
doABookCheckParam
(
ABVContentViewActivity
context
,
final
String
cmd
,
final
String
taskKey
,
final
int
enableReportHistory
,
final
Map
<
String
,
String
>
param
,
final
long
operationId
,
final
String
contentPath
,
final
long
contentId
,
final
int
reportType
,
Callback
finishCallback
,
final
int
taskReportLevel
)
throws
IOException
{
int
taskReportSendId
=
0
;
mFinishCallback
=
finishCallback
;
...
...
@@ -106,17 +106,25 @@ public class ABookCheckWebViewHelper extends ABookHelper {
// その時に呼び出し元で表示したダイアログが閉じずに、操作不能となったので、
// mFinishCallBackに、エラーを通知しダイアログを閉じる処理を追加した。
// TODO: 失敗するのであれば、データが壊れているわけなので、壊れたデータを削除する必要があるのでは?
try
{
insertOrUpdateTaskReport
(
taskKey
,
enableReportHistory
,
operationId
,
contentId
,
param
,
contentPath
,
reportType
,
taskReportLevel
,
false
);
}
catch
(
Exception
e
)
{
context
.
showSimpleAlertDialog
(
R
.
string
.
error
,
R
.
string
.
ERROR
);
Logger
.
e
(
TAG
,
e
);
mFinishCallback
.
callback
(
true
);
context
.
closeProgressPopup
();
throw
e
;
}
copyTaskAttachedMovie
(
operationId
,
contentId
,
taskKey
,
taskReportLevel
,
processKey
,
phaseNo
);
sendTaskData
(
context
,
operationId
,
taskKey
,
taskReportLevel
,
reportType
,
contentPath
);
final
ABVContentViewActivity
final_context
=
context
;
final
String
final_processKey
=
processKey
;
final
Integer
final_phaseNo
=
phaseNo
;
CommonExecutor
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
try
{
insertOrUpdateTaskReport
(
taskKey
,
enableReportHistory
,
operationId
,
contentId
,
param
,
contentPath
,
reportType
,
taskReportLevel
,
false
);
copyTaskAttachedMovie
(
operationId
,
contentId
,
taskKey
,
taskReportLevel
,
final_processKey
,
final_phaseNo
);
sendTaskData
(
final_context
,
operationId
,
taskKey
,
taskReportLevel
,
reportType
,
contentPath
);
}
catch
(
Exception
e
)
{
final_context
.
showSimpleAlertDialog
(
R
.
string
.
error
,
R
.
string
.
ERROR
);
Logger
.
e
(
TAG
,
e
);
mFinishCallback
.
callback
(
true
);
final_context
.
closeProgressPopup
();
Logger
.
e
(
TAG
,
"doABookCheckParam error"
,
e
);
}
}
});
break
;
case
ABookKeys
.
CMD_LOCAL_SAVE_TASK_REPORT
:
// 一時保存
insertOrUpdateTaskReport
(
taskKey
,
enableReportHistory
,
operationId
,
contentId
,
param
,
contentPath
,
reportType
,
taskReportLevel
,
true
);
...
...
@@ -236,9 +244,14 @@ public class ABookCheckWebViewHelper extends ABookHelper {
};
// リソースパターンの適用
context
.
showProgressView
(
PatternStringUtil
.
patternToString
(
context
,
R
.
string
.
synchronizing
,
getUserPref
(
context
,
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)));
context
.
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
context
.
showProgressView
(
PatternStringUtil
.
patternToString
(
context
,
R
.
string
.
synchronizing
,
getUserPref
(
context
,
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
0
)));
}
});
CommonExecutor
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/OzdFileHelper.java
View file @
4eb068c6
...
...
@@ -162,8 +162,6 @@ public class OzdFileHelper {
public
static
final
boolean
moveTempOzdFileToOzdFile
(
long
contentId
,
String
taskKey
,
String
tempOzFileName
,
String
ozFileName
)
{
String
tempOzdFilePath
=
ABVEnvironment
.
getInstance
().
getTempFilePath
(
contentId
,
taskKey
,
tempOzFileName
);
String
ozdFilePath
=
ABVEnvironment
.
getInstance
().
getTempFilePath
(
contentId
,
taskKey
,
ozFileName
);
Logger
.
i
(
"******** tempOzdFilePath = "
+
tempOzdFilePath
);
Logger
.
i
(
"******** ozdFilePath = "
+
ozdFilePath
);
if
(
FileUtil
.
exists
(
ozdFilePath
))
{
FileUtil
.
delete
(
ozdFilePath
);
}
...
...
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