Commit f3029c25 by onuma

Jsonの操作にJacksonを使用するテスト

parent 41ef5acf
......@@ -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 {
......
......@@ -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));
}
/**
......
......@@ -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;
......
......@@ -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);
}
......
......@@ -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=true
org.gradle.configureondemand=false
#ABook:ABook4AndroidReleaseKey
#SmartCatalog:SmartCatalogReleaseKey
......@@ -38,8 +38,8 @@ app_versioncode=1
# abvEnvironments.xml
#cms server
acms_address=https://check130.agentec.jp/acms
download_server_address=https://check130.agentec.jp/acms
acms_address=https://chatdev2.agentec.jp/acms
download_server_address=https://chatdev2.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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment