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
f3029c25
Commit
f3029c25
authored
Mar 08, 2022
by
onuma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Jsonの操作にJacksonを使用するテスト
parent
41ef5acf
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
346 additions
and
16 deletions
+346
-16
ABVJE_BL/build.gradle
+6
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/OperationLogic.java
+291
-6
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVAuthenticatedActivity.java
+33
-3
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationListActivity.java
+6
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/ABookCheckWebViewHelper.java
+4
-1
gradle.properties
+6
-6
No files found.
ABVJE_BL/build.gradle
View file @
f3029c25
...
...
@@ -10,6 +10,12 @@ dependencies {
implementation
'commons-codec:commons-codec:1.10'
implementation
'net.lingala.zip4j:zip4j:1.3.2'
implementation
files
(
'libs/java_websocket_0.8.jar'
)
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core
implementation
group:
'com.fasterxml.jackson.core'
,
name:
'jackson-core'
,
version:
'2.9.10'
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind
implementation
group:
'com.fasterxml.jackson.core'
,
name:
'jackson-databind'
,
version:
'2.9.10.8'
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations
implementation
group:
'com.fasterxml.jackson.core'
,
name:
'jackson-annotations'
,
version:
'2.9.10'
}
sourceSets
{
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/OperationLogic.java
View file @
f3029c25
...
...
@@ -34,7 +34,6 @@ import jp.agentec.abook.abv.bl.acms.client.parameters.GetOperationDataParameters
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.common.ABVEnvironment
;
import
jp.agentec.abook.abv.bl.common.CommonExecutor
;
import
jp.agentec.abook.abv.bl.common.Constant
;
import
jp.agentec.abook.abv.bl.common.Callback
;
import
jp.agentec.abook.abv.bl.common.constant.ABookKeys
;
...
...
@@ -62,7 +61,6 @@ import jp.agentec.abook.abv.bl.dto.CategoryContentDto;
import
jp.agentec.abook.abv.bl.dto.ContentDto
;
import
jp.agentec.abook.abv.bl.dto.OperationContentDto
;
import
jp.agentec.abook.abv.bl.dto.OperationDto
;
import
jp.agentec.abook.abv.bl.dto.OperationGroupMasterDto
;
import
jp.agentec.abook.abv.bl.dto.OperationGroupMasterRelationDto
;
import
jp.agentec.abook.abv.bl.dto.PushMessageDto
;
import
jp.agentec.abook.abv.bl.dto.TaskDto
;
...
...
@@ -77,6 +75,16 @@ import jp.agentec.adf.util.DateTimeUtil;
import
jp.agentec.adf.util.FileUtil
;
import
jp.agentec.adf.util.StringUtil
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonTypeInfo
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.DeserializationConfig
;
import
com.fasterxml.jackson.databind.DeserializationFeature
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.SerializationConfig
;
import
com.fasterxml.jackson.databind.SerializationFeature
;
/**
* Created by leej on 2018/08/17.
*/
...
...
@@ -665,6 +673,7 @@ public class OperationLogic extends AbstractLogic {
* @param processKey 工程ID
* @throws IOException
*/
// ここだよ
public
void
deleteProcessAllReport
(
long
operationId
,
long
contentId
,
String
processKey
,
String
contentPath
)
throws
IOException
{
//作業送信フラグ更新
mOperationDao
.
updateNeedSyncFlg
(
operationId
,
true
);
...
...
@@ -702,6 +711,7 @@ public class OperationLogic extends AbstractLogic {
* @throws IOException
*/
public
void
insertRoutineTaskReport
(
long
operationId
,
long
contentId
,
TaskReportDto
taskReportDto
,
boolean
attachedChangeFlag
,
boolean
dataSendFlg
)
throws
IOException
{
long
start
=
System
.
currentTimeMillis
();
taskReportDto
.
attachedFileSendFlg
=
attachedChangeFlag
;
taskReportDto
.
dataSendFlg
=
dataSendFlg
;
mTaskReportDao
.
insert
(
taskReportDto
);
...
...
@@ -743,6 +753,8 @@ public class OperationLogic extends AbstractLogic {
if
(
result
)
{
FileUtil
.
delete
(
tempDirPath
);
}
long
end
=
System
.
currentTimeMillis
();
Logger
.
i
(
TAG
,
"insertRoutineTaskReport end = %s"
,
(
end
-
start
));
}
/**
...
...
@@ -756,6 +768,7 @@ public class OperationLogic extends AbstractLogic {
* @throws IOException
*/
public
void
updateRoutineTaskReport
(
long
operationId
,
long
contentId
,
TaskReportDto
taskReportDto
,
boolean
attachedChangeFlag
,
boolean
dataSendFlg
,
boolean
localSavedFlg
)
throws
IOException
{
//long start = System.currentTimeMillis();
taskReportDto
.
attachedFileSendFlg
=
attachedChangeFlag
;
taskReportDto
.
dataSendFlg
=
dataSendFlg
;
taskReportDto
.
localSavedFlg
=
localSavedFlg
;
...
...
@@ -822,6 +835,8 @@ public class OperationLogic extends AbstractLogic {
FileUtil
.
delete
(
tempDirPath
);
}
}
//long end = System.currentTimeMillis();
//Logger.i(TAG,"updateRoutineTaskReport = %s", (end - start));
}
/**
...
...
@@ -1033,7 +1048,8 @@ public class OperationLogic extends AbstractLogic {
}
else
{
if
(
routineTaskReportFlg
)
{
// 定期点検
createRoutineTaskReportJson
(
operationId
,
contentPath
);
//createRoutineTaskReportJson(operationId, contentPath);
createRoutineTaskReportJsonByJackson
(
operationId
,
contentPath
);
}
else
{
createTaskReportJson
(
operationId
,
contentPath
);
}
...
...
@@ -1042,7 +1058,6 @@ public class OperationLogic extends AbstractLogic {
createHopSpotJson
(
operationId
,
contentPath
);
}
catch
(
IOException
e
)
{
Logger
.
e
(
TAG
,
"createJsonForOperationContent error : "
,
e
);
throw
e
;
...
...
@@ -1340,6 +1355,225 @@ public class OperationLogic extends AbstractLogic {
FileUtil
.
createFile
(
contentPath
+
"/"
+
ABookKeys
.
TASK_REPORT
+
".json"
,
taskReportJson
.
toString
());
}
static
class
Attached
{
public
Attached
(){
}
}
static
class
taskReply
{
private
String
itemId
;
private
String
tableKey
;
private
String
questionId
;
private
String
questionNo
;
private
String
taskItemId
;
private
String
value
;
public
void
setItemId
(
String
itemId
)
{
this
.
itemId
=
itemId
;
}
public
String
getItemId
()
{
return
itemId
;
}
public
void
setTableKey
(
String
tableKey
)
{
this
.
tableKey
=
tableKey
;
}
public
String
getTableKey
()
{
return
tableKey
;
}
public
void
setQuestionId
(
String
questionId
)
{
this
.
questionId
=
questionId
;
}
public
String
getQuestionId
()
{
return
questionId
;
}
public
void
setQuestionNo
(
String
questionNo
)
{
this
.
questionNo
=
questionNo
;
}
public
String
getQuestionNo
()
{
return
questionNo
;
}
public
void
setTaskItemId
(
String
taskItemId
)
{
this
.
taskItemId
=
taskItemId
;
}
public
String
getTaskItemId
()
{
return
taskItemId
;
}
public
void
setValue
(
String
value
)
{
this
.
value
=
value
;
}
public
String
getValue
()
{
return
value
;
}
}
private
class
TaskReport
{
public
int
taskReportInfoId
;
public
boolean
localSaveFlg
;
public
String
reportStartDate
;
public
String
reportEndDate
;
public
List
<
HogeTask
>
taskReportInfo
;
public
void
setTaskReportInfoId
(
int
taskReportInfoId
){
this
.
taskReportInfoId
=
taskReportInfoId
;
}
public
void
setLocalSaveFlg
(
boolean
localSaveFlg
)
{
this
.
localSaveFlg
=
localSaveFlg
;
}
public
void
setReportStartDate
(
String
reportStartDate
)
{
this
.
reportStartDate
=
reportStartDate
;
}
public
void
setReportEndDate
(
String
reportEndDate
)
{
this
.
reportEndDate
=
reportEndDate
;
}
public
void
setTaskReportInfo
(
List
<
HogeTask
>
taskReportInfo
)
{
this
.
taskReportInfo
=
taskReportInfo
;
}
public
int
getTaskReportInfoId
(){
return
this
.
taskReportInfoId
;
}
public
boolean
getLocalSaveFlg
()
{
return
this
.
localSaveFlg
;
}
public
String
getReportStartDate
()
{
return
this
.
reportStartDate
;
}
public
String
getReportEndDate
()
{
return
this
.
reportEndDate
;
}
public
List
<
HogeTask
>
getTaskReportInfo
()
{
return
this
.
taskReportInfo
;
}
}
private
static
class
HogeTask
{
public
HogeTask
(){
}
private
String
taskKey
;
private
HashMap
<
String
,
String
>
task
;
private
Attached
attached
;
private
List
<
taskReply
>
taskReply
;
private
HashMap
<
String
,
String
>
suggest
;
public
void
setTask
(
HashMap
<
String
,
String
>
task
)
{
this
.
task
=
task
;
}
public
HashMap
<
String
,
String
>
getTask
()
{
return
this
.
task
;
}
public
void
setTaskKey
(
String
taskKey
)
{
this
.
taskKey
=
taskKey
;
}
public
String
getTaskKey
()
{
return
taskKey
;
}
public
void
setAttached
(
Attached
attached
)
{
this
.
attached
=
attached
;
}
public
Attached
getAttached
()
{
return
attached
;
}
public
List
<
taskReply
>
getTaskReply
()
{
return
taskReply
;
}
public
void
setTaskReply
(
List
<
taskReply
>
taskReply
)
{
this
.
taskReply
=
taskReply
;
}
public
HashMap
<
String
,
String
>
getSuggest
()
{
return
suggest
;
}
public
void
setSuggest
(
HashMap
<
String
,
String
>
suggest
)
{
this
.
suggest
=
suggest
;
}
}
private
class
RootSan
{
public
int
enableReportUpdate
;
public
int
taskReportId
;
public
List
<
TaskReport
>
taskReport_0
;
public
int
getEnableReportUpdate
()
{
return
enableReportUpdate
;
}
public
int
getTaskReportId
(){
return
taskReportId
;
}
public
List
<
TaskReport
>
getTaskReport_0
()
{
return
taskReport_0
;
}
public
void
setEnableReportUpdate
(
int
enableReportUpdate
)
{
this
.
enableReportUpdate
=
enableReportUpdate
;
}
public
void
setTaskReportId
(
int
taskReportId
){
this
.
taskReportId
=
taskReportId
;
}
public
void
setTaskReport_0
(
List
<
TaskReport
>
taskReport_0
)
{
this
.
taskReport_0
=
taskReport_0
;
}
}
public
void
createRoutineTaskReportJsonByJackson
(
Long
operationId
,
String
contentPath
)
throws
IOException
{
List
<
TaskReport
>
taskReportList
=
new
ArrayList
<
TaskReport
>();
List
<
TaskReportDto
>
routineTaskReportDtoList
=
mTaskReportDao
.
getTaskReportByOperationId
(
operationId
);
// 現在の作業タイプは定期点検の場合
for
(
TaskReportDto
dto
:
routineTaskReportDtoList
)
{
ObjectMapper
mapper
=
new
ObjectMapper
();
mapper
.
setSerializationInclusion
(
JsonInclude
.
Include
.
NON_NULL
);
// null を無視
mapper
.
disable
(
SerializationFeature
.
FAIL_ON_EMPTY_BEANS
);
// 空を許可。例) "task": {}
mapper
.
configure
(
DeserializationFeature
.
FAIL_ON_UNKNOWN_PROPERTIES
,
false
);
// 定義していないプロパティも出力
TaskReport
taskReport
=
new
TaskReport
();
taskReport
.
taskReportInfoId
=
dto
.
taskReportInfoId
;
taskReport
.
localSaveFlg
=
dto
.
localSavedFlg
;
taskReport
.
reportStartDate
=
DateTimeUtil
.
toStringInTimeZone
(
dto
.
reportStartDate
,
DateTimeFormat
.
yyyyMMddHHmmss_hyphen
,
DateTimeUtil
.
getLocalTimeZone
());
taskReport
.
reportEndDate
=
DateTimeUtil
.
toStringInTimeZone
(
dto
.
reportEndDate
,
DateTimeFormat
.
yyyyMMddHHmmss_hyphen
,
DateTimeUtil
.
getLocalTimeZone
());
if
(!
StringUtil
.
isNullOrEmpty
(
dto
.
jsonData
))
{
ObjectMapper
hogetaskMapper
=
new
ObjectMapper
();
hogetaskMapper
.
setSerializationInclusion
(
JsonInclude
.
Include
.
NON_NULL
);
// null を無視
hogetaskMapper
.
disable
(
SerializationFeature
.
FAIL_ON_EMPTY_BEANS
);
// 空を許可。例) "task": {}
hogetaskMapper
.
configure
(
DeserializationFeature
.
FAIL_ON_UNKNOWN_PROPERTIES
,
false
);
// 定義していないプロパティも出力
HogeTask
hogeTask1
=
hogetaskMapper
.
readValue
(
dto
.
jsonData
,
HogeTask
.
class
);
//Logger.i(TAG,"originJson = %s", dto.jsonData);
//String jjson = hogetaskMapper.writeValueAsString(hogeTask1);
//Logger.i(TAG,"jjson = %s", jjson);
List
<
HogeTask
>
ooo
=
new
ArrayList
<
HogeTask
>();
ooo
.
add
(
hogeTask1
);
taskReport
.
taskReportInfo
=
ooo
;
//String infoJson = mapper.writeValueAsString(taskReport);
//Logger.i(TAG,"infoJson = %s", infoJson);
}
taskReportList
.
add
(
taskReport
);
}
// 最後のtaskReportId
TaskReportDto
lastRoutineTaskReportDto
=
mTaskReportDao
.
getLastRoutineTaskReportData
(
operationId
);
RootSan
root
=
new
RootSan
();
root
.
enableReportUpdate
=
mOperationDao
.
getOperation
(
operationId
).
enableReportUpdate
;
root
.
taskReportId
=
lastRoutineTaskReportDto
.
taskReportId
;
root
.
taskReport_0
=
taskReportList
;
ObjectMapper
lastMapper
=
new
ObjectMapper
();
lastMapper
.
setSerializationInclusion
(
JsonInclude
.
Include
.
NON_NULL
);
// null を無視
lastMapper
.
disable
(
SerializationFeature
.
FAIL_ON_EMPTY_BEANS
);
// 空を許可。例) "task": {}
lastMapper
.
configure
(
DeserializationFeature
.
FAIL_ON_UNKNOWN_PROPERTIES
,
false
);
// 定義していないプロパティも出力
//long start = System.currentTimeMillis();
lastMapper
.
writeValue
(
new
File
(
contentPath
+
"/"
+
ABookKeys
.
TASK_REPORT
+
".json"
),
root
);
//long end = System.currentTimeMillis();
//Logger.i(TAG,"Jackson file write time. %s" , (end-start));
}
/**
* 定期点検用のJSON作成
* @param operationId
...
...
@@ -1350,8 +1584,14 @@ public class OperationLogic extends AbstractLogic {
List
<
JSONObject
>
taskReportJsonList
=
new
ArrayList
<
JSONObject
>();
JSONObject
taskReportJsonRoot
=
new
JSONObject
();
JSONObject
taskReportJsonRow
;
//ObjectMapper taskReportJsonRootMap = new ObjectMapper();
//ObjectMapper taskReportListMap = new ObjectMapper();
//List<Hoge> hogelist = new ArrayList<Hoge>();
List
<
TaskReportDto
>
routineTaskReportDtoList
=
mTaskReportDao
.
getTaskReportByOperationId
(
operationId
);
// 現在の作業タイプは定期点検の場合
//int i= 0;
for
(
TaskReportDto
dto
:
routineTaskReportDtoList
)
{
taskReportJsonRow
=
new
JSONObject
();
taskReportJsonRow
.
put
(
ABookKeys
.
TASK_REPORT_INFO_ID
,
dto
.
taskReportInfoId
);
...
...
@@ -1365,15 +1605,60 @@ public class OperationLogic extends AbstractLogic {
}
taskReportJsonRow
.
put
(
ABookKeys
.
TASK_REPORT_INFO
,
taskReportInfoList
);
taskReportJsonList
.
add
(
taskReportJsonRow
);
//Logger.i(TAG,"" + taskReportJsonRoot.toString());
/*
ObjectMapper mapper = new ObjectMapper();
mapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
Hoge hoge = new Hoge();
hoge.taskReportInfoId = dto.taskReportInfoId;
hoge.localSaveFlg = dto.localSavedFlg;
hoge.reportStartDate = DateTimeUtil.toStringInTimeZone(dto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen, DateTimeUtil.getLocalTimeZone());
hoge.reportEndDate = DateTimeUtil.toStringInTimeZone(dto.reportEndDate, DateTimeFormat.yyyyMMddHHmmss_hyphen, DateTimeUtil.getLocalTimeZone());
//hoge.jsonData = dto.jsonData;
ObjectMapper mapper2 = new ObjectMapper();
mapper2.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
if (!StringUtil.isNullOrEmpty(dto.jsonData)) {
Fuga fuga = mapper2.readValue(dto.jsonData, Fuga.class);
//fuga.attached = null;
//fuga.task = null;
List<Fuga> ooo = new ArrayList<Fuga>();
ooo.add(fuga);
//hoge.jsonData = fuga.toString();
hoge.taskReportInfo = ooo;
}
//String json = mapper.writeValueAsString(hoge);
//Logger.i(TAG,"" + json);
hogelist.add(hoge);
*/
}
taskReportJsonRoot
.
put
(
ABookKeys
.
ENABLE_REPORT_UPDATE
,
mOperationDao
.
getOperation
(
operationId
).
enableReportUpdate
);
// 最後のtaskReportId
TaskReportDto
lastRoutineTaskReportDto
=
mTaskReportDao
.
getLastRoutineTaskReportData
(
operationId
);
taskReportJsonRoot
.
put
(
ABookKeys
.
TASK_REPORT_ID
,
lastRoutineTaskReportDto
.
taskReportId
);
taskReportJsonRoot
.
put
(
"taskReport_0"
,
taskReportJsonList
);
Logger
.
d
(
TAG
,
"createRoutineTaskReportJson : "
+
taskReportJsonRoot
.
toString
());
Logger
.
d
(
TAG
,
contentPath
+
"/"
+
ABookKeys
.
TASK_REPORT
+
".json"
);
//Logger.d(TAG, "createRoutineTaskReportJson : " + taskReportJsonRoot.toString());
//Logger.d(TAG,contentPath + "/" + ABookKeys.TASK_REPORT + ".json");
//long start = System.currentTimeMillis();
FileUtil
.
createFile
(
contentPath
+
"/"
+
ABookKeys
.
TASK_REPORT
+
".json"
,
taskReportJsonRoot
.
toString
());
//long end = System.currentTimeMillis();
//Logger.i(TAG," JSONObject file write time. %s" , (end-start));
/*
RootSan root = new RootSan();
root.enableReportUpdate = mOperationDao.getOperation(operationId).enableReportUpdate;
root.taskReportId = lastRoutineTaskReportDto.taskReportId;
root.taskReport_0 = hogelist;
ObjectMapper lastMapper = new ObjectMapper();
lastMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
start = System.currentTimeMillis();
lastMapper.writeValue(new File(contentPath + "/" + ABookKeys.TASK_REPORT + "2.json"),root);
end = System.currentTimeMillis();
Logger.i(TAG,"Jackson file write time. %s" , (end-start));
*/
}
/**
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVAuthenticatedActivity.java
View file @
f3029c25
...
...
@@ -1431,6 +1431,8 @@ 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
{
Logger
.
i
(
TAG
,
"**************************************************ABVAuthenticateActivity receptionTaskData start"
);
long
start
=
System
.
currentTimeMillis
();
GetOperationDataParameters
param
=
new
GetOperationDataParameters
(
ABVDataCache
.
getInstance
().
getMemberInfo
().
sid
,
operationId
);
OperationDto
operationDto
=
mOperationLogic
.
getOperation
(
operationId
);
OperationContentDto
operationContentDto
=
mOperationContentDao
.
getOperationMainContent
(
operationId
);
...
...
@@ -1438,7 +1440,10 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
Date
lastEditDate
;
long
lstart
=
System
.
currentTimeMillis
();
OperationDataJSON
json
=
AcmsClient
.
getInstance
(
ABVDataCache
.
getInstance
().
getUrlPath
(),
ABVEnvironment
.
getInstance
().
networkAdapter
).
getOpereationData
(
param
);
long
lend
=
System
.
currentTimeMillis
();
Logger
.
i
(
TAG
,
"**************************************************ABVAuthenticateActivity receptionTaskData getOperationData Time = %s"
,
(
lend
-
start
));
//プログレスを40%進行させるための計算
int
progress
=
0
;
...
...
@@ -1448,9 +1453,10 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
boolean
isRoutineTask
=
operationDto
.
reportType
==
Constant
.
ReportType
.
RoutineTask
;
//start = System.currentTimeMillis();
int
ii
=
0
;
for
(
TaskDto
serverTaskDto
:
json
.
taskDtoList
)
{
lstart
=
System
.
currentTimeMillis
();
List
<
TaskReportDto
>
localTaskReportList
=
mTaskReportDao
.
getTaskReportListByTaskKey
(
serverTaskDto
.
taskKey
);
for
(
TaskReportDto
localTaskReportDto
:
localTaskReportList
)
{
if
(!
isExistsTaskReportInList
(
serverTaskDto
.
taskReportDtoList
,
localTaskReportDto
,
isRoutineTask
))
{
...
...
@@ -1466,7 +1472,10 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
}
}
}
lend
=
System
.
currentTimeMillis
();
Logger
.
i
(
TAG
,
"localTaskReportList loop 速度 = %s"
,
(
lend
-
lstart
));
lstart
=
System
.
currentTimeMillis
();
if
(
isExistsTaskInList
(
localTaskList
,
serverTaskDto
))
{
// 作業の報告更新
mTaskDao
.
update
(
serverTaskDto
);
...
...
@@ -1475,9 +1484,14 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// 作業の報告登録
mTaskDao
.
insert
(
serverTaskDto
);
}
lend
=
System
.
currentTimeMillis
();
Logger
.
i
(
TAG
,
"insert or update time = %s"
,
(
lend
-
lstart
));
lstart
=
System
.
currentTimeMillis
();
// サーバーからの情報で更新
for
(
TaskReportDto
serverTaskReportDto
:
serverTaskDto
.
taskReportDtoList
)
{
long
tStart
=
System
.
currentTimeMillis
();
long
mStart
=
System
.
currentTimeMillis
();
String
attachedFileName
=
serverTaskReportDto
.
attachedFileName
;
TaskReportDto
localTaskReportDto
;
if
(
operationDto
.
reportType
==
Constant
.
ReportType
.
RoutineTask
)
{
...
...
@@ -1497,7 +1511,10 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
continue
;
}
}
long
mEnd
=
System
.
currentTimeMillis
();
//Logger.i(TAG,"サーバーからの情報で更新 1 = %s", (mEnd - mStart));
mStart
=
System
.
currentTimeMillis
();
if
(
operationDto
.
reportType
==
Constant
.
ReportType
.
RoutineTask
)
{
serverTaskReportDto
.
taskKey
=
serverTaskDto
.
taskKey
;
...
...
@@ -1507,7 +1524,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
}
catch
(
Exception
e
)
{
Logger
.
e
(
TAG
,
e
);
// リソースパターンの適用
errorMsg
.
append
(
getString
(
PatternStringUtil
.
patternToInt
(
getApplicationContext
(),
R
.
string
.
msg_error_task_report_receiving_failed
,
getUserPref
(
AppDefType
.
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
DEFAULT_VALUE_ZERO
))));
errorMsg
.
append
(
getString
(
PatternStringUtil
.
patternToInt
(
getApplicationContext
(),
R
.
string
.
msg_error_task_report_receiving_failed
,
getUserPref
(
UserPrefKey
.
RESOURCE_PATTERN_TYPE
,
DEFAULT_VALUE_ZERO
))));
return
null
;
}
if
(
localTaskReportDto
!=
null
)
{
...
...
@@ -1546,7 +1563,15 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
taskReportJson
,
attachedFileName
,
false
,
false
,
localTaskReportDto
.
localSavedFlg
,
serverTaskDto
.
processKey
,
serverTaskDto
.
phaseNo
);
}
}
mEnd
=
System
.
currentTimeMillis
();
//Logger.i(TAG,"サーバーからの情報で更新 2 = %s", (mEnd - mStart));
long
tEnd
=
System
.
currentTimeMillis
();
//Logger.i(TAG,"サーバーからの情報で更新 1回のループ = %s", (tEnd - tStart));
}
lend
=
System
.
currentTimeMillis
();
Logger
.
i
(
TAG
,
"サーバーからの情報で更新全体 time = %s"
,
(
lend
-
lstart
));
Logger
.
i
(
TAG
,
""
);
if
(
progressCallback
!=
null
)
{
progressCallback
.
callback
(
new
Integer
(
progress
));
}
...
...
@@ -1560,6 +1585,8 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
if
(
progressCallback
!=
null
)
{
progressCallback
.
callback
(
new
Integer
(
40
));
}
long
end
=
System
.
currentTimeMillis
();
Logger
.
i
(
TAG
,
"**************************************************ABVAuthenticateActivity receptionTaskData getOperationData Time = %s"
,
(
end
-
start
));
return
lastEditDate
;
}
...
...
@@ -1654,6 +1681,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
* @throws IOException
*/
public
void
refreshRoutineTaskFile
(
final
long
operationId
,
final
long
contentId
,
final
long
taskId
,
final
String
taskKey
,
final
int
taskReportId
,
final
int
taskReportInfoId
,
final
Date
reportStartDate
,
final
String
reportAttachedFileName
)
throws
Exception
{
//long start = System.currentTimeMillis();
String
reportStartDateHypn
=
DateTimeUtil
.
toString
(
reportStartDate
,
DateTimeFormat
.
yyyyMMddHHmmss_hyphen
);
final
String
reportStartDateNone
=
DateTimeUtil
.
toString_yyyyMMddHHmmss_none
(
reportStartDate
);
// 既存の添付ディレクトリ削除
...
...
@@ -1674,6 +1702,8 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
ABVEnvironment
.
getInstance
().
getRoutineTaskReportDirFilePath
(
operationId
,
taskKey
,
taskReportId
,
reportStartDateNone
),
null
,
true
);
// #32926 end
}
//long end = System.currentTimeMillis();
//Logger.i(TAG,"refreshRoutineTaskFile = %s", (end - start));
}
/**
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationListActivity.java
View file @
f3029c25
...
...
@@ -794,7 +794,10 @@ public class OperationListActivity extends ABVUIActivity {
// 作業の報告画面を表示時、必要なJSONファイル作成
mOperationLogic
.
createJsonForOpenABookCheckPano
(
operationDto
.
operationId
,
operationDto
.
contentId
,
contentPath
);
long
start
=
System
.
currentTimeMillis
();
mOperationLogic
.
createJsonForOperationContent
(
operationDto
.
operationId
,
contentPath
,
operationDto
.
reportType
==
ReportType
.
RoutineTask
);
long
end
=
System
.
currentTimeMillis
();
Logger
.
i
(
TAG
,
"----------------------------------------------作業の報告画面を表示時、必要なJSONファイル作成 time = %s"
,
(
end
-
start
));
// 作業閲覧日付の更新
mOperationDao
.
updateReadingDate
(
operationDto
.
operationId
);
...
...
@@ -1079,7 +1082,10 @@ public class OperationListActivity extends ABVUIActivity {
Date
lastEditDate
;
long
start
=
System
.
currentTimeMillis
();
OperationDataJSON
json
=
AcmsClient
.
getInstance
(
ABVDataCache
.
getInstance
().
getUrlPath
(),
ABVEnvironment
.
getInstance
().
networkAdapter
).
getOpereationData
(
param
);
long
end
=
System
.
currentTimeMillis
();
Logger
.
i
(
TAG
,
"*****************************************************OperationListActivity receptionTaskData getOperationData Time = %s"
,
(
end
-
start
));
//プログレスを40%進行させるための計算
int
progress
=
0
;
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/helper/ABookCheckWebViewHelper.java
View file @
f3029c25
...
...
@@ -133,10 +133,12 @@ public class ABookCheckWebViewHelper extends ABookHelper {
taskReportId
=
Integer
.
valueOf
(
param
.
get
(
ABookKeys
.
TASK_REPORT_ID
));
reportStartDate
=
param
.
get
(
ABookKeys
.
REPORT_START_DATE
).
replace
(
"T"
,
" "
);
mOperationLogic
.
deleteRoutineTaskReport
(
operationId
,
contentId
,
taskKey
,
taskReportId
,
reportStartDate
);
Logger
.
i
(
TAG
,
"CMD_DELETE_TASK_REPORT1"
);
mOperationLogic
.
createJsonForOperationContent
(
operationId
,
contentPath
,
true
);
copyRoutineTaskReportAttachedMovie
(
operationId
,
contentId
,
taskKey
,
taskReportId
,
reportStartDate
);
}
else
{
mOperationLogic
.
deleteTaskReport
(
operationId
,
contentId
,
taskKey
,
taskReportLevel
);
Logger
.
i
(
TAG
,
"CMD_DELETE_TASK_REPORT2"
);
mOperationLogic
.
createJsonForOperationContent
(
operationId
,
contentPath
,
false
);
copyTaskAttachedMovie
(
operationId
,
contentId
,
taskKey
,
taskReportLevel
,
processKey
,
phaseNo
);
}
...
...
@@ -398,7 +400,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
TaskReportDto
taskReportDto
=
mOperationLogic
.
getRoutineTaskReportUtc
(
taskKey
,
taskReportId
,
reportStartDate
);
taskReportDto
.
jsonData
=
taskReport
;
mOperationLogic
.
updateRoutineTaskReport
(
operationId
,
contentId
,
taskReportDto
,
attachedChangeFlag
,
localSavedFlg
?
false
:
true
,
localSavedFlg
);
Logger
.
i
(
TAG
,
"insertOrUpdateTaskReport1"
);
mOperationLogic
.
createJsonForOperationContent
(
operationId
,
contentPath
,
true
);
copyRoutineTaskReportAttachedMovie
(
operationId
,
contentId
,
taskKey
,
taskReportId
,
reportStartDate
);
}
else
{
...
...
@@ -419,6 +421,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
// 登録
mOperationLogic
.
insertTaskReport
(
taskKey
,
operationId
,
contentId
,
taskReportLevel
,
Constant
.
EnableEditReport
.
YES
,
taskReportJson
,
null
,
attachedChangeFlag
,
localSavedFlg
?
false
:
true
,
localSavedFlg
,
processKey
,
phaseNo
);
}
Logger
.
i
(
TAG
,
"insertOrUpdateTaskReport2"
);
mOperationLogic
.
createJsonForOperationContent
(
operationId
,
contentPath
,
false
);
copyTaskAttachedMovie
(
operationId
,
contentId
,
taskKey
,
taskReportLevel
,
processKey
,
phaseNo
);
}
...
...
gradle.properties
View file @
f3029c25
...
...
@@ -17,7 +17,7 @@ org.gradle.jvmargs=-Xmx2560M -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryErro
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
org.gradle.parallel
=
true
org.gradle.daemon
=
true
org.gradle.configureondemand
=
tru
e
org.gradle.configureondemand
=
fals
e
#ABook:ABook4AndroidReleaseKey
#SmartCatalog:SmartCatalogReleaseKey
...
...
@@ -38,8 +38,8 @@ app_versioncode=1
# abvEnvironments.xml
#cms server
acms_address
=
https://ch
eck130
.agentec.jp/acms
download_server_address
=
https://ch
eck130
.agentec.jp/acms
acms_address
=
https://ch
atdev2
.agentec.jp/acms
download_server_address
=
https://ch
atdev2
.agentec.jp/acms
#syncview server
websocket_server_http_url
=
https://check130.agentec.jp/v1
...
...
@@ -93,7 +93,7 @@ hope_page=http://www.agentec.jp
contact_email
=
abook-appsupport@agentec.jp
#Log Settings
log_level
=
2
log_level
=
1
default_log_name
=
abvje
#エラーレポート/Exportログ送信方法 1:acms 2:平文メール(開発・テスト時のみ) 3:暗号化添付メール
error_report_flg
=
1
...
...
@@ -108,9 +108,9 @@ repository_fqdn=s.abook.bz
#Login
#0:認証なし, 1:ログインID、パスワード, 2:アカウント文字列、ログインID、パスワード, 3:サイトID、アカウント文字列、ログインID、パスワード4:サイトID、アカウント文字列
login_mode
=
2
login_mode
=
1
#login_modeが0、1の場合のアカウントパス
account_path
=
agtcatalog
account_path
=
testabe1
#GCM
push_message
=
1
...
...
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