Commit e5faafe3 by onuma

Merge branch 'develop'

# Conflicts:
#	gradle.properties
parents b24499e2 9ce58792
...@@ -9,6 +9,7 @@ import java.util.ArrayList; ...@@ -9,6 +9,7 @@ import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Observer; import java.util.Observer;
import jp.agentec.abook.abv.bl.acms.client.json.AcmsBooleanResultJSON; import jp.agentec.abook.abv.bl.acms.client.json.AcmsBooleanResultJSON;
...@@ -45,6 +46,7 @@ import jp.agentec.abook.abv.bl.acms.client.json.RoomListJSON; ...@@ -45,6 +46,7 @@ import jp.agentec.abook.abv.bl.acms.client.json.RoomListJSON;
import jp.agentec.abook.abv.bl.acms.client.json.SceneEntryJSON; import jp.agentec.abook.abv.bl.acms.client.json.SceneEntryJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ServerTimeZoneJSON; import jp.agentec.abook.abv.bl.acms.client.json.ServerTimeZoneJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ServiceOptionsJSON; import jp.agentec.abook.abv.bl.acms.client.json.ServiceOptionsJSON;
import jp.agentec.abook.abv.bl.acms.client.json.TermsOfUseJson;
import jp.agentec.abook.abv.bl.acms.client.json.UnreadCountJSON; import jp.agentec.abook.abv.bl.acms.client.json.UnreadCountJSON;
import jp.agentec.abook.abv.bl.acms.client.json.UserInviteResultJSON; import jp.agentec.abook.abv.bl.acms.client.json.UserInviteResultJSON;
import jp.agentec.abook.abv.bl.acms.client.json.WorkerGroupJSON; import jp.agentec.abook.abv.bl.acms.client.json.WorkerGroupJSON;
...@@ -1097,6 +1099,19 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -1097,6 +1099,19 @@ public class AcmsClient implements AcmsClientResponseListener {
HttpResponse response = send(AcmsApis.ApiDeleteProcess, params); HttpResponse response = send(AcmsApis.ApiDeleteProcess, params);
validateHttpResponse(response, AcmsApis.ApiGetPushMessages); validateHttpResponse(response, AcmsApis.ApiGetPushMessages);
} }
/**
* 利用規約に同意するかの文言を取得します
* @param url 取得するためのURL
* @return 文言を格納したJSON
*/
public TermsOfUseJson getTermsOfServiceText(String url) throws NetworkDisconnectedException, AcmsException {
String requestUrl = url + "?language=" + Locale.getDefault().getLanguage();
HttpResponse response = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).send(requestUrl, "", null);
return new TermsOfUseJson(response.httpResponseBody);
}
/**********************************************************************************************/ /**********************************************************************************************/
/** 以下、共用メソッド---------------------------------------------------------------------- **/ /** 以下、共用メソッド---------------------------------------------------------------------- **/
/**********************************************************************************************/ /**********************************************************************************************/
......
package jp.agentec.abook.abv.bl.acms.client.json;
import org.json.adf.JSONException;
import org.json.adf.JSONObject;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.exception.JSONValidationException;
/**
* 利用規約に同意するで取得するテキストを格納するJSON
*/
public class TermsOfUseJson extends AcmsCommonJSON {
public String message;
public TermsOfUseJson(String jsonString) throws AcmsException {
super(jsonString);
}
@Override
protected void parse(JSONObject json) throws JSONValidationException, JSONException {
super.parse(json);
message = getString(json, "message", null);
}
}
...@@ -63,6 +63,11 @@ public class ABVEnvironment { ...@@ -63,6 +63,11 @@ public class ABVEnvironment {
public int resourcePatternType; public int resourcePatternType;
public boolean operationGroupMasterClearFlg; public boolean operationGroupMasterClearFlg;
// 利用規約に同意するのテキストがあるURL
public String agreeToTermsOfUseUrl = "";
// プライバシーポリシーURL
public String privacyPolicyUrl;
////////////////////////////// 定数 ////////////////////////////////// ////////////////////////////// 定数 //////////////////////////////////
......
...@@ -3,6 +3,7 @@ package jp.agentec.abook.abv.bl.logic; ...@@ -3,6 +3,7 @@ package jp.agentec.abook.abv.bl.logic;
import java.util.List; import java.util.List;
import jp.agentec.abook.abv.bl.acms.client.AcmsClient; import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
import jp.agentec.abook.abv.bl.acms.client.json.TermsOfUseJson;
import jp.agentec.abook.abv.bl.acms.client.parameters.AcmsParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.AcmsParameters;
import jp.agentec.abook.abv.bl.acms.type.SecurityPolicyType; import jp.agentec.abook.abv.bl.acms.type.SecurityPolicyType;
import jp.agentec.abook.abv.bl.acms.type.ServiceOption.ServiceOptionId; import jp.agentec.abook.abv.bl.acms.type.ServiceOption.ServiceOptionId;
...@@ -354,4 +355,19 @@ public class ContractLogic extends AbstractLogic { ...@@ -354,4 +355,19 @@ public class ContractLogic extends AbstractLogic {
public static boolean getBooleanValue(String value) { public static boolean getBooleanValue(String value) {
return True.equals(value); return True.equals(value);
} }
/**
* 利用規約の詳細文を取得する
* @param url 取得しに行くURL
* @return 取得した文字列(失敗したらnullが返る)
*/
public String getTermsOfServiceText(String url) {
try {
TermsOfUseJson response = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getTermsOfServiceText(url);
return response.message;
} catch (Exception e) {
Logger.e(TAG,"" + e);
}
return null;
}
} }
...@@ -19,6 +19,7 @@ import java.util.HashMap; ...@@ -19,6 +19,7 @@ import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import java.util.UUID; import java.util.UUID;
import jp.agentec.abook.abv.bl.acms.client.AcmsClient; import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
...@@ -102,8 +103,10 @@ public class OperationLogic extends AbstractLogic { ...@@ -102,8 +103,10 @@ public class OperationLogic extends AbstractLogic {
private TaskWorkerGroupDao mTaskWorkerGroupDao = AbstractDao.getDao(TaskWorkerGroupDao.class); private TaskWorkerGroupDao mTaskWorkerGroupDao = AbstractDao.getDao(TaskWorkerGroupDao.class);
private TaskReportApprovalDao mTaskReportApprovalDao = AbstractDao.getDao(TaskReportApprovalDao.class); private TaskReportApprovalDao mTaskReportApprovalDao = AbstractDao.getDao(TaskReportApprovalDao.class);
/** /**
* 作業に関連する情報取得(API通信で取得して、DB保存処理) * 作業に関連する情報取得(API通信で取得して、DB保存処理)
*
* @throws AcmsException * @throws AcmsException
* @throws NetworkDisconnectedException * @throws NetworkDisconnectedException
*/ */
...@@ -216,13 +219,15 @@ public class OperationLogic extends AbstractLogic { ...@@ -216,13 +219,15 @@ public class OperationLogic extends AbstractLogic {
boolean isNotExistContent = false; boolean isNotExistContent = false;
for (OperationContentDto operationContentDto : serverOperationDto.operationContentDtoList) { for (OperationContentDto operationContentDto : serverOperationDto.operationContentDtoList) {
if (operationContentDto.operationContentFlg) { if (operationContentDto.operationContentFlg) {
if(mContentDao.getContent(operationContentDto.contentId) == null) { if (mContentDao.getContent(operationContentDto.contentId) == null) {
isNotExistContent = true; isNotExistContent = true;
} }
} }
} }
// コンテンツテーブルに存在しない場合、プロジェクトを登録しない // コンテンツテーブルに存在しない場合、プロジェクトを登録しない
if (isNotExistContent) { continue; } if (isNotExistContent) {
continue;
}
serverOperationDto.needSyncFlg = true; serverOperationDto.needSyncFlg = true;
serverOperationDto.contentCreatingFlg = false; serverOperationDto.contentCreatingFlg = false;
...@@ -271,7 +276,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -271,7 +276,7 @@ public class OperationLogic extends AbstractLogic {
for (OperationDto deleteOperationDto : deleteListDtoArray) { for (OperationDto deleteOperationDto : deleteListDtoArray) {
List<TaskDto> taskDtoList = mTaskDao.selectAllTaskByOperationId(deleteOperationDto.operationId); List<TaskDto> taskDtoList = mTaskDao.selectAllTaskByOperationId(deleteOperationDto.operationId);
List<Long> contentIds = mOperationContentDao.getContentIds(deleteOperationDto.operationId); List<Long> contentIds = mOperationContentDao.getContentIds(deleteOperationDto.operationId);
for(TaskDto taskDto : taskDtoList) { for (TaskDto taskDto : taskDtoList) {
mTaskDao.delete(taskDto); mTaskDao.delete(taskDto);
} }
mPushMessageDao.delete(deleteOperationDto.operationId); mPushMessageDao.delete(deleteOperationDto.operationId);
...@@ -377,13 +382,15 @@ public class OperationLogic extends AbstractLogic { ...@@ -377,13 +382,15 @@ public class OperationLogic extends AbstractLogic {
boolean isNotExistContent = false; boolean isNotExistContent = false;
for (OperationContentDto operationContentDto : serverOperationDto.operationContentDtoList) { for (OperationContentDto operationContentDto : serverOperationDto.operationContentDtoList) {
if (operationContentDto.operationContentFlg) { if (operationContentDto.operationContentFlg) {
if(mContentDao.getContent(operationContentDto.contentId) == null) { if (mContentDao.getContent(operationContentDto.contentId) == null) {
isNotExistContent = true; isNotExistContent = true;
} }
} }
} }
// コンテンツテーブルに存在しない場合、プロジェクトを登録しない // コンテンツテーブルに存在しない場合、プロジェクトを登録しない
if (isNotExistContent) { continue; } if (isNotExistContent) {
continue;
}
serverOperationDto.needSyncFlg = true; serverOperationDto.needSyncFlg = true;
serverOperationDto.contentCreatingFlg = false; serverOperationDto.contentCreatingFlg = false;
...@@ -432,7 +439,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -432,7 +439,7 @@ public class OperationLogic extends AbstractLogic {
for (OperationDto deleteOperationDto : deleteListDtoArray) { for (OperationDto deleteOperationDto : deleteListDtoArray) {
List<TaskDto> taskDtoList = mTaskDao.selectAllTaskByOperationId(deleteOperationDto.operationId); List<TaskDto> taskDtoList = mTaskDao.selectAllTaskByOperationId(deleteOperationDto.operationId);
List<Long> contentIds = mOperationContentDao.getContentIds(deleteOperationDto.operationId); List<Long> contentIds = mOperationContentDao.getContentIds(deleteOperationDto.operationId);
for(TaskDto taskDto : taskDtoList) { for (TaskDto taskDto : taskDtoList) {
mTaskDao.delete(taskDto); mTaskDao.delete(taskDto);
} }
mPushMessageDao.delete(deleteOperationDto.operationId); mPushMessageDao.delete(deleteOperationDto.operationId);
...@@ -478,6 +485,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -478,6 +485,7 @@ public class OperationLogic extends AbstractLogic {
/** /**
* 報告データ登録 * 報告データ登録
*
* @param taskKey * @param taskKey
* @param operationId * @param operationId
* @param contentId * @param contentId
...@@ -488,8 +496,8 @@ public class OperationLogic extends AbstractLogic { ...@@ -488,8 +496,8 @@ public class OperationLogic extends AbstractLogic {
* @param attachedChangeFlag * @param attachedChangeFlag
* @param dataSendFlg * @param dataSendFlg
* @param localSavedFlg * @param localSavedFlg
* @param processKey 工程キー * @param processKey 工程キー
* @param phaseNo 工程NO * @param phaseNo 工程NO
* @throws IOException * @throws IOException
*/ */
public void insertTaskReport(String taskKey, long operationId, long contentId, public void insertTaskReport(String taskKey, long operationId, long contentId,
...@@ -551,18 +559,19 @@ public class OperationLogic extends AbstractLogic { ...@@ -551,18 +559,19 @@ public class OperationLogic extends AbstractLogic {
/** /**
* 作業報告を更新 * 作業報告を更新
* @param taskKey タスクキー *
* @param operationId 作業ID * @param taskKey タスクキー
* @param contentId コンテンツID * @param operationId 作業ID
* @param taskReportLevel 報告レベル(報告:0, 回答:1) * @param contentId コンテンツID
* @param enableReport 報告可能区分 * @param taskReportLevel 報告レベル(報告:0, 回答:1)
* @param taskReportJson フォームデータ * @param enableReport 報告可能区分
* @param taskReportJson フォームデータ
* @param localAttachedFileName 添付ファイル名 * @param localAttachedFileName 添付ファイル名
* @param attachedChangeFlag 添付ファイル更新フラグ * @param attachedChangeFlag 添付ファイル更新フラグ
* @param dataSendFlg データ送信フラグ * @param dataSendFlg データ送信フラグ
* @param localSavedFlg ローカル保存フラグ * @param localSavedFlg ローカル保存フラグ
* @param processKey 固定キー * @param processKey 固定キー
* @param phaseNo 工程NO * @param phaseNo 工程NO
* @throws IOException * @throws IOException
*/ */
public void updateTaskReport(String taskKey, long operationId, long contentId, int taskReportLevel, public void updateTaskReport(String taskKey, long operationId, long contentId, int taskReportLevel,
...@@ -620,7 +629,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -620,7 +629,7 @@ public class OperationLogic extends AbstractLogic {
// 添付ディレクトリの移動 // 添付ディレクトリの移動
boolean result = FileUtil.copy(tempDirPath, operationDrectionOrReportDirPath, true); boolean result = FileUtil.copy(tempDirPath, operationDrectionOrReportDirPath, true);
if(result) { if (result) {
FileUtil.delete(tempDirPath); FileUtil.delete(tempDirPath);
} }
} }
...@@ -659,10 +668,11 @@ public class OperationLogic extends AbstractLogic { ...@@ -659,10 +668,11 @@ public class OperationLogic extends AbstractLogic {
/** /**
* 「全削除」ボタンで、すべての工程情報を削除する。 * 「全削除」ボタンで、すべての工程情報を削除する。
*
* @param operationId 作業ID * @param operationId 作業ID
* @param contentId コンテンツID * @param contentId コンテンツID
* @param contentPath コンテンツファイルパス * @param contentPath コンテンツファイルパス
* @param processKey 工程ID * @param processKey 工程ID
* @throws IOException * @throws IOException
*/ */
public void deleteProcessAllReport(long operationId, long contentId, String processKey, String contentPath) throws IOException { public void deleteProcessAllReport(long operationId, long contentId, String processKey, String contentPath) throws IOException {
...@@ -695,6 +705,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -695,6 +705,7 @@ public class OperationLogic extends AbstractLogic {
/** /**
* 定期点検データ新規 * 定期点検データ新規
*
* @param operationId * @param operationId
* @param taskReportDto * @param taskReportDto
* @param attachedChangeFlag * @param attachedChangeFlag
...@@ -740,13 +751,14 @@ public class OperationLogic extends AbstractLogic { ...@@ -740,13 +751,14 @@ public class OperationLogic extends AbstractLogic {
// 添付ディレクトリの移動 // 添付ディレクトリの移動
boolean result = FileUtil.copy(tempDirPath, routineTaskReportDirPath, true); boolean result = FileUtil.copy(tempDirPath, routineTaskReportDirPath, true);
if(result) { if (result) {
FileUtil.delete(tempDirPath); FileUtil.delete(tempDirPath);
} }
} }
/** /**
* 定期点検データ更新 * 定期点検データ更新
*
* @param operationId * @param operationId
* @param contentId * @param contentId
* @param taskReportDto * @param taskReportDto
...@@ -826,6 +838,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -826,6 +838,7 @@ public class OperationLogic extends AbstractLogic {
/** /**
* 作業報告送信データ、新規 * 作業報告送信データ、新規
*
* @param taskKey * @param taskKey
* @param taskReportJson * @param taskReportJson
* @param deleteFlg * @param deleteFlg
...@@ -859,6 +872,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -859,6 +872,7 @@ public class OperationLogic extends AbstractLogic {
/** /**
* 作業報告送信データ、更新 * 作業報告送信データ、更新
*
* @param taskKey * @param taskKey
* @param taskReportId * @param taskReportId
* @param reportStartDate * @param reportStartDate
...@@ -905,6 +919,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -905,6 +919,7 @@ public class OperationLogic extends AbstractLogic {
/** /**
* 作業報告送信データID取得 * 作業報告送信データID取得
*
* @param taskKey * @param taskKey
* @return * @return
*/ */
...@@ -914,6 +929,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -914,6 +929,7 @@ public class OperationLogic extends AbstractLogic {
/** /**
* 定期点検用、作業削除 * 定期点検用、作業削除
*
* @param operationId * @param operationId
* @param contentId * @param contentId
* @param dto * @param dto
...@@ -933,6 +949,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -933,6 +949,7 @@ public class OperationLogic extends AbstractLogic {
/** /**
* 定期点検用、作業内容削除 * 定期点検用、作業内容削除
*
* @param operationId * @param operationId
* @param contentId * @param contentId
* @param taskKey * @param taskKey
...@@ -941,7 +958,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -941,7 +958,7 @@ public class OperationLogic extends AbstractLogic {
*/ */
public void deleteRoutineTaskReport(long operationId, long contentId, String taskKey, int taskReportId, String reportStartDate) { public void deleteRoutineTaskReport(long operationId, long contentId, String taskKey, int taskReportId, String reportStartDate) {
TaskReportDto taskReportDto = mTaskReportDao.getRoutineTaskReportUtc(taskKey, taskReportId, reportStartDate); TaskReportDto taskReportDto = mTaskReportDao.getRoutineTaskReportUtc(taskKey, taskReportId, reportStartDate);
if(taskReportDto != null) { if (taskReportDto != null) {
taskReportDto.dataSendFlg = true; taskReportDto.dataSendFlg = true;
taskReportDto.attachedFileSendFlg = false; taskReportDto.attachedFileSendFlg = false;
taskReportDto.jsonData = ""; taskReportDto.jsonData = "";
...@@ -969,6 +986,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -969,6 +986,7 @@ public class OperationLogic extends AbstractLogic {
/** /**
* ホットスポットの更新 * ホットスポットの更新
*
* @param taskKey * @param taskKey
* @param param * @param param
*/ */
...@@ -1024,8 +1042,8 @@ public class OperationLogic extends AbstractLogic { ...@@ -1024,8 +1042,8 @@ public class OperationLogic extends AbstractLogic {
try { try {
OperationDto operationDto = mOperationDao.getOperation(operationId); OperationDto operationDto = mOperationDao.getOperation(operationId);
if (operationDto.reportType == Constant.ReportType.ReportContinuous) { if (operationDto.reportType == Constant.ReportType.ReportContinuous) {
contentPath = contentPath.replaceAll("panoImage","processList"); contentPath = contentPath.replaceAll("panoImage", "processList");
contentPath = contentPath.replaceAll("taskPdf","processList"); contentPath = contentPath.replaceAll("taskPdf", "processList");
createContinuousTaskReportJson(operationId); createContinuousTaskReportJson(operationId);
createContinuousTaskReportSuggestJson(operationId); createContinuousTaskReportSuggestJson(operationId);
createProcessInfoJson(operationId, contentPath); createProcessInfoJson(operationId, contentPath);
...@@ -1042,7 +1060,6 @@ public class OperationLogic extends AbstractLogic { ...@@ -1042,7 +1060,6 @@ public class OperationLogic extends AbstractLogic {
createHopSpotJson(operationId, contentPath); createHopSpotJson(operationId, contentPath);
} catch (IOException e) { } catch (IOException e) {
Logger.e(TAG, "createJsonForOperationContent error : ", e); Logger.e(TAG, "createJsonForOperationContent error : ", e);
throw e; throw e;
...@@ -1103,7 +1120,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1103,7 +1120,7 @@ public class OperationLogic extends AbstractLogic {
jsonObject.put("attachedMoviePath", ABVEnvironment.getInstance().getAttachedMoviesFilePath(contentId)); jsonObject.put("attachedMoviePath", ABVEnvironment.getInstance().getAttachedMoviesFilePath(contentId));
// 絞り検索マスタデータのパス // 絞り検索マスタデータのパス
jsonObject.put("masterPath",ABVEnvironment.getInstance().getMasterFilePath() + File.separator + ABVEnvironment.getInstance().ApertureMasterDataFileName); jsonObject.put("masterPath", ABVEnvironment.getInstance().getMasterFilePath() + File.separator + ABVEnvironment.getInstance().ApertureMasterDataFileName);
FileUtil.createFile(contentPath + "/content.json", jsonObject.toString()); FileUtil.createFile(contentPath + "/content.json", jsonObject.toString());
} }
...@@ -1160,8 +1177,8 @@ public class OperationLogic extends AbstractLogic { ...@@ -1160,8 +1177,8 @@ public class OperationLogic extends AbstractLogic {
List<TaskDto> taskDtoList = mTaskDao.selectTaskByOperationId(operationId); List<TaskDto> taskDtoList = mTaskDao.selectTaskByOperationId(operationId);
OperationDto operation = mOperationDao.getOperation(operationId); OperationDto operation = mOperationDao.getOperation(operationId);
if (operation.reportType == Constant.ReportType.ReportContinuous) { if (operation.reportType == Constant.ReportType.ReportContinuous) {
contentPath = contentPath.replaceAll("panoImage","processList"); contentPath = contentPath.replaceAll("panoImage", "processList");
contentPath = contentPath.replaceAll("taskPdf","processList"); contentPath = contentPath.replaceAll("taskPdf", "processList");
} }
for (TaskDto dto : taskDtoList) { for (TaskDto dto : taskDtoList) {
if (!StringUtil.isNullOrEmpty(dto.taskHotSpotInfo)) { if (!StringUtil.isNullOrEmpty(dto.taskHotSpotInfo)) {
...@@ -1177,6 +1194,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1177,6 +1194,7 @@ public class OperationLogic extends AbstractLogic {
/** /**
* phaseStatus.jsonファイル作成(工程承認情報表示用) * phaseStatus.jsonファイル作成(工程承認情報表示用)
*
* @param operationId 作業ID * @param operationId 作業ID
* @param contentPath 保存パス * @param contentPath 保存パス
* @throws IOException * @throws IOException
...@@ -1222,11 +1240,12 @@ public class OperationLogic extends AbstractLogic { ...@@ -1222,11 +1240,12 @@ public class OperationLogic extends AbstractLogic {
phaseStatusJson.put(ABookKeys.PROCESS_LIST, processInfoList); phaseStatusJson.put(ABookKeys.PROCESS_LIST, processInfoList);
OperationDto operation = mOperationDao.getOperation(operationId); OperationDto operation = mOperationDao.getOperation(operationId);
if (operation.operationType == PANO || operation.operationType == DRAWING || operation.operationType == PDF) { if (operation.operationType == PANO || operation.operationType == DRAWING || operation.operationType == PDF) {
contentPath = contentPath.replaceAll("panoImage","processList"); contentPath = contentPath.replaceAll("panoImage", "processList");
contentPath = contentPath.replaceAll("taskPdf","processList"); contentPath = contentPath.replaceAll("taskPdf", "processList");
} }
FileUtil.createFile(contentPath + "/phaseStatus.json", phaseStatusJson.toString()); FileUtil.createFile(contentPath + "/phaseStatus.json", phaseStatusJson.toString());
} }
/** /**
* processInfo.jsonファイル作成(報告一覧表示用) * processInfo.jsonファイル作成(報告一覧表示用)
* *
...@@ -1249,8 +1268,8 @@ public class OperationLogic extends AbstractLogic { ...@@ -1249,8 +1268,8 @@ public class OperationLogic extends AbstractLogic {
processInfoJson.put("processList", taskJsonList); processInfoJson.put("processList", taskJsonList);
OperationDto operation = mOperationDao.getOperation(operationId); OperationDto operation = mOperationDao.getOperation(operationId);
if (operation.operationType == PANO || operation.operationType == DRAWING || operation.operationType == PDF) { if (operation.operationType == PANO || operation.operationType == DRAWING || operation.operationType == PDF) {
contentPath = contentPath.replaceAll("panoImage","processList"); contentPath = contentPath.replaceAll("panoImage", "processList");
contentPath = contentPath.replaceAll("taskPdf","processList"); contentPath = contentPath.replaceAll("taskPdf", "processList");
} }
Logger.d(TAG, "createProcessInfoJson : " + processInfoJson.toString()); Logger.d(TAG, "createProcessInfoJson : " + processInfoJson.toString());
FileUtil.createFile(contentPath + "/processInfo.json", processInfoJson.toString()); FileUtil.createFile(contentPath + "/processInfo.json", processInfoJson.toString());
...@@ -1271,14 +1290,14 @@ public class OperationLogic extends AbstractLogic { ...@@ -1271,14 +1290,14 @@ public class OperationLogic extends AbstractLogic {
processInfoJson.put("processList", taskJsonList); processInfoJson.put("processList", taskJsonList);
OperationDto operation = mOperationDao.getOperation(operationId); OperationDto operation = mOperationDao.getOperation(operationId);
if (operation.operationType == PANO || operation.operationType == DRAWING || operation.operationType == PDF) { if (operation.operationType == PANO || operation.operationType == DRAWING || operation.operationType == PDF) {
contentPath = contentPath.replaceAll("panoImage","processList"); contentPath = contentPath.replaceAll("panoImage", "processList");
contentPath = contentPath.replaceAll("taskPdf","processList"); contentPath = contentPath.replaceAll("taskPdf", "processList");
} }
Logger.d(TAG, "createProcessInfoJson : " + processInfoJson.toString()); Logger.d(TAG, "createProcessInfoJson : " + processInfoJson.toString());
FileUtil.createFile(contentPath + "/processInfo.json", processInfoJson.toString()); FileUtil.createFile(contentPath + "/processInfo.json", processInfoJson.toString());
return processInfoJson.toString(); return processInfoJson.toString();
} }
/** /**
* 作業報告用のjsonファイル * 作業報告用のjsonファイル
* 報告と報告(回答)のデータの区分が必要なので、「taskReport_0」と「taskReport_1」で形式で作成 * 報告と報告(回答)のデータの区分が必要なので、「taskReport_0」と「taskReport_1」で形式で作成
...@@ -1304,7 +1323,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1304,7 +1323,7 @@ public class OperationLogic extends AbstractLogic {
level++; level++;
} }
if(dto.jsonData != null && dto.jsonData.length() > 0) { if (dto.jsonData != null && dto.jsonData.length() > 0) {
if (operationDto.reportType == Constant.ReportType.ReportReply) { if (operationDto.reportType == Constant.ReportType.ReportReply) {
JSONObject editJson = new JSONObject(dto.jsonData); JSONObject editJson = new JSONObject(dto.jsonData);
editJson.put(ABookKeys.HAS_AUTHORITY, dto.enableReport); editJson.put(ABookKeys.HAS_AUTHORITY, dto.enableReport);
...@@ -1335,13 +1354,14 @@ public class OperationLogic extends AbstractLogic { ...@@ -1335,13 +1354,14 @@ public class OperationLogic extends AbstractLogic {
} }
Logger.d(TAG, "createTaskReportJson : " + taskReportJson.toString()); Logger.d(TAG, "createTaskReportJson : " + taskReportJson.toString());
Logger.d(TAG,contentPath + "/" + ABookKeys.TASK_REPORT + ".json"); Logger.d(TAG, contentPath + "/" + ABookKeys.TASK_REPORT + ".json");
FileUtil.createFile(contentPath + "/" + ABookKeys.TASK_REPORT + ".json", taskReportJson.toString()); FileUtil.createFile(contentPath + "/" + ABookKeys.TASK_REPORT + ".json", taskReportJson.toString());
} }
/** /**
* 定期点検用のJSON作成 * 定期点検用のJSON作成
*
* @param operationId * @param operationId
* @param contentPath * @param contentPath
* @throws IOException * @throws IOException
...@@ -1372,12 +1392,13 @@ public class OperationLogic extends AbstractLogic { ...@@ -1372,12 +1392,13 @@ public class OperationLogic extends AbstractLogic {
taskReportJsonRoot.put(ABookKeys.TASK_REPORT_ID, lastRoutineTaskReportDto.taskReportId); taskReportJsonRoot.put(ABookKeys.TASK_REPORT_ID, lastRoutineTaskReportDto.taskReportId);
taskReportJsonRoot.put("taskReport_0", taskReportJsonList); taskReportJsonRoot.put("taskReport_0", taskReportJsonList);
Logger.d(TAG, "createRoutineTaskReportJson : " + taskReportJsonRoot.toString()); Logger.d(TAG, "createRoutineTaskReportJson : " + taskReportJsonRoot.toString());
Logger.d(TAG,contentPath + "/" + ABookKeys.TASK_REPORT + ".json"); Logger.d(TAG, contentPath + "/" + ABookKeys.TASK_REPORT + ".json");
FileUtil.createFile(contentPath + "/" + ABookKeys.TASK_REPORT + ".json", taskReportJsonRoot.toString()); FileUtil.createFile(contentPath + "/" + ABookKeys.TASK_REPORT + ".json", taskReportJsonRoot.toString());
} }
/** /**
* 連続作業用の報告Suggestデータ作成(taskReportSuggest.json) *  連続作業用の報告Suggestデータ作成(taskReportSuggest.json)
*
* @param operationId 作業ID * @param operationId 作業ID
* @throws IOException I/O例外 * @throws IOException I/O例外
*/ */
...@@ -1423,6 +1444,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1423,6 +1444,7 @@ public class OperationLogic extends AbstractLogic {
/** /**
* 連続作業用の報告用データ作成(TaskReport.json作成) * 連続作業用の報告用データ作成(TaskReport.json作成)
*
* @param operationId 作業ID * @param operationId 作業ID
* @throws IOException I/O例外 * @throws IOException I/O例外
*/ */
...@@ -1441,7 +1463,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1441,7 +1463,7 @@ public class OperationLogic extends AbstractLogic {
Integer phaseNo = taskDto.phaseNo; Integer phaseNo = taskDto.phaseNo;
for (TaskReportDto taskReportDto : taskReportDtoList) { for (TaskReportDto taskReportDto : taskReportDtoList) {
JSONObject taskReportJson = new JSONObject(); JSONObject taskReportJson = new JSONObject();
if(taskReportDto.jsonData != null && taskReportDto.jsonData.length() > 0) { if (taskReportDto.jsonData != null && taskReportDto.jsonData.length() > 0) {
taskReportJson = new JSONObject(taskReportDto.jsonData); taskReportJson = new JSONObject(taskReportDto.jsonData);
} }
taskReportJson.put(ABookKeys.PROCESS_KEY, taskDto.processKey); taskReportJson.put(ABookKeys.PROCESS_KEY, taskDto.processKey);
...@@ -1491,11 +1513,11 @@ public class OperationLogic extends AbstractLogic { ...@@ -1491,11 +1513,11 @@ public class OperationLogic extends AbstractLogic {
} }
// #32926 作業報告画面改善 start // #32926 作業報告画面改善 start
List<TaskReportDto> taskReportList = mTaskReportDao.getTaskReportByOperationId(operationId); List<TaskReportDto> taskReportList = mTaskReportDao.getTaskReportByOperationId(operationId);
for (TaskReportDto dto : taskReportList) { for (TaskReportDto dto : taskReportList) {
taskReportSuggestJson.put(String.format("%s_%s", ABookKeys.TASK_REPORT_SUGGEST, String.valueOf(dto.taskReportLevel)), itemJson); taskReportSuggestJson.put(String.format("%s_%s", ABookKeys.TASK_REPORT_SUGGEST, String.valueOf(dto.taskReportLevel)), itemJson);
} }
Logger.d(TAG, "createTaskReportSuggestJson : " + taskReportSuggestJson.toString()); Logger.d(TAG, "createTaskReportSuggestJson : " + taskReportSuggestJson.toString());
Logger.d(TAG,contentPath + "/" + ABookKeys.TASK_REPORT_SUGGEST + ".json"); Logger.d(TAG, contentPath + "/" + ABookKeys.TASK_REPORT_SUGGEST + ".json");
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
FileUtil.createFile(contentPath + "/" + ABookKeys.TASK_REPORT_SUGGEST + ".json", taskReportSuggestJson.toString()); FileUtil.createFile(contentPath + "/" + ABookKeys.TASK_REPORT_SUGGEST + ".json", taskReportSuggestJson.toString());
} }
...@@ -1533,10 +1555,10 @@ public class OperationLogic extends AbstractLogic { ...@@ -1533,10 +1555,10 @@ public class OperationLogic extends AbstractLogic {
/** /**
* 作業一覧取得 * 作業一覧取得
* *
* @param searchWord 検索条件:作業名 * @param searchWord 検索条件:作業名
* @param searchStartDateStr 検索条件:作業日範囲(開始) * @param searchStartDateStr  検索条件:作業日範囲(開始)
* @param searchEndDateStr  検索条件:作業日範囲(終了) * @param searchEndDateStr   検索条件:作業日範囲(終了)
* @param operationSortingType ソート順 * @param operationSortingType  ソート順
* @return 作業リスト * @return 作業リスト
*/ */
public List<OperationDto> getRefreshOperation(String searchWord, String searchStartDateStr, String searchEndDateStr, OperationSortingType operationSortingType, int operationGroupMasterId) { public List<OperationDto> getRefreshOperation(String searchWord, String searchStartDateStr, String searchEndDateStr, OperationSortingType operationSortingType, int operationGroupMasterId) {
...@@ -1567,7 +1589,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1567,7 +1589,7 @@ public class OperationLogic extends AbstractLogic {
for (ContentDto contentDto : contentDtoList) { for (ContentDto contentDto : contentDtoList) {
if (contentDto.categoryNames.equals(categoryContentDto.categoryName)) { if (contentDto.categoryNames.equals(categoryContentDto.categoryName)) {
saveContentDtoArray.add(contentDto); saveContentDtoArray.add(contentDto);
} else { } else {
if (saveContentDtoArray.size() != 0) { if (saveContentDtoArray.size() != 0) {
categoryContentDto.contentDtoArray = saveContentDtoArray; categoryContentDto.contentDtoArray = saveContentDtoArray;
...@@ -1638,8 +1660,9 @@ public class OperationLogic extends AbstractLogic { ...@@ -1638,8 +1660,9 @@ public class OperationLogic extends AbstractLogic {
/** /**
* 作業報告履歴データ送信(全体) * 作業報告履歴データ送信(全体)
* @param operationId 作業ID *
* @param progressCallback コールバック用 * @param operationId 作業ID
* @param progressCallback コールバック用
* @return * @return
* @throws Exception * @throws Exception
*/ */
...@@ -1649,9 +1672,10 @@ public class OperationLogic extends AbstractLogic { ...@@ -1649,9 +1672,10 @@ public class OperationLogic extends AbstractLogic {
/** /**
* 作業報告履歴データ送信 * 作業報告履歴データ送信
* @param operationId 作業ID *
* @param taskKey 報告・回答のキー * @param operationId 作業ID
* @param progressCallback コールバック用 * @param taskKey 報告・回答のキー
* @param progressCallback コールバック用
* @throws Exception * @throws Exception
*/ */
public void sendTaskReportSendData(long operationId, String taskKey, Integer taskReportLevel, Callback progressCallback) throws Exception { public void sendTaskReportSendData(long operationId, String taskKey, Integer taskReportLevel, Callback progressCallback) throws Exception {
...@@ -1775,10 +1799,10 @@ public class OperationLogic extends AbstractLogic { ...@@ -1775,10 +1799,10 @@ public class OperationLogic extends AbstractLogic {
/** /**
* 作業関連ディレクトリ削除 * 作業関連ディレクトリ削除
* *
* @param operationId 作業ID * @param operationId 作業ID
* @param contentId 資料ID * @param contentId 資料ID
* @param taskKey 報告・回答のキー * @param taskKey 報告・回答のキー
* @param taskReportLevel 報告・回答のレベル * @param taskReportLevel 報告・回答のレベル
*/ */
public void deleteTaskFileData(long operationId, long contentId, String taskKey, int taskReportLevel) { public void deleteTaskFileData(long operationId, long contentId, String taskKey, int taskReportLevel) {
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey)); FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
...@@ -1815,6 +1839,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1815,6 +1839,7 @@ public class OperationLogic extends AbstractLogic {
/** /**
* タスク関連zipファイル取得 * タスク関連zipファイル取得
*
* @param operationId * @param operationId
* @param taskKey * @param taskKey
* @param taskId * @param taskId
...@@ -1833,6 +1858,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1833,6 +1858,7 @@ public class OperationLogic extends AbstractLogic {
/** /**
* 定期点検関連zipファイル取得 * 定期点検関連zipファイル取得
*
* @param operationId * @param operationId
* @param taskKey * @param taskKey
* @param taskId * @param taskId
...@@ -1852,6 +1878,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1852,6 +1878,7 @@ public class OperationLogic extends AbstractLogic {
/** /**
* シーンの登録 * シーンの登録
*
* @param file * @param file
* @param contentId * @param contentId
* @throws IOException * @throws IOException
...@@ -1864,6 +1891,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1864,6 +1891,7 @@ public class OperationLogic extends AbstractLogic {
/** /**
* 360コンテンツの登録 * 360コンテンツの登録
*
* @param operationId * @param operationId
* @param contentName * @param contentName
* @param file * @param file
...@@ -1876,15 +1904,15 @@ public class OperationLogic extends AbstractLogic { ...@@ -1876,15 +1904,15 @@ public class OperationLogic extends AbstractLogic {
public void deleteAllOperation() { public void deleteAllOperation() {
List<OperationDto> operationDtoList = mOperationDao.getAllOperation(); List<OperationDto> operationDtoList = mOperationDao.getAllOperation();
for(OperationDto operationDto : operationDtoList) { for (OperationDto operationDto : operationDtoList) {
FileUtil.delete(ABVEnvironment.getInstance().getOperationDirFile(operationDto.operationId)); FileUtil.delete(ABVEnvironment.getInstance().getOperationDirFile(operationDto.operationId));
} }
mOperationDao.deleteAll(); mOperationDao.deleteAll();
} }
public void setContentCreatingFlg(long operationId) { public void setContentCreatingFlg(long operationId) {
mOperationDao.updateContentCreatingFlg(operationId, true); mOperationDao.updateContentCreatingFlg(operationId, true);
} }
/** /**
* 作業の添付ファイルのzip生成 * 作業の添付ファイルのzip生成
...@@ -1934,6 +1962,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1934,6 +1962,7 @@ public class OperationLogic extends AbstractLogic {
/** /**
* 作業報告送信の添付ファイルのzip生成 * 作業報告送信の添付ファイルのzip生成
*
* @param operationId * @param operationId
* @param taskKey * @param taskKey
* @param taskReportSendId * @param taskReportSendId
...@@ -1986,10 +2015,11 @@ public class OperationLogic extends AbstractLogic { ...@@ -1986,10 +2015,11 @@ public class OperationLogic extends AbstractLogic {
/** /**
* ディレクトリのファイルがattachedFileNamesに含まれないファイル削除 * ディレクトリのファイルがattachedFileNamesに含まれないファイル削除
*
* @param dirPath * @param dirPath
* @param attachedFileNames * @param attachedFileNames
*/ */
private void deleteDifferentialFile (String dirPath, List<String> attachedFileNames) { private void deleteDifferentialFile(String dirPath, List<String> attachedFileNames) {
File file = new File(dirPath); File file = new File(dirPath);
if (file.exists()) { if (file.exists()) {
String[] fileList = file.list(); String[] fileList = file.list();
...@@ -2005,6 +2035,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -2005,6 +2035,7 @@ public class OperationLogic extends AbstractLogic {
/** /**
* 作業の開始日のチェック * 作業の開始日のチェック
*
* @param operationId * @param operationId
* @return * @return
*/ */
...@@ -2019,8 +2050,9 @@ public class OperationLogic extends AbstractLogic { ...@@ -2019,8 +2050,9 @@ public class OperationLogic extends AbstractLogic {
/** /**
* 作業報告の取得 * 作業報告の取得
* @param taskKey 報告・回答キー *
* @param taskReportlevel 作業レベル * @param taskKey 報告・回答キー
* @param taskReportlevel 作業レベル
* @return TaskReportDto 作業報告 * @return TaskReportDto 作業報告
*/ */
public TaskReportDto getTaskReport(String taskKey, int taskReportlevel) { public TaskReportDto getTaskReport(String taskKey, int taskReportlevel) {
...@@ -2029,6 +2061,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -2029,6 +2061,7 @@ public class OperationLogic extends AbstractLogic {
/** /**
* suggestJsonデータをtaskReportItemテーブルに登録 * suggestJsonデータをtaskReportItemテーブルに登録
*
* @param taskKey * @param taskKey
* @param reportLevel * @param reportLevel
* @param suggestJson * @param suggestJson
...@@ -2070,6 +2103,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -2070,6 +2103,7 @@ public class OperationLogic extends AbstractLogic {
/** /**
* t_taskテーブルに登録(報告データ) * t_taskテーブルに登録(報告データ)
* データが存在しないと登録する * データが存在しないと登録する
*
* @param taskKey * @param taskKey
* @param operationId * @param operationId
* @param hotSpotInfo * @param hotSpotInfo
...@@ -2142,12 +2176,13 @@ public class OperationLogic extends AbstractLogic { ...@@ -2142,12 +2176,13 @@ public class OperationLogic extends AbstractLogic {
/** /**
* 連続作業の承認情報を取得 * 連続作業の承認情報を取得
*
* @param operationId 作業ID * @param operationId 作業ID
* @throws NetworkDisconnectedException * @throws NetworkDisconnectedException
* @throws ABVException * @throws ABVException
* @throws IOException * @throws IOException
*/ */
public void getProcessData(Long operationId) throws NetworkDisconnectedException, ABVException { public void getProcessData(Long operationId) throws NetworkDisconnectedException, ABVException {
GetOperationDataParameters param = new GetOperationDataParameters(ABVDataCache.getInstance().getMemberInfo().sid, operationId); GetOperationDataParameters param = new GetOperationDataParameters(ABVDataCache.getInstance().getMemberInfo().sid, operationId);
ProcessDataJSON json = AcmsClient.getInstance(ABVDataCache.getInstance().getUrlPath(), ABVEnvironment.getInstance().networkAdapter).getProcessData(param); ProcessDataJSON json = AcmsClient.getInstance(ABVDataCache.getInstance().getUrlPath(), ABVEnvironment.getInstance().networkAdapter).getProcessData(param);
for (TaskDto taskDto : json.taskDtoList) { for (TaskDto taskDto : json.taskDtoList) {
...@@ -2169,7 +2204,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -2169,7 +2204,7 @@ public class OperationLogic extends AbstractLogic {
} }
} }
public String getProcessDataAndCreateJson(Long operationId, String contentPath, boolean routineTaskReportFlg) throws NetworkDisconnectedException, ABVException, IOException { public String getProcessDataAndCreateJson(Long operationId, String contentPath, boolean routineTaskReportFlg) throws NetworkDisconnectedException, ABVException, IOException {
GetOperationDataParameters param = new GetOperationDataParameters(ABVDataCache.getInstance().getMemberInfo().sid, operationId); GetOperationDataParameters param = new GetOperationDataParameters(ABVDataCache.getInstance().getMemberInfo().sid, operationId);
ProcessDataJSON json = AcmsClient.getInstance(ABVDataCache.getInstance().getUrlPath(), ABVEnvironment.getInstance().networkAdapter).getProcessData(param); ProcessDataJSON json = AcmsClient.getInstance(ABVDataCache.getInstance().getUrlPath(), ABVEnvironment.getInstance().networkAdapter).getProcessData(param);
for (TaskDto taskDto : json.taskDtoList) { for (TaskDto taskDto : json.taskDtoList) {
...@@ -2194,9 +2229,10 @@ public class OperationLogic extends AbstractLogic { ...@@ -2194,9 +2229,10 @@ public class OperationLogic extends AbstractLogic {
/** /**
* 工程情報を全部削除する。(全削除ボタンタップ時) * 工程情報を全部削除する。(全削除ボタンタップ時)
*
* @param operationId 作業ID * @param operationId 作業ID
* @param processKey 工程キー * @param processKey 工程キー
* @throws Exception 例外 * @throws Exception 例外
* @throws ABVException 例外 * @throws ABVException 例外
*/ */
public void sendDeleteProcess(final long operationId, final String processKey) throws Exception, ABVException { public void sendDeleteProcess(final long operationId, final String processKey) throws Exception, ABVException {
...@@ -2206,6 +2242,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -2206,6 +2242,7 @@ public class OperationLogic extends AbstractLogic {
/** /**
* 同期処理で、削除された工程情報を * 同期処理で、削除された工程情報を
*
* @param operationId * @param operationId
* @throws Exception * @throws Exception
* @throws AcmsException * @throws AcmsException
...@@ -2268,5 +2305,124 @@ public class OperationLogic extends AbstractLogic { ...@@ -2268,5 +2305,124 @@ public class OperationLogic extends AbstractLogic {
} }
return operationListJsonObject.toString(); return operationListJsonObject.toString();
} }
/**
* サーバから取得したタスクデータとローカルDBのタスクデータを比較
* @param localTaskDto ローカルDBのタスクデータ
* @param serverTaskDto サーバ側から取得したタスクデータ
* @return true:変更なし、false:変更あり
*/
public boolean taskDataSameCheck(TaskDto localTaskDto, TaskDto serverTaskDto) {
if (!Objects.equals(localTaskDto.taskId, serverTaskDto.taskId)) {
return false;
}
if (!Objects.equals(localTaskDto.taskCode, serverTaskDto.taskCode)) {
return false;
}
if (!Objects.equals(localTaskDto.taskStatus, serverTaskDto.taskStatus)) {
return false;
}
if (!Objects.equals(localTaskDto.taskHotSpotInfo, serverTaskDto.taskHotSpotInfo)) {
return false;
}
if (!Objects.equals(localTaskDto.delFlg, serverTaskDto.delFlg)) {
return false;
}
if (!Objects.equals(localTaskDto.taskName, serverTaskDto.taskName)) {
return false;
}
if (!Objects.equals(localTaskDto.phaseNo, serverTaskDto.phaseNo)) {
return false;
}
if (!Objects.equals(localTaskDto.phaseStatus, serverTaskDto.phaseStatus)) {
return false;
}
if (!Objects.equals(localTaskDto.processStatus, serverTaskDto.processStatus)) {
return false;
}
if (!Objects.equals(localTaskDto.processKey, serverTaskDto.processKey)) {
return false;
}
return true;
}
/**
* サーバから取得したタスク報告データとローカルDBのタスク報告データを比較
* @param localTaskReportDto ローカルDBの報告データ
* @param serverTaskReportDto サーバ側から取得した報告データ
* @return true:変更なし、false:変更あり
*/
public boolean taskReportDataSameCheck(TaskReportDto localTaskReportDto, TaskReportDto serverTaskReportDto) {
if (!Objects.equals(localTaskReportDto.attachedFileName, serverTaskReportDto.attachedFileName)) {
return false;
}
if (!Objects.equals(localTaskReportDto.attachedFileSendFlg, serverTaskReportDto.attachedFileSendFlg)) {
return false;
}
if (!Objects.equals(localTaskReportDto.dataSendFlg, serverTaskReportDto.dataSendFlg)) {
return false;
}
if (!Objects.equals(localTaskReportDto.delFlg, serverTaskReportDto.delFlg)) {
return false;
}
if (!Objects.equals(localTaskReportDto.enableReport, serverTaskReportDto.enableReport)) {
return false;
}
if (!Objects.equals(localTaskReportDto.jsonData, serverTaskReportDto.jsonData)) {
return false;
}
if (!Objects.equals(localTaskReportDto.localAttachedFileName, serverTaskReportDto.localAttachedFileName)) {
return false;
}
if (!Objects.equals(localTaskReportDto.localSavedFlg, serverTaskReportDto.localSavedFlg)) {
return false;
}
if (!Objects.equals(localTaskReportDto.reportStartDate, serverTaskReportDto.reportStartDate)) {
return false;
}
if (!Objects.equals(localTaskReportDto.reportEndDate, serverTaskReportDto.reportEndDate)) {
return false;
}
if (!Objects.equals(localTaskReportDto.taskReportInfoId, serverTaskReportDto.taskReportInfoId)) {
return false;
}
if (!Objects.equals(localTaskReportDto.taskReportLevel, serverTaskReportDto.taskReportLevel)) {
return false;
}
return true;
}
/**
* DBから取得した定期点検タスク報告配列から該当するタスク報告を取得する
*
* @param localTaskReportDtoList DBから取得したタスク報告配列
* @param taskKey タスクキー
* @param taskReportId タスク報告ID
* @param reportStartDate 定期点検開始日
* @return TaskReportDto タスク報告
*/
public TaskReportDto getLocalRoutineTaskReportDtoInList(List<TaskReportDto> localTaskReportDtoList, String taskKey, int taskReportId, Date reportStartDate) {
TaskReportDto taskReportDto = null;
for (TaskReportDto localTaskReportDto : localTaskReportDtoList) {
if (localTaskReportDto.taskKey.equals(taskKey) && localTaskReportDto.taskReportId == taskReportId && localTaskReportDto.reportStartDate.equals(reportStartDate)) {
taskReportDto = localTaskReportDto;
continue;
}
}
return taskReportDto;
}
} /**
* ローカルDBから取得したタスク配列の中に該当するタスクDTO取得
* @param listDto リストDto
* @param taskKey タスクキー
* @return
*/
public TaskDto getLocalTaskInList(List<TaskDto> listDto, String taskKey) {
for (TaskDto lDto : listDto) {
if (lDto.taskKey.equals(taskKey)) {
return lDto;
}
}
return null;
}
}
\ No newline at end of file
...@@ -56,6 +56,11 @@ android { ...@@ -56,6 +56,11 @@ android {
resValue("integer", "push_message", "${push_message}") resValue("integer", "push_message", "${push_message}")
resValue("integer", "check_app_update", "${check_app_update}") resValue("integer", "check_app_update", "${check_app_update}")
resValue("integer", "not_delete_all_contents", "${not_delete_all_contents}") resValue("integer", "not_delete_all_contents", "${not_delete_all_contents}")
// privacy policy
resValue("string", "privacy_policy_url", "${privacy_policy_url}")
// 利用規約
resValue("string", "agree_to_terms_of_use_url", "${agree_to_terms_of_use_url}")
} }
sourceSets { sourceSets {
main { main {
......
...@@ -208,6 +208,7 @@ ...@@ -208,6 +208,7 @@
<string name="E128">ライセンス情報の取得に失敗しました。</string> <string name="E128">ライセンス情報の取得に失敗しました。</string>
<string name="E129">パスワード に誤りがあります。</string> <string name="E129">パスワード に誤りがあります。</string>
<string name="E130">リンクは無効です。</string> <string name="E130">リンクは無効です。</string>
<string name="E132">利用規約に同意してください。</string>
<string name="L001">入力された情報に誤りがあります。\nユーザアカウントをご確認の上、再度ログインしてください。(L001)</string> <string name="L001">入力された情報に誤りがあります。\nユーザアカウントをご確認の上、再度ログインしてください。(L001)</string>
<string name="L002">この端末のIDは既に他のユーザアカウントに利用されています。\n管理者へお問い合わせください。(L002)</string> <string name="L002">この端末のIDは既に他のユーザアカウントに利用されています。\n管理者へお問い合わせください。(L002)</string>
...@@ -1508,4 +1509,9 @@ ...@@ -1508,4 +1509,9 @@
<string name="btn_communication">コミュニケーション</string> <string name="btn_communication">コミュニケーション</string>
<string name="btn_setting">設定</string> <string name="btn_setting">設定</string>
<string name="btn_print">PDF</string> <string name="btn_print">PDF</string>
<string name="msg_oz_report_cancel">キャンセルした場合入力内容は破棄されます。よろしいですか?</string>
<string name="privacy_policy">プライバシーポリシー</string>
<string name="msg_agree_to_terms_of_use">利用規約に同意する</string>
<string name="clickable_detail_button">(詳細)</string>
<string name="err_gert_term_of_use_text">利用規約の取得に失敗しました。ネットワークの接続状態を確認してください。</string>
</resources> </resources>
...@@ -209,6 +209,7 @@ ...@@ -209,6 +209,7 @@
<string name="E128">라이선스 정보를 표시할 수 없습니다.</string> <string name="E128">라이선스 정보를 표시할 수 없습니다.</string>
<string name="E129">패스워드를 잘못 입력하셨습니다.</string> <string name="E129">패스워드를 잘못 입력하셨습니다.</string>
<string name="E130">링크가 잘못되었습니다.</string> <string name="E130">링크가 잘못되었습니다.</string>
<string name="E132">이용약관에 동의하십시오.</string>
<string name="L001">입력된 정보에 오류가 있습니다.\n로그인 정보를 다시 확인하신 후 로그인해 주십시오.(L001)</string> <string name="L001">입력된 정보에 오류가 있습니다.\n로그인 정보를 다시 확인하신 후 로그인해 주십시오.(L001)</string>
<string name="L002">이 단말기의 ID는 기존의 다른 사용자 계정에 사용되었습니다.\n관리자에게 문의해 주십시오.(L002)</string> <string name="L002">이 단말기의 ID는 기존의 다른 사용자 계정에 사용되었습니다.\n관리자에게 문의해 주십시오.(L002)</string>
...@@ -1513,4 +1514,9 @@ ...@@ -1513,4 +1514,9 @@
<string name="btn_communication">커뮤니케이션</string> <string name="btn_communication">커뮤니케이션</string>
<string name="btn_setting">설정</string> <string name="btn_setting">설정</string>
<string name="btn_print">PDF</string> <string name="btn_print">PDF</string>
<string name="msg_oz_report_cancel">취소할 경우 입력내용은 파기됩니다. 괜찮으시겠습니까?</string>
<string name="privacy_policy">개인정보취급방침</string>
<string name="msg_agree_to_terms_of_use">이용약관에 동의함</string>
<string name="clickable_detail_button">(상세)</string>
<string name="err_gert_term_of_use_text">이용약관을 얻지 못했습니다. 네트워크 연결 상태를 확인해주세요.</string>
</resources> </resources>
\ No newline at end of file
...@@ -208,6 +208,7 @@ ...@@ -208,6 +208,7 @@
<string name="E128">Failed to get license info.</string> <string name="E128">Failed to get license info.</string>
<string name="E129">Password is not correct.</string> <string name="E129">Password is not correct.</string>
<string name="E130">Link is invalid.</string> <string name="E130">Link is invalid.</string>
<string name="E132">Please agree to the terms of use.</string>
<string name="L001">Incorrect information entered. \n Please check the user account, please login again.(L001)</string> <string name="L001">Incorrect information entered. \n Please check the user account, please login again.(L001)</string>
<string name="L002">This device ID is already used in other user accounts. \n Please contact the administrator.(L002)</string> <string name="L002">This device ID is already used in other user accounts. \n Please contact the administrator.(L002)</string>
...@@ -1509,4 +1510,9 @@ ...@@ -1509,4 +1510,9 @@
<string name="btn_communication">Communication</string> <string name="btn_communication">Communication</string>
<string name="btn_setting">Setting</string> <string name="btn_setting">Setting</string>
<string name="btn_print">PDF</string> <string name="btn_print">PDF</string>
<string name="msg_oz_report_cancel">If you cancel, your input will be discarded. Is it OK?</string>
<string name="privacy_policy">Privacy Policy</string>
<string name="msg_agree_to_terms_of_use">I agree to the terms of use</string>
<string name="clickable_detail_button">(detail)</string>
<string name="err_gert_term_of_use_text">Failed to get the terms of use. Check the network connection status.</string>
</resources> </resources>
...@@ -14,7 +14,7 @@ dependencies { ...@@ -14,7 +14,7 @@ dependencies {
implementation files('libs/ozrv_android.jar') implementation files('libs/ozrv_android.jar')
api 'com.google.firebase:firebase-core:11.4.0' api 'com.google.firebase:firebase-core:11.4.0'
api 'com.google.firebase:firebase-messaging:11.4.0' api 'com.google.firebase:firebase-messaging:11.4.0'
api 'com.android.support:appcompat-v7:21.0.+' api 'com.android.support:appcompat-v7:25.0.0'
implementation 'commons-codec:commons-codec:1.10' implementation 'commons-codec:commons-codec:1.10'
implementation 'net.lingala.zip4j:zip4j:1.3.2' implementation 'net.lingala.zip4j:zip4j:1.3.2'
......
...@@ -58,6 +58,11 @@ ...@@ -58,6 +58,11 @@
android:layout="@layout/custom_preference_screen"> android:layout="@layout/custom_preference_screen">
</PreferenceScreen> </PreferenceScreen>
<PreferenceScreen <PreferenceScreen
android:key="privacyPolicy"
android:title="@string/privacy_policy"
android:layout="@layout/custom_preference_screen">
</PreferenceScreen>
<PreferenceScreen
android:key="checkAppUpdate" android:key="checkAppUpdate"
android:title="@string/check_app_update" android:title="@string/check_app_update"
android:layout="@layout/custom_preference_screen"> android:layout="@layout/custom_preference_screen">
......
...@@ -1416,13 +1416,11 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -1416,13 +1416,11 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
} }
return errorMsg.length() > 0 ? errorMsg.toString() : null; return errorMsg.length() > 0 ? errorMsg.toString() : null;
} }
/** /**
* 作業データ受信 * 作業データ受信
* @param operationId * @param operationId 作業ID
* @param progressCallback * @param progressCallback プログレスバー表示用コールバック
* @return * @return 作業更新日
* @throws NetworkDisconnectedException * @throws NetworkDisconnectedException
* @throws ABVException * @throws ABVException
* @throws IOException * @throws IOException
...@@ -1431,6 +1429,22 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -1431,6 +1429,22 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
* @throws ZipException * @throws ZipException
*/ */
public Date receptionTaskData(long operationId, Callback progressCallback, StringBuilder errorMsg) throws NetworkDisconnectedException, ABVException, IOException, InterruptedException, NoSuchAlgorithmException, 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); GetOperationDataParameters param = new GetOperationDataParameters(ABVDataCache.getInstance().getMemberInfo().sid, operationId);
OperationDto operationDto = mOperationLogic.getOperation(operationId); OperationDto operationDto = mOperationLogic.getOperation(operationId);
OperationContentDto operationContentDto = mOperationContentDao.getOperationMainContent(operationId); OperationContentDto operationContentDto = mOperationContentDao.getOperationMainContent(operationId);
...@@ -1441,17 +1455,24 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -1441,17 +1455,24 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
OperationDataJSON json = AcmsClient.getInstance(ABVDataCache.getInstance().getUrlPath(), ABVEnvironment.getInstance().networkAdapter).getOpereationData(param); OperationDataJSON json = AcmsClient.getInstance(ABVDataCache.getInstance().getUrlPath(), ABVEnvironment.getInstance().networkAdapter).getOpereationData(param);
//プログレスを40%進行させるための計算 //プログレスを40%進行させるための計算
int progress = 0; float progress = 0;
if (json.taskDtoList.size() != 0) { if (json.taskDtoList.size() != 0) {
progress = 40 / json.taskDtoList.size(); progress = 40f / json.taskDtoList.size();
} }
boolean isRoutineTask = operationDto.reportType == Constant.ReportType.RoutineTask; 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) { for (TaskDto serverTaskDto : json.taskDtoList) {
//報告送信後、そのタスクのみ同期する
if (taskKey != null && !serverTaskDto.taskKey.equals(taskKey)) {
continue;
}
List<TaskReportDto> localTaskReportList = mTaskReportDao.getTaskReportListByTaskKey(serverTaskDto.taskKey); List<TaskReportDto> localTaskReportList = mTaskReportDao.getTaskReportListByTaskKey(serverTaskDto.taskKey);
//報告削除
for (TaskReportDto localTaskReportDto : localTaskReportList) { for (TaskReportDto localTaskReportDto : localTaskReportList) {
if (!isExistsTaskReportInList(serverTaskDto.taskReportDtoList, localTaskReportDto, isRoutineTask)) { if (!isExistsTaskReportInList(serverTaskDto.taskReportDtoList, localTaskReportDto, isRoutineTask)) {
if (isRoutineTask) { if (isRoutineTask) {
...@@ -1467,21 +1488,34 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -1467,21 +1488,34 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
} }
} }
if (isExistsTaskInList(localTaskList, serverTaskDto)) { //タスク更新・追加
// 作業の報告更新 TaskDto localTaskDto = mOperationLogic.getLocalTaskInList(localTaskList, serverTaskDto.taskKey);
mTaskDao.update(serverTaskDto); if (localTaskDto == null) {
localTaskList.remove(serverTaskDto);
} else {
// 作業の報告登録 // 作業の報告登録
mTaskDao.insert(serverTaskDto); mTaskDao.insert(serverTaskDto);
} else {
// 作業の報告更新
if (!mOperationLogic.taskDataSameCheck(localTaskDto, serverTaskDto)) {
mTaskDao.update(serverTaskDto);
}
localTaskList.remove(localTaskDto);
} }
// サーバーからの情報で更新 // サーバーからの情報で更新
//報告更新・追加
for (TaskReportDto serverTaskReportDto : serverTaskDto.taskReportDtoList) { for (TaskReportDto serverTaskReportDto : serverTaskDto.taskReportDtoList) {
String attachedFileName = serverTaskReportDto.attachedFileName; String attachedFileName = serverTaskReportDto.attachedFileName;
TaskReportDto localTaskReportDto; TaskReportDto localTaskReportDto = null;
if (operationDto.reportType == Constant.ReportType.RoutineTask) { 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 { } else {
localTaskReportDto = mTaskReportDao.selectByTaskKey(serverTaskReportDto.taskKey, serverTaskReportDto.taskReportLevel); localTaskReportDto = mTaskReportDao.selectByTaskKey(serverTaskReportDto.taskKey, serverTaskReportDto.taskReportLevel);
} }
...@@ -1513,6 +1547,9 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -1513,6 +1547,9 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
if (localTaskReportDto != null) { if (localTaskReportDto != null) {
// 報告データが存在すると作業報告を更新する // 報告データが存在すると作業報告を更新する
mOperationLogic.updateRoutineTaskReport(serverTaskDto.operationId, operationContentDto.contentId, serverTaskReportDto, false, false, localTaskReportDto.localSavedFlg); mOperationLogic.updateRoutineTaskReport(serverTaskDto.operationId, operationContentDto.contentId, serverTaskReportDto, false, false, localTaskReportDto.localSavedFlg);
if (localTaskReportDtoList != null) {
localTaskReportDtoList.remove(localTaskReportDto);
}
} else { } else {
mOperationLogic.insertRoutineTaskReport(serverTaskDto.operationId, operationContentDto.contentId, serverTaskReportDto, false, false); mOperationLogic.insertRoutineTaskReport(serverTaskDto.operationId, operationContentDto.contentId, serverTaskReportDto, false, false);
} }
...@@ -1548,19 +1585,28 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -1548,19 +1585,28 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
} }
} }
if (progressCallback != null) { 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 = 0f;
}
}
} }
} }
// サーバーから取得した作業情報がローカルに存在しないので削除する // サーバーから取得した作業情報がローカルに存在しないので削除する
for (TaskDto taskDto : localTaskList) { if (taskKey == null) {
mOperationLogic.deleteTaskFileData(operationId, operationContentDto.contentId, taskDto.taskKey, Constant.TaskReportLevel.ReportType); for (TaskDto taskDto : localTaskList) {
mTaskDao.delete(taskDto); mOperationLogic.deleteTaskFileData(operationId, operationContentDto.contentId, taskDto.taskKey, Constant.TaskReportLevel.ReportType);
mTaskDao.delete(taskDto);
}
} }
lastEditDate = json.lastEditDate; lastEditDate = json.lastEditDate;
if (progressCallback != null) { if (progressCallback != null) {
progressCallback.callback(new Integer(40)); progressCallback.callback(new Integer(40));
} }
return lastEditDate; return lastEditDate;
} }
......
...@@ -85,6 +85,8 @@ import jp.agentec.adf.util.DateTimeUtil; ...@@ -85,6 +85,8 @@ import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.FileUtil; import jp.agentec.adf.util.FileUtil;
import jp.agentec.adf.util.StringUtil; import jp.agentec.adf.util.StringUtil;
import static jp.agentec.abook.abv.bl.common.Constant.ReportType.RoutineTask;
public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
protected static GroupLogic groupLogic = AbstractLogic.getLogic(GroupLogic.class); protected static GroupLogic groupLogic = AbstractLogic.getLogic(GroupLogic.class);
...@@ -941,7 +943,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -941,7 +943,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
int taskReportId = 0; int taskReportId = 0;
String reportStartDate = ""; 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)); taskReportId = Integer.parseInt(abookCheckParam.get(ABookKeys.TASK_REPORT_ID));
reportStartDate = abookCheckParam.get(ABookKeys.REPORT_START_DATE); reportStartDate = abookCheckParam.get(ABookKeys.REPORT_START_DATE);
} }
...@@ -963,9 +965,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -963,9 +965,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
try { try {
if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT)) { if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT)) {
// リソースパターンの適用 // リソースパターンの適用
showProgressPopup(PatternStringUtil.patternToString(getApplicationContext(), runOnUiThread(new Runnable() {
R.string.file_initialization, @Override
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); 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)) { if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_DELETE_PROCESS)) {
...@@ -1012,13 +1019,21 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1012,13 +1019,21 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
@Override @Override
public Object callback(Object ret) { public Object callback(Object ret) {
final boolean isError = (boolean)ret; final boolean isError = (boolean)ret;
closeProgressPopup(); closeProgressPopup();
syncOperation(mOperationId, mReportType, false); //キー項目あり設定時、送信後、同期処理
try { if (mOperationType == OperationType.LIST) { //リスト作業のみ実行
mOperationLogic.createJsonForOperationContent(mOperationId, mContentPath, false); if (mReportType != RoutineTask) { //定期点検以外
} catch (IOException e) { 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)) { if (mCmd.equals(ABookKeys.CMD_CHANGE_TASK_REPORT) || mCmd.equals(ABookKeys.CMD_DELETE_PROCESS)) {
afterABookCheckApi(mCmd, mTaskKey, 0, "", null, isOperationPdf()); afterABookCheckApi(mCmd, mTaskKey, 0, "", null, isOperationPdf());
......
...@@ -5,6 +5,7 @@ public interface AppDefType { ...@@ -5,6 +5,7 @@ public interface AppDefType {
interface PrefName { interface PrefName {
String USER_PREFERENCE = "user_info"; String USER_PREFERENCE = "user_info";
String AGREE_STATUS = "agree_status";
} }
interface ViewMode{ interface ViewMode{
......
...@@ -26,7 +26,7 @@ public enum ErrorCode { ...@@ -26,7 +26,7 @@ public enum ErrorCode {
E111(R.string.E111), E111(R.string.E111),
E112(R.string.E112), E112(R.string.E112),
E129(R.string.E129), E129(R.string.E129),
E132(R.string.E132),
L001(R.string.L001), L001(R.string.L001),
L002(R.string.L002), L002(R.string.L002),
L003(R.string.L003), L003(R.string.L003),
......
...@@ -139,7 +139,12 @@ public class Initializer { ...@@ -139,7 +139,12 @@ public class Initializer {
} }
env.aspectType = getAspectType(); env.aspectType = getAspectType();
// privacy policy url
env.privacyPolicyUrl = s(R.string.privacy_policy_url);
env.setInitialized(true); env.setInitialized(true);
// 利用規約に同意するの詳細があるURL
env.agreeToTermsOfUseUrl = s(R.string.agree_to_terms_of_use_url);
// Helperクラス初期化 // Helperクラス初期化
ActivityHandlingHelper.getInstance().init(context); ActivityHandlingHelper.getInstance().init(context);
......
...@@ -85,7 +85,8 @@ public class ABookSettingFragment extends PreferenceFragment { ...@@ -85,7 +85,8 @@ public class ABookSettingFragment extends PreferenceFragment {
private static final String CHECK_APP_UPDATE = "checkAppUpdate"; private static final String CHECK_APP_UPDATE = "checkAppUpdate";
private static final String ABOUT_A_BOOK = "aboutABook"; private static final String ABOUT_A_BOOK = "aboutABook";
private static final String ABOOK_CHECK_MANUAL = "abookCheckManual"; private static final String ABOOK_CHECK_MANUAL = "abookCheckManual";
private static final String PRIVACY_POLICY = "privacyPolicy";
protected Handler handler = new Handler(); protected Handler handler = new Handler();
protected AlertDialog alertDialog = null; protected AlertDialog alertDialog = null;
private SharedPreferences pref; private SharedPreferences pref;
...@@ -250,6 +251,17 @@ public class ABookSettingFragment extends PreferenceFragment { ...@@ -250,6 +251,17 @@ public class ABookSettingFragment extends PreferenceFragment {
} }
}); });
// プライバシーポリシー
Preference privacyPolicy = findPreference(PRIVACY_POLICY);
privacyPolicy.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(ABVEnvironment.getInstance().privacyPolicyUrl));
startActivity(browserIntent);
return true;
}
});
// アップデート確認 // アップデート確認
Preference checkAppUpdate = findPreference(CHECK_APP_UPDATE); Preference checkAppUpdate = findPreference(CHECK_APP_UPDATE);
if (getResources().getInteger(R.integer.check_app_update) == 1) { if (getResources().getInteger(R.integer.check_app_update) == 1) {
......
...@@ -14,6 +14,8 @@ import android.view.animation.Animation; ...@@ -14,6 +14,8 @@ import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener; import android.view.animation.Animation.AnimationListener;
import android.view.animation.TranslateAnimation; import android.view.animation.TranslateAnimation;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.TextView; import android.widget.TextView;
...@@ -53,6 +55,7 @@ import jp.agentec.abook.abv.cl.environment.DeviceInfo; ...@@ -53,6 +55,7 @@ import jp.agentec.abook.abv.cl.environment.DeviceInfo;
import jp.agentec.abook.abv.cl.util.PreferenceUtil; import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ABVLoginActivity; import jp.agentec.abook.abv.ui.common.activity.ABVLoginActivity;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.UserPrefKey; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.UserPrefKey;
import jp.agentec.abook.abv.ui.common.constant.ErrorCode; import jp.agentec.abook.abv.ui.common.constant.ErrorCode;
import jp.agentec.abook.abv.ui.common.constant.ErrorMessage; import jp.agentec.abook.abv.ui.common.constant.ErrorMessage;
...@@ -94,6 +97,9 @@ public class LoginActivity extends ABVLoginActivity { ...@@ -94,6 +97,9 @@ public class LoginActivity extends ABVLoginActivity {
private InputMethodManager imm; private InputMethodManager imm;
// private CheckBox chexBoxAgree;
// private static String termsOfUseUrl = ABVEnvironment.getInstance().agreeToTermsOfUseUrl;
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
Logger.i(TAG, "onCreate"); Logger.i(TAG, "onCreate");
...@@ -148,13 +154,36 @@ public class LoginActivity extends ABVLoginActivity { ...@@ -148,13 +154,36 @@ public class LoginActivity extends ABVLoginActivity {
} }
}); });
findViewById(R.id.btn_login).setOnClickListener(new View.OnClickListener() {
// ログインボタン
final Button btnLogin = findViewById(R.id.btn_login);
btnLogin.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
tryLogin(); tryLogin();
} }
}); });
// // チェックボックス
// chexBoxAgree = findViewById(R.id.check_box_agree);
// // 初期化(状態は保存しておく。ログアウトした後に使う)
// boolean agree = PreferenceUtil.get(LoginActivity.this, AppDefType.PrefName.AGREE_STATUS, false);
// chexBoxAgree.setChecked(agree);
//
// chexBoxAgree.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// PreferenceUtil.put(LoginActivity.this, AppDefType.PrefName.AGREE_STATUS, chexBoxAgree.isChecked());
// }
// });
//
// // agreementUrl が 空の場合は、チェックボックスなどを消す
// if (StringUtil.isNullOrEmpty(termsOfUseUrl)) {
// chexBoxAgree.setVisibility(View.GONE);
// findViewById(R.id.terms_of_use_text).setVisibility(View.GONE);
// findViewById(R.id.detail).setVisibility(View.GONE);
// }
//androidバジョン6以上からMAC idではなくandroid固有numberを取得ため、ダイアログで表示 //androidバジョン6以上からMAC idではなくandroid固有numberを取得ため、ダイアログで表示
if (android.os.Build.VERSION.SDK_INT >= 23) { if (android.os.Build.VERSION.SDK_INT >= 23) {
mBtnDeviceInfo.setVisibility(View.VISIBLE); mBtnDeviceInfo.setVisibility(View.VISIBLE);
...@@ -193,6 +222,51 @@ public class LoginActivity extends ABVLoginActivity { ...@@ -193,6 +222,51 @@ public class LoginActivity extends ABVLoginActivity {
ErrorMessage.showErrorMessageDialog(this, R.string.app_name, ErrorCode.L110); ErrorMessage.showErrorMessageDialog(this, R.string.app_name, ErrorCode.L110);
} }
} }
// // 詳細ボタン
// final Button btnDetail = findViewById(R.id.detail);
// btnDetail.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// btnDetail.setEnabled(false); // 非活性化(連打防止)
// // ネットワーク接続チェック
// if (!ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) {
// AlertDialogUtil.showAlertDialog(LoginActivity.this, getString(R.string.error), getString(R.string.msg_network_offline), true, new DialogInterface.OnClickListener() {
// @Override
// public void onClick(DialogInterface dialog, int which) {
// dialog.dismiss();
// btnDetail.setEnabled(true); // 活性化
// }
// });
// return;
// }
// CommonExecutor.execute(new Runnable() {
// @Override
// public void run() {
// // CMSより文言を取得し、ダイアログで表示する。
// final String termsOfUseText = contractLogic.getTermsOfServiceText(termsOfUseUrl);
// runOnUiThread(new Runnable() {
// @Override
// public void run() {
// String title = getString(R.string.error);
// String messageText = getString(R.string.err_gert_term_of_use_text);
// if (termsOfUseText != null) {
// title = getString(R.string.app_name);
// messageText = termsOfUseText;
// }
// AlertDialogUtil.showAlertDialog(LoginActivity.this, title, messageText, true, new DialogInterface.OnClickListener() {
// @Override
// public void onClick(DialogInterface dialog, int which) {
// dialog.dismiss();
// btnDetail.setEnabled(true); // 活性化
// }
// });
// }
// });
// }
// });
// }
// });
} }
@Override @Override
...@@ -362,6 +436,24 @@ public class LoginActivity extends ABVLoginActivity { ...@@ -362,6 +436,24 @@ public class LoginActivity extends ABVLoginActivity {
return false; return false;
} }
} }
// if (StringUtil.isNullOrWhiteSpace(mLoginId)) {
// handleErrorMessageToast(ErrorCode.E001);
// mEdtLoginId.requestFocus();
// return false;
// }
//
// if (StringUtil.isNullOrWhiteSpace(mPassword)) {
// handleErrorMessageToast(ErrorCode.E002);
// mEdtPassword.requestFocus();
// return false;
// }
//
// if (!StringUtil.isNullOrEmpty(termsOfUseUrl)) {
// if (!chexBoxAgree.isChecked()) {
// handleErrorMessageToast(ErrorCode.E132);
// return false;
// }
// }
return true; return true;
} }
...@@ -666,6 +758,10 @@ public class LoginActivity extends ABVLoginActivity { ...@@ -666,6 +758,10 @@ public class LoginActivity extends ABVLoginActivity {
PreferenceUtil.clearUserPref(this); PreferenceUtil.clearUserPref(this);
memberInfoDao.deleteMemberInfo(); memberInfoDao.deleteMemberInfo();
// // ユーザ変更でプリファレンスは初期化するが、
// // 一度ログインで利用規約には同意しているので、以下の値はtrueに設定しなおす
// PreferenceUtil.put(LoginActivity.this, AppDefType.PrefName.AGREE_STATUS, true);
//
contentLogic.deleteContentMarkingData(); contentLogic.deleteContentMarkingData();
boolean isAllDelete =true; boolean isAllDelete =true;
if (getRInteger(R.integer.not_delete_all_contents) == 1) { if (getRInteger(R.integer.not_delete_all_contents) == 1) {
......
...@@ -7,6 +7,8 @@ import android.content.Intent; ...@@ -7,6 +7,8 @@ import android.content.Intent;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.Gravity; import android.view.Gravity;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.View; import android.view.View;
...@@ -320,7 +322,13 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -320,7 +322,13 @@ public class OperationListActivity extends ABVUIActivity {
mCallBack = new Runnable() { mCallBack = new Runnable() {
@Override @Override
public void run() { public void run() {
openReportView(tempOperationDto); CommonExecutor.execute(new Runnable() {
@Override
public void run() {
openReportView(tempOperationDto);
}
});
} }
}; };
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
...@@ -598,6 +606,30 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -598,6 +606,30 @@ public class OperationListActivity extends ABVUIActivity {
} }
} }
}); });
} else {
//作業報告した後、戻った時に自動同期を開始
final OperationDto operationDto = mOperationLogic.getOperation(operationId);
if (operationDto != null && operationDto.needSyncFlg) {
if (ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) {
mCallBack = new Runnable() {
@Override
public void run() {
//同期終了後、新着更新
if (!contentRefresher.isRefreshing()) {
dateUpdate();
}
}
};
//すぐ同期処理を開始すると、プログレスバー表示されないため、0.5秒後に実行
handler.postDelayed(new Runnable() {
@Override
public void run() {
startSyncOperationStart(operationDto, false);
}
}, 500);
}
}
} }
if (!activityResultFlg && operationId == -1) { if (!activityResultFlg && operationId == -1) {
...@@ -770,7 +802,13 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -770,7 +802,13 @@ public class OperationListActivity extends ABVUIActivity {
return result; return result;
} }
public void startTaskDirectionOrReportView(OperationDto operationDto) { public void startTaskDirectionOrReportView(final OperationDto operationDto) {
runOnUiThread(new Runnable() {
@Override
public void run() {
showProgressPopup();
}
});
try { try {
ContentDto contentDto = contentDao.getContent(operationDto.contentId); ContentDto contentDto = contentDao.getContent(operationDto.contentId);
if (contentDto != null && contentDto.downloadedFlg) { if (contentDto != null && contentDto.downloadedFlg) {
...@@ -798,51 +836,60 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -798,51 +836,60 @@ public class OperationListActivity extends ABVUIActivity {
// 作業閲覧日付の更新 // 作業閲覧日付の更新
mOperationDao.updateReadingDate(operationDto.operationId); mOperationDao.updateReadingDate(operationDto.operationId);
final String _contentPath = contentPath;
runOnUiThread(new Runnable() {
// サーバ作業後、対応必要 @Override
StringBuffer path = new StringBuffer(); public void run() {
path.append(contentPath);
// #32926 作業報告画面改善 start
path.append("/index.html?app=android");
path.append("&report_type=" + operationDto.reportType); // 作業報告タイプ : 0:報告 1:定期点検 2:報告(回答)
path.append("&mobile_flg=" + (isNormalSize() ? "1" : "0")); // ScreenType
path.append("&operationId=" + operationDto.operationId);
path.append("&sid=" + ABVDataCache.getInstance().getMemberInfo().sid);
path.append("&quickReport=" + operationDto.quickReport);
path.append("&shopName=" + ABVDataCache.getInstance().getUrlPath());
path.append("&acmsAddress=" + ABVEnvironment.getInstance().acmsAddress);
if (mScanType != null) {
String scanTypeKey = null;
if (mScanType.equals(ABookKeys.SCAN_TYPE_VALUE.BARCODE)) {
scanTypeKey = ABookKeys.SCAN_TYPE_KEY.BARCODE;
} else if (mScanType.equals(ABookKeys.SCAN_TYPE_VALUE.RFID)) {
scanTypeKey = ABookKeys.SCAN_TYPE_KEY.RFID;
}
path.append("&scanType=" + scanTypeKey);
mScanType = null;
}
Logger.d(TAG, "path : " + path);
// #32926 作業報告画面改善 end
Intent intent = new Intent();
intent.putExtra(ABookKeys.CONTENT_ID, operationDto.contentId);
intent.putExtra(ABookKeys.OPERATION_ID, operationDto.operationId);
intent.putExtra(Constant.ABookCheck.XWALK_OPEN_TYPE, Constant.XWalkOpenType.TASK_REPORT);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(AppDefType.ChatPushMessageKey.baseActivityName, OperationListActivity.class.getName());
if(operationDto.operationType == OperationType.PDF) { // サーバ作業後、対応必要
intent.putExtra("LINKURL", "file://" + path); StringBuffer path = new StringBuffer();
ActivityHandlingHelper.getInstance().checkContentActivity(operationDto.contentId, 0, intent); path.append(_contentPath);
} else { // #32926 作業報告画面改善 start
intent.setClass(this, HTMLXWalkWebViewActivity.class); path.append("/index.html?app=android");
ActivityHandlingHelper.getInstance().startHTMLXWalkWebActivity(this, intent, "file://" + path, operationDto.contentId, -1, -1, -1, -1, -1); path.append("&report_type=" + operationDto.reportType); // 作業報告タイプ : 0:報告 1:定期点検 2:報告(回答)
} path.append("&mobile_flg=" + (isNormalSize() ? "1" : "0")); // ScreenType
path.append("&operationId=" + operationDto.operationId);
path.append("&sid=" + ABVDataCache.getInstance().getMemberInfo().sid);
path.append("&quickReport=" + operationDto.quickReport);
path.append("&shopName=" + ABVDataCache.getInstance().getUrlPath());
path.append("&acmsAddress=" + ABVEnvironment.getInstance().acmsAddress);
if (mScanType != null) {
String scanTypeKey = null;
if (mScanType.equals(ABookKeys.SCAN_TYPE_VALUE.BARCODE)) {
scanTypeKey = ABookKeys.SCAN_TYPE_KEY.BARCODE;
} else if (mScanType.equals(ABookKeys.SCAN_TYPE_VALUE.RFID)) {
scanTypeKey = ABookKeys.SCAN_TYPE_KEY.RFID;
}
path.append("&scanType=" + scanTypeKey);
mScanType = null;
}
Logger.d(TAG, "path : " + path);
// #32926 作業報告画面改善 end
Intent intent = new Intent();
intent.putExtra(ABookKeys.CONTENT_ID, operationDto.contentId);
intent.putExtra(ABookKeys.OPERATION_ID, operationDto.operationId);
intent.putExtra(Constant.ABookCheck.XWALK_OPEN_TYPE, Constant.XWalkOpenType.TASK_REPORT);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(AppDefType.ChatPushMessageKey.baseActivityName, OperationListActivity.class.getName());
if (operationDto.operationType == OperationType.PDF) {
intent.putExtra("LINKURL", "file://" + path);
ActivityHandlingHelper.getInstance().checkContentActivity(operationDto.contentId, 0, intent);
} else {
intent.setClass(OperationListActivity.this, HTMLXWalkWebViewActivity.class);
ActivityHandlingHelper.getInstance().startHTMLXWalkWebActivity(OperationListActivity.this, intent, "file://" + path, operationDto.contentId, -1, -1, -1, -1, -1);
}
}
});
} else { } else {
Logger.w(TAG, "content is not download"); Logger.w(TAG, "content is not download");
} }
} catch (Exception e) { } catch (Exception e) {
Logger.e(TAG, e); Logger.e(TAG, e);
handleErrorMessageToast(ErrorCode.E107); handleErrorMessageToast(ErrorCode.E107);
} finally {
closeProgressPopup();
} }
} }
...@@ -899,125 +946,11 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -899,125 +946,11 @@ public class OperationListActivity extends ABVUIActivity {
String errorMessage = syncOperation(operationId, operationReportType, buttonEventFlg); String errorMessage = syncOperation(operationId, operationReportType, buttonEventFlg);
if (errorMessage != null) { if (errorMessage != null) {
closeProgressPopup(); closeProgressPopup();
// エラーメッセージ表示 if (buttonEventFlg) {
showSimpleAlertDialog(getString(R.string.app_name), errorMessage); // エラーメッセージ表示
} showSimpleAlertDialog(getString(R.string.app_name), errorMessage);
}
/**
* 作業同期処理
* @param operationId
* @param reportType
* @param buttonEventFlag
* @return result errorMessage
*/
@Override
public String syncOperation(final long operationId, int reportType, boolean buttonEventFlag) {
final StringBuilder errorMsg = new StringBuilder();
try {
//コンテンツダウンロード関連プログレスバー値設定
progressDialogHorizontal.setProgress(20);
final Callback progressCallback = new Callback() {
@Override
public Object callback(Object ret) {
final int progress = (int)ret;
runOnUiThread(new Runnable() {
@Override
public void run() {
progressDialogHorizontal.setProgress(progressDialogHorizontal.getProgress() + progress);
}
});
return null;
}
};
// 報告送信
mOperationLogic.sendTaskReportSendData(operationId, progressCallback);
//工程全削除の送信(連続作業)
if (reportType == ReportType.ReportContinuous) {
if (!mOperationLogic.deleteProcess(operationId)) { //工程全削除送信失敗時
return PatternStringUtil.patternToString(getApplicationContext(),
R.string.msg_error_all_process_delete,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
}
}
progressDialogHorizontal.setProgress(60);
// 報告受信
mOperationLastEditDate = receptionTaskData(operationId, progressCallback, errorMsg);
//連続作業のみ承認データ取得
if (reportType == ReportType.ReportContinuous) {
mOperationLogic.getProcessData(operationId);
}
// mOperationLastEditDateがnullの場合、エラーと見做す
if (mOperationLastEditDate != null && reportType == ReportType.RoutineTask) {
if (buttonEventFlag) {
String dialogMsg = null;
// 定期点検の利用可能日付を取得
String avilableDateStr = mOperationLogic.getRoutineTaskOperationAvailableDateStr(operationId);
if (!StringUtil.isNullOrEmpty(avilableDateStr)) {
// 利用可能メッセージ
// リソースパターンの適用
dialogMsg = String.format(PatternStringUtil.patternToString(getApplicationContext(),
R.string.msg_routineTask_report_available_from,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), avilableDateStr);
} else if (!mTaskReportDao.existsToDoRoutineTaskReportData(operationId)) {
// 作業データが存在しないメッセージ
dialogMsg = PatternStringUtil.patternToString(getApplicationContext(),
R.string.msg_no_report_data,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
}
if (!StringUtil.isNullOrEmpty(dialogMsg)) {
errorMsg.append(dialogMsg);
}
}
putUserPref(String.format(AppDefType.UserPrefKey.SYNCED_OPERATION_ID, operationId), DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMdd_none));
} }
} catch (AcmsException e) {
//noinspection EnumSwitchStatementWhichMissesCases
switch (e.getCode()) {
case P_E_ACMS_P003:
// リソースパターンを適用
errorMsg.append(getString(PatternStringUtil.patternToInt(getApplicationContext(), R.string.P003, getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))));
break;
case P_E_ACMS_P004:
errorMsg.append(getString(PatternStringUtil.patternToInt(getApplicationContext(), R.string.P004, getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))));
break;
case P_E_ACMS_P005:
errorMsg.append(getString(PatternStringUtil.patternToInt(getApplicationContext(), R.string.P005, getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))));
break;
case P_E_ACMS_P006:
errorMsg.append(getString(PatternStringUtil.patternToInt(getApplicationContext(), R.string.P006, getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))));
break;
default:
Logger.e(TAG, "syncOperation", e);
errorMsg.append(ErrorMessage.getErrorMessage(this, ErrorMessage.getErrorCode(e)));
break;
}
mOperationLastEditDate = null;
} catch (Exception e) {
Logger.e(TAG, e);
errorMsg.append(ErrorMessage.getErrorMessage(this, ABVExceptionCode.C_E_SYSTEM_0001));
mOperationLastEditDate = null;
} finally {
handler.post(new Runnable() {
@Override
public void run() {
if (mOperationLastEditDate != null) {
mOperationLogic.finishedSyncOperation(operationId, mOperationLastEditDate);
progressDialogHorizontal.setProgress(100);
}
mOperationLastEditDate = null;
//screenRefresh();
closeProgressPopup();
}
});
Logger.i(TAG, "---sync end");
} }
return errorMsg.length() > 0 ? errorMsg.toString() : null;
} }
// 設定画面へ遷移 // 設定画面へ遷移
...@@ -1059,161 +992,9 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1059,161 +992,9 @@ public class OperationListActivity extends ABVUIActivity {
} }
/** /**
* 作業データ受信
* @param operationId
* @param progressCallback
* @return
* @throws NetworkDisconnectedException
* @throws ABVException
* @throws IOException
* @throws InterruptedException
* @throws NoSuchAlgorithmException
* @throws ZipException
*/
@Override
public Date receptionTaskData(long operationId, Callback progressCallback, StringBuilder errorMsg) 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);
List<TaskDto> localTaskList = mTaskDao.selectAllTaskByOperationId(operationId);
Date lastEditDate;
OperationDataJSON json = AcmsClient.getInstance(ABVDataCache.getInstance().getUrlPath(), ABVEnvironment.getInstance().networkAdapter).getOpereationData(param);
//プログレスを40%進行させるための計算
int progress = 0;
if (json.taskDtoList.size() != 0) {
progress = 40 / json.taskDtoList.size();
}
boolean isRoutineTask = operationDto.reportType == ReportType.RoutineTask;
for (TaskDto serverTaskDto : json.taskDtoList) {
List<TaskReportDto> localTaskReportList = mTaskReportDao.getTaskReportListByTaskKey(serverTaskDto.taskKey);
for (TaskReportDto localTaskReportDto : localTaskReportList) {
if (!isExistsTaskReportInList(serverTaskDto.taskReportDtoList, localTaskReportDto, isRoutineTask)) {
if (isRoutineTask) {
mOperationLogic.deleteRoutineTaskReport(operationId, operationContentDto.contentId, localTaskReportDto);
} else {
// taskDtoが存在するとtaskReportLevel 0 (作業報告)が存在しないことはないので、報告(回答)のみチェックして削除
if (localTaskReportDto.taskReportLevel != TaskReportLevel.ReportType) {
// 作業報告のディレクトリ削除
mOperationLogic.deleteTaskFileData(operationId, operationContentDto.contentId, serverTaskDto.taskKey, localTaskReportDto.taskReportLevel);
mTaskReportDao.delete(localTaskReportDto);
}
}
}
}
if (isExistsTaskInList(localTaskList, serverTaskDto)) {
// 作業の報告更新
mTaskDao.update(serverTaskDto);
localTaskList.remove(serverTaskDto);
} else {
// 作業の報告登録
mTaskDao.insert(serverTaskDto);
}
// サーバーからの情報で更新
for (TaskReportDto serverTaskReportDto : serverTaskDto.taskReportDtoList) {
String attachedFileName = serverTaskReportDto.attachedFileName;
TaskReportDto localTaskReportDto;
if (operationDto.reportType == ReportType.RoutineTask) {
localTaskReportDto = mTaskReportDao.getRoutineTaskReportUtc(serverTaskReportDto.taskKey, serverTaskReportDto.taskReportId, DateTimeUtil.toString(serverTaskReportDto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen));
} else {
localTaskReportDto = mTaskReportDao.selectByTaskKey(serverTaskReportDto.taskKey, serverTaskReportDto.taskReportLevel);
}
if (localTaskReportDto != null && localTaskReportDto.localSavedFlg) {
// 一時保存フラグがtrueで定期点検且つ点検後修正不可の場合、添付ファイル(作業報告のディレクトリ)を削除して、localSavedFlgをfalseに変更
if (operationDto.reportType == ReportType.RoutineTask && operationDto.enableReportUpdate == Constant.EnableReportUpdate.NO) {
// 作業報告のディレクトリ削除
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(operationContentDto.contentId, localTaskReportDto.taskKey));
FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, localTaskReportDto.taskKey, localTaskReportDto.taskReportId, DateTimeUtil.toString_yyyyMMddHHmmss_none(localTaskReportDto.reportStartDate)));
localTaskReportDto.localSavedFlg = false;
} else {
// 一時保存フラグがtureだと何もしない
continue;
}
}
if (operationDto.reportType == ReportType.RoutineTask) {
serverTaskReportDto.taskKey = serverTaskDto.taskKey;
// 添付ファイルが存在する場合、取得して解凍する。
try {
refreshRoutineTaskFile(operationId, operationContentDto.contentId, serverTaskDto.taskId, serverTaskDto.taskKey, serverTaskReportDto.taskReportId, serverTaskReportDto.taskReportInfoId, serverTaskReportDto.reportStartDate, attachedFileName);
} 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, 0))));
return null;
}
if (localTaskReportDto != null) {
// 報告データが存在すると作業報告を更新する
mOperationLogic.updateRoutineTaskReport(serverTaskDto.operationId, operationContentDto.contentId, serverTaskReportDto, false, false, localTaskReportDto.localSavedFlg);
} else {
mOperationLogic.insertRoutineTaskReport(serverTaskDto.operationId, operationContentDto.contentId, serverTaskReportDto, false, false);
}
} else {
JSONObject taskReportJson = null;
// 添付ファイルが存在する場合、取得して解凍する。
try {
refreshTaskFile(operationId, serverTaskReportDto.taskReportLevel, operationContentDto.contentId, serverTaskDto.taskId, serverTaskDto.taskKey, serverTaskReportDto.attachedFileName, serverTaskDto.processKey, serverTaskDto.phaseNo);
} 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, 0))));
return null;
}
if (!serverTaskReportDto.jsonData.isEmpty()) {
taskReportJson = new JSONObject(serverTaskReportDto.jsonData);
if (serverTaskReportDto.taskReportLevel == TaskReportLevel.ReportType) {
taskReportJson.put(ABookKeys.TASK_STATUS, serverTaskDto.taskStatus);
}
}
if (localTaskReportDto == null) {
// 登録
mOperationLogic.insertTaskReport(serverTaskDto.taskKey, operationId, operationContentDto.contentId,
serverTaskReportDto.taskReportLevel, serverTaskReportDto.enableReport,
taskReportJson, attachedFileName, false, false, false, serverTaskDto.processKey, serverTaskDto.phaseNo);
} else {
// 更新
// jsonDataが空で入る場合、taskReportJsonをnullで登録
mOperationLogic.updateTaskReport(serverTaskDto.taskKey, operationId, operationContentDto.contentId,
serverTaskReportDto.taskReportLevel, serverTaskReportDto.enableReport,
taskReportJson, attachedFileName, false, false, localTaskReportDto.localSavedFlg, serverTaskDto.processKey, serverTaskDto.phaseNo);
}
}
}
if (progressCallback != null) {
progressCallback.callback(new Integer(progress));
}
}
// サーバーから取得した作業情報がローカルに存在しないので削除する
for (TaskDto taskDto : localTaskList) {
mOperationLogic.deleteTaskFileData(operationId, operationContentDto.contentId, taskDto.taskKey, TaskReportLevel.ReportType);
mTaskDao.delete(taskDto);
}
lastEditDate = json.lastEditDate;
if (progressCallback != null) {
progressCallback.callback(new Integer(40));
}
return lastEditDate;
}
/**
* 360コンテンツ登録ダイアログ * 360コンテンツ登録ダイアログ
*/ */
public void showPanoEntryDialog(final OperationDto operationDto) { public void showPanoEntryDialog(final OperationDto operationDto) {
Logger.d(TAG, "*****************showPanoEntryDialog");
if (contentRefresher != null && contentRefresher.isRefreshing()) { if (contentRefresher != null && contentRefresher.isRefreshing()) {
// 新着更新処理が行っていれば、止める // 新着更新処理が行っていれば、止める
contentRefresher.stopRefresh(); contentRefresher.stopRefresh();
...@@ -1324,11 +1105,14 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1324,11 +1105,14 @@ public class OperationListActivity extends ABVUIActivity {
ABVToastUtil.showMakeText(this, R.string.msg_operation_enable_meeting_room_connected, Toast.LENGTH_SHORT); ABVToastUtil.showMakeText(this, R.string.msg_operation_enable_meeting_room_connected, Toast.LENGTH_SHORT);
return; return;
} }
startSyncOperationStart(operationDto, true);
}
public void startSyncOperationStart(final OperationDto operationDto, final boolean buttonEventFlg) {
// リソースパターンの適用 // リソースパターンの適用
showProgressView(PatternStringUtil.patternToString(getApplicationContext(), showProgressView(PatternStringUtil.patternToString(getApplicationContext(),
R.string.synchronizing, R.string.synchronizing,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
CommonExecutor.execute(new Runnable() { CommonExecutor.execute(new Runnable() {
@Override @Override
public void run() { public void run() {
...@@ -1353,7 +1137,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1353,7 +1137,7 @@ public class OperationListActivity extends ABVUIActivity {
closeProgressPopup(); closeProgressPopup();
} }
} else { } else {
singleSyncOperation(operationDto.operationId, operationDto.reportType, true); singleSyncOperation(operationDto.operationId, operationDto.reportType, buttonEventFlg);
} }
} }
}); });
......
...@@ -80,7 +80,7 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -80,7 +80,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
* @param finishCallback * @param finishCallback
* @param taskReportLevel * @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; int taskReportSendId = 0;
mFinishCallback = finishCallback; mFinishCallback = finishCallback;
...@@ -106,17 +106,25 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -106,17 +106,25 @@ public class ABookCheckWebViewHelper extends ABookHelper {
// その時に呼び出し元で表示したダイアログが閉じずに、操作不能となったので、 // その時に呼び出し元で表示したダイアログが閉じずに、操作不能となったので、
// mFinishCallBackに、エラーを通知しダイアログを閉じる処理を追加した。 // mFinishCallBackに、エラーを通知しダイアログを閉じる処理を追加した。
// TODO: 失敗するのであれば、データが壊れているわけなので、壊れたデータを削除する必要があるのでは? // TODO: 失敗するのであれば、データが壊れているわけなので、壊れたデータを削除する必要があるのでは?
try { final ABVContentViewActivity final_context = context;
insertOrUpdateTaskReport(taskKey, enableReportHistory, operationId, contentId, param, contentPath, reportType, taskReportLevel, false); final String final_processKey = processKey;
} catch (Exception e) { final Integer final_phaseNo = phaseNo;
context.showSimpleAlertDialog(R.string.error, R.string.ERROR); CommonExecutor.execute(new Runnable() {
Logger.e(TAG,e); @Override
mFinishCallback.callback(true); public void run() {
context.closeProgressPopup(); try {
throw e; insertOrUpdateTaskReport(taskKey, enableReportHistory, operationId, contentId, param, contentPath, reportType, taskReportLevel, false);
} copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel, final_processKey, final_phaseNo);
copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel, processKey, phaseNo); sendTaskData(final_context, operationId, taskKey, taskReportLevel, reportType, contentPath);
sendTaskData(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; break;
case ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT: // 一時保存 case ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT: // 一時保存
insertOrUpdateTaskReport(taskKey, enableReportHistory, operationId, contentId, param, contentPath, reportType, taskReportLevel, true); insertOrUpdateTaskReport(taskKey, enableReportHistory, operationId, contentId, param, contentPath, reportType, taskReportLevel, true);
...@@ -236,9 +244,14 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -236,9 +244,14 @@ public class ABookCheckWebViewHelper extends ABookHelper {
}; };
// リソースパターンの適用 // リソースパターンの適用
context.showProgressView(PatternStringUtil.patternToString(context, context.runOnUiThread(new Runnable() {
R.string.synchronizing, @Override
getUserPref(context, AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); public void run() {
context.showProgressView(PatternStringUtil.patternToString(context,
R.string.synchronizing,
getUserPref(context, AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
}
});
CommonExecutor.execute(new Runnable() { CommonExecutor.execute(new Runnable() {
@Override @Override
public void run() { public void run() {
......
...@@ -162,8 +162,6 @@ public class OzdFileHelper { ...@@ -162,8 +162,6 @@ public class OzdFileHelper {
public static final boolean moveTempOzdFileToOzdFile(long contentId, String taskKey, String tempOzFileName, String ozFileName) { public static final boolean moveTempOzdFileToOzdFile(long contentId, String taskKey, String tempOzFileName, String ozFileName) {
String tempOzdFilePath = ABVEnvironment.getInstance().getTempFilePath(contentId, taskKey, tempOzFileName); String tempOzdFilePath = ABVEnvironment.getInstance().getTempFilePath(contentId, taskKey, tempOzFileName);
String ozdFilePath = ABVEnvironment.getInstance().getTempFilePath(contentId, taskKey, ozFileName); String ozdFilePath = ABVEnvironment.getInstance().getTempFilePath(contentId, taskKey, ozFileName);
Logger.i("******** tempOzdFilePath = " + tempOzdFilePath);
Logger.i("******** ozdFilePath = " + ozdFilePath);
if (FileUtil.exists(ozdFilePath)) { if (FileUtil.exists(ozdFilePath)) {
FileUtil.delete(ozdFilePath); FileUtil.delete(ozdFilePath);
} }
......
package jp.agentec.abook.abv.ui.viewer.activity; package jp.agentec.abook.abv.ui.viewer.activity;
import android.app.AlertDialog;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
...@@ -179,13 +180,7 @@ public class CheckOZDViewActivity extends ABVContentViewActivity { ...@@ -179,13 +180,7 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
closeButton.setOnClickListener(new OnClickListener() { closeButton.setOnClickListener(new OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
mButtonStatus = R.id.btn_close; // HTML側の分岐処理を行うため変数に値を渡す showCancelConfirmAlert();
//#41596 OZの報告入力フォームで☓をタップした際の動作がおかしい
finishActivity();
doProcess(); // HTML側に閉じる処理を行う
// if (mProcessKey != null && mPhaseNo != 0) { //連続作業用のOZView画面非表示
// finishActivity();
// }
} }
}); });
...@@ -650,6 +645,20 @@ public class CheckOZDViewActivity extends ABVContentViewActivity { ...@@ -650,6 +645,20 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
return true; return true;
} }
/**
* 左上の×ボタンを押したときの処理(ダイアログを表示する)
*/
private void showCancelConfirmAlert() {
AlertDialogUtil.showAlertDialog(this, getString(R.string.confirm), getString(R.string.msg_oz_report_cancel), false, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mButtonStatus = R.id.btn_close;
finishActivity();
doProcess(); // HTML側に閉じる処理を行う
}
});
}
// アラート表示処理 // アラート表示処理
private void showSaveConfirmAlert(final int dialogTitle, int dialogMessage) { private void showSaveConfirmAlert(final int dialogTitle, int dialogMessage) {
ABookAlertDialog logoutAkert = AlertDialogUtil.createAlertDialog(this, dialogTitle); ABookAlertDialog logoutAkert = AlertDialogUtil.createAlertDialog(this, dialogTitle);
......
...@@ -38,8 +38,8 @@ app_versioncode=1 ...@@ -38,8 +38,8 @@ app_versioncode=1
# abvEnvironments.xml # abvEnvironments.xml
#cms server #cms server
acms_address=https://check130.agentec.jp/acms acms_address=https://chatdev2.agentec.jp/acms
download_server_address=https://check130.agentec.jp/acms download_server_address=https://chatdev2.agentec.jp/acms
#syncview server #syncview server
websocket_server_http_url=https://check130.agentec.jp/v1 websocket_server_http_url=https://check130.agentec.jp/v1
...@@ -86,8 +86,8 @@ is_check_invalid_passward_limit=true ...@@ -86,8 +86,8 @@ is_check_invalid_passward_limit=true
repeat_default=true repeat_default=true
#Setting Info(設定画面のABookについての設定情報) #Setting Info(設定画面のABookについての設定情報)
version_name=1.4.202 version_name=1.4.210
release_date=2021/11/24 release_date=2022/06/14
copy_right=2016 AGENTEC Co.,Ltd. All rights reserved. copy_right=2016 AGENTEC Co.,Ltd. All rights reserved.
hope_page=http://www.agentec.jp hope_page=http://www.agentec.jp
contact_email=abook-appsupport@agentec.jp contact_email=abook-appsupport@agentec.jp
...@@ -132,4 +132,10 @@ isStoreProduct=false ...@@ -132,4 +132,10 @@ isStoreProduct=false
#1.2.302 Edition #1.2.302 Edition
#CHECK = 5 #CHECK = 5
#EXFRAME = 6 #EXFRAME = 6
edition_type=5 edition_type=5
\ No newline at end of file
#プライバシーポリシーURL
privacy_policy_url=https://www.agentec.jp/privacy/
#利用規約に同意するのテキストがあるURL
agree_to_terms_of_use_url=https://chatdev2.agentec.jp/acms/common/getAgreement/
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