Commit ec42bc8b by Jeong Gilmo

Merge branch 'feature/1.0.1' into feature/1.0.1_33006

# Conflicts:
#	ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationListActivity.java
parents 2666dd82 fa601572
...@@ -24,7 +24,6 @@ import jp.agentec.abook.abv.bl.acms.client.json.LogSendFlagJSON; ...@@ -24,7 +24,6 @@ import jp.agentec.abook.abv.bl.acms.client.json.LogSendFlagJSON;
import jp.agentec.abook.abv.bl.acms.client.json.NewAppStoreLoginJSON; import jp.agentec.abook.abv.bl.acms.client.json.NewAppStoreLoginJSON;
import jp.agentec.abook.abv.bl.acms.client.json.RequirePasswordChangeJSON; import jp.agentec.abook.abv.bl.acms.client.json.RequirePasswordChangeJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ResultJSON; import jp.agentec.abook.abv.bl.acms.client.json.ResultJSON;
import jp.agentec.abook.abv.bl.acms.client.json.RoutineTaskDataJSON;
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.FixPushMessageJSON; import jp.agentec.abook.abv.bl.acms.client.json.FixPushMessageJSON;
...@@ -56,6 +55,7 @@ import jp.agentec.abook.abv.bl.acms.type.AcmsApis; ...@@ -56,6 +55,7 @@ import jp.agentec.abook.abv.bl.acms.type.AcmsApis;
import jp.agentec.abook.abv.bl.acms.type.LoginStatus; import jp.agentec.abook.abv.bl.acms.type.LoginStatus;
import jp.agentec.abook.abv.bl.acms.type.RequirePasswordChangeCode; import jp.agentec.abook.abv.bl.acms.type.RequirePasswordChangeCode;
import jp.agentec.abook.abv.bl.common.ABVEnvironment; import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.Constant.ExceptionDetailMessage; import jp.agentec.abook.abv.bl.common.Constant.ExceptionDetailMessage;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys; import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.ABVException; import jp.agentec.abook.abv.bl.common.exception.ABVException;
...@@ -73,13 +73,13 @@ import jp.agentec.abook.abv.bl.dto.ContentDto; ...@@ -73,13 +73,13 @@ import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.GroupDto; import jp.agentec.abook.abv.bl.dto.GroupDto;
import jp.agentec.abook.abv.bl.dto.MemberInfoDto; import jp.agentec.abook.abv.bl.dto.MemberInfoDto;
import jp.agentec.abook.abv.bl.dto.ServiceOptionDto; import jp.agentec.abook.abv.bl.dto.ServiceOptionDto;
import jp.agentec.abook.abv.bl.dto.TaskReportDto;
import jp.agentec.adf.net.http.HttpDownloadState; import jp.agentec.adf.net.http.HttpDownloadState;
import jp.agentec.adf.net.http.HttpFileDownloader; import jp.agentec.adf.net.http.HttpFileDownloader;
import jp.agentec.adf.net.http.HttpMultipart; import jp.agentec.adf.net.http.HttpMultipart;
import jp.agentec.adf.net.http.HttpParameterObject; import jp.agentec.adf.net.http.HttpParameterObject;
import jp.agentec.adf.net.http.HttpRequestSender; import jp.agentec.adf.net.http.HttpRequestSender;
import jp.agentec.adf.net.http.HttpResponse; import jp.agentec.adf.net.http.HttpResponse;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil; import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.StringUtil; import jp.agentec.adf.util.StringUtil;
...@@ -505,29 +505,27 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -505,29 +505,27 @@ public class AcmsClient implements AcmsClientResponseListener {
} }
//作業者グループ取得 //作業者グループ取得
public WorkerGroupJSON getWorkerGroupList(AcmsParameters param) throws NetworkDisconnectedException, AcmsException { public WorkerGroupJSON getWorkingGroupList(AcmsParameters param) throws NetworkDisconnectedException, AcmsException {
HttpResponse response = send(AcmsApis.ApiWorkerGroupList, param); HttpResponse response = send(AcmsApis.ApiWorkingGroupList, param);
WorkerGroupJSON json = new WorkerGroupJSON(response.httpResponseBody); WorkerGroupJSON json = new WorkerGroupJSON(response.httpResponseBody);
return json; return json;
} }
/** /**
* 作業データ送信 * 作業報告データ送信
* @param sid * @param sid
* @param operationId * @param operationId
* @param taskKey * @param taskReportDto
* @param delFlag
* @param taskType
* @param taskHotspotInfo
* @param taskReportInfo
* @param formFile * @param formFile
* @param taskReportSendSaveDate
* @param reportType
* @return * @return
* @throws AcmsException * @throws ABVException
* @throws NetworkDisconnectedException * @throws NetworkDisconnectedException
* @throws IOException * @throws IOException
*/ */
public AcmsMessageJSON sendTaskData(String sid, String operationId, String taskKey, String delFlag, String taskType, String taskHotspotInfo, String taskReportInfo, File formFile, boolean attachedFileSendFlg, Date taskReportSendSaveDate) throws ABVException, NetworkDisconnectedException, IOException { public AcmsMessageJSON sendTaskData(String sid, Long operationId, TaskReportDto taskReportDto, File formFile, Date taskReportSendSaveDate, int reportType) throws ABVException, NetworkDisconnectedException, IOException {
if (networkAdapter != null && !networkAdapter.isNetworkConnected()) { // NWのチェック if (networkAdapter != null && !networkAdapter.isNetworkConnected()) { // NWのチェック
throw new NetworkDisconnectedException(); throw new NetworkDisconnectedException();
} }
...@@ -535,39 +533,48 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -535,39 +533,48 @@ public class AcmsClient implements AcmsClientResponseListener {
String apiUrl = AcmsApis.getApiUrl(env.acmsAddress, urlPath, AcmsApis.ApiSendTaskData); String apiUrl = AcmsApis.getApiUrl(env.acmsAddress, urlPath, AcmsApis.ApiSendTaskData);
List<HttpMultipart> HttpMultipartList = new ArrayList<HttpMultipart>(); List<HttpMultipart> HttpMultipartList = new ArrayList<HttpMultipart>();
HttpMultipartList.add(new HttpMultipart(ABookKeys.SID, sid)); HttpMultipartList.add(new HttpMultipart(ABookKeys.SID, sid));
HttpMultipartList.add(new HttpMultipart(ABookKeys.OPERATION_ID, operationId)); HttpMultipartList.add(new HttpMultipart(ABookKeys.OPERATION_ID, StringUtil.toString(operationId)));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_KEY, taskKey)); HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_KEY, taskReportDto.taskKey));
HttpMultipartList.add(new HttpMultipart(ABookKeys.DEL_FLAG, delFlag)); HttpMultipartList.add(new HttpMultipart(ABookKeys.DEL_FLAG, taskReportDto.delFlg ? "1" : "0"));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_TYPE, taskType)); HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_LEVEL, StringUtil.toString(taskReportDto.taskReportLevel)));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_HOT_SPOT_INFO, taskHotspotInfo)); HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_HOT_SPOT_INFO, taskReportDto.taskHotSpotInfo));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_INFO, taskReportInfo)); HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_INFO, taskReportDto.jsonData));
HttpMultipartList.add(new HttpMultipart(ABookKeys.ATTACHED_CHANGE_FLAG, attachedFileSendFlg ? "1" : "0")); HttpMultipartList.add(new HttpMultipart(ABookKeys.ATTACHED_CHANGE_FLAG, taskReportDto.attachedFileSendFlg ? "1" : "0"));
HttpMultipartList.add(new HttpMultipart(ABookKeys.ROUTINE_TASK_FLAG, reportType == Constant.ReportType.Routine ? "1" : "0"));
// 定期点検用
if (reportType == Constant.ReportType.Routine) {
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_ID, StringUtil.toString(taskReportDto.taskReportId)));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_INFO_ID, StringUtil.toString(taskReportDto.taskReportInfoId)));
HttpMultipartList.add(new HttpMultipart(ABookKeys.REPORT_START_DATE, DateTimeUtil.toStringForCmsGMT(taskReportDto.reportStartDate)));
}
if (formFile != null) { if (formFile != null) {
HttpMultipartList.add(new HttpMultipart(ABookKeys.FORM_FILE, formFile)); HttpMultipartList.add(new HttpMultipart(ABookKeys.FORM_FILE, formFile));
} }
if (taskReportSendSaveDate != null) { if (taskReportSendSaveDate != null) {
String sendDate = DateTimeUtil.toStringInTimeZone(taskReportSendSaveDate, DateTimeFormat.yyyyMMddHHmmss_hyphen, "GMT") + ",GMT"; HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_SAVE_DATE, DateTimeUtil.toStringForCmsGMT(taskReportSendSaveDate)));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_SAVE_DATE, sendDate)); }
}
result = HttpRequestSender.post(apiUrl, HttpMultipartList.toArray(new HttpMultipart[HttpMultipartList.size()])); result = HttpRequestSender.post(apiUrl, HttpMultipartList.toArray(new HttpMultipart[HttpMultipartList.size()]));
Logger.d(TAG, "[sendTaskData]: operationId=%s, taskKey=%s, delFlag=%s, task_type=%s, taskHopspotInfo=%s, taskReportInfo=%s, attachedFileSendFlg=%s", operationId, taskKey, delFlag, taskType, taskHotspotInfo, taskReportInfo, attachedFileSendFlg);
AcmsMessageJSON json = new AcmsMessageJSON(result.httpResponseBody); AcmsMessageJSON json = new AcmsMessageJSON(result.httpResponseBody);
Logger.d(TAG, "sendTaskData res: %s", json); Logger.d(TAG, "sendTaskData res: %s", json);
if (json.errorMessage != null) { if (json.errorMessage != null) {
if (json.errorMessage[0].equals("P003")) { if (json.errorMessage[0].equals("P003")) {
throw new ABVException(ABVExceptionCode.P_E_ACMS_P003); throw new ABVException(ABVExceptionCode.P_E_ACMS_P003);
} else if (json.errorMessage[0].equals("P004")) { } else if (json.errorMessage[0].equals("P004")) {
throw new ABVException(ABVExceptionCode.P_E_ACMS_P004); throw new ABVException(ABVExceptionCode.P_E_ACMS_P004);
} else if (json.errorMessage[0].equals("P005")) {
throw new ABVException(ABVExceptionCode.P_E_ACMS_P005);
} }
} }
if (json.httpStatus != 200) { if (json.httpStatus != 200) {
throw new AcmsException(ABVExceptionCode.S_E_ACMS_0001, json); throw new AcmsException(ABVExceptionCode.S_E_ACMS_0001, json);
} }
return json; return json;
} }
...@@ -645,19 +652,6 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -645,19 +652,6 @@ public class AcmsClient implements AcmsClientResponseListener {
return json; return json;
} }
/**
* プロジェクトの定期点検データ取得
* @param param
* @return
* @throws NetworkDisconnectedException
* @throws AcmsException
*/
public RoutineTaskDataJSON getRoutineTaskData(GetOperationDataParameters param) throws NetworkDisconnectedException, AcmsException {
HttpResponse response = send(AcmsApis.ApiGetRoutineTaskData, param);
RoutineTaskDataJSON json = new RoutineTaskDataJSON(response.httpResponseBody);
return json;
}
/** /**
* 作業データファイルの取得 * 作業データファイルの取得
* @param param * @param param
...@@ -836,7 +830,7 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -836,7 +830,7 @@ public class AcmsClient implements AcmsClientResponseListener {
HttpTaskWorker<HttpParameterObject> httpTaskThread = new HttpTaskWorker<HttpParameterObject>(methodName, apiUrl, param); HttpTaskWorker<HttpParameterObject> httpTaskThread = new HttpTaskWorker<HttpParameterObject>(methodName, apiUrl, param);
try{ try {
httpTaskThread.start(); httpTaskThread.start();
httpTaskThread.join(HttpRequestSender.DefaultConnectionTimeout); httpTaskThread.join(HttpRequestSender.DefaultConnectionTimeout);
} catch (Exception e) { } catch (Exception e) {
......
...@@ -7,9 +7,7 @@ import java.util.ArrayList; ...@@ -7,9 +7,7 @@ import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import jp.agentec.abook.abv.bl.acms.client.json.AcmsCommonJSON;
import jp.agentec.abook.abv.bl.common.exception.AcmsException; import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.dto.TaskDirectionsDto;
import jp.agentec.abook.abv.bl.dto.TaskDto; import jp.agentec.abook.abv.bl.dto.TaskDto;
import jp.agentec.abook.abv.bl.dto.TaskReportDto; import jp.agentec.abook.abv.bl.dto.TaskReportDto;
import jp.agentec.adf.util.DateTimeFormat; import jp.agentec.adf.util.DateTimeFormat;
...@@ -20,35 +18,30 @@ import jp.agentec.adf.util.DateTimeUtil; ...@@ -20,35 +18,30 @@ import jp.agentec.adf.util.DateTimeUtil;
*/ */
public class OperationDataJSON extends AcmsCommonJSON { public class OperationDataJSON extends AcmsCommonJSON {
public static final String OperationLastEditDate = "projectLastEditDate"; public static final String OperationLastEditDate = "operationLastEditDate";
public static final String TaskList = "taskList"; public static final String TaskList = "taskList";
public static final String OperationId = "projectId"; public static final String OperationId = "operationId";
public static final String TaskId = "taskId"; public static final String TaskId = "taskId";
public static final String TaskKey = "taskKey"; public static final String TaskKey = "taskKey";
public static final String TaskCode = "taskCode"; public static final String TaskCode = "taskCode";
public static final String TaskStatus = "taskStatus"; public static final String TaskStatus = "taskStatus";
public static final String TaskHotspotInfo = "taskHotspotInfo"; public static final String TaskHotspotInfo = "taskHotspotInfo";
// #32782 指示者テーブル関連削除 start
// TODO change&delete TaskDirections
// public static final String TaskDirectionsInfo = "taskReportInfo";
public static final String TaskDirectionsInfo = "taskDirectionsInfo";
// #32782 指示者テーブル関連削除 end
public static final String TaskReportInfo = "taskReportInfo";
// #32782 指示者テーブル関連削除 start
// TODO change&Delete TaskDirections
// public static final String TaskDirectionsKey = "taskReportKey";
public static final String TaskDirectionsKey = "taskDirectionsKey";
// #32782 指示者テーブル関連削除 end
public static final String TaskReportKey = "taskReportKey";
public static final String Task = "task"; public static final String Task = "task";
// 1.0.1で追加
public static final String TaskReportId = "taskReportId"; // 作業報告書ID ※定期点検のみ
public static final String TaskReportList = "taskReportList"; // 作業報告詳細リスト
public static final String TaskReportLevel = "taskReportLevel"; // 作業報告階層
public static final String EnableReport = "enableReport"; // 報告可能区分
public static final String TaskReportInfoId = "taskReportInfoId"; // 作業報告書情報ID ※定期点検のみ
public static final String ReportStartDate = "reportStartDate"; // 点検開始日時   ※定期点検のみ
public static final String ReportEndDate = "reportEndDate"; // 点検終了日時   ※定期点検のみ
public static final String TaskReportKey = "taskReportKey"; // 作業報告キー
public static final String TaskReportInfo = "taskReportInfo"; // 作業報告データ
public List<TaskDto> taskDtoList; public List<TaskDto> taskDtoList;
public Date lastEditDate; public Date lastEditDate;
// #32926 作業報告画面改善 start
public static final String TaskReportLevel = "taskReportLevel";
// #32926 作業報告画面改善 end
public OperationDataJSON(String jsonString) throws AcmsException { public OperationDataJSON(String jsonString) throws AcmsException {
super(jsonString); super(jsonString);
} }
...@@ -62,12 +55,6 @@ public class OperationDataJSON extends AcmsCommonJSON { ...@@ -62,12 +55,6 @@ public class OperationDataJSON extends AcmsCommonJSON {
for (int i = 0; i < taskList.length(); i++) { for (int i = 0; i < taskList.length(); i++) {
JSONObject taskJson = taskList.getJSONObject(i); JSONObject taskJson = taskList.getJSONObject(i);
TaskDto dto = new TaskDto(); TaskDto dto = new TaskDto();
// #32782 指示者テーブル関連削除 start
// TODO change
// dto.taskDirectionsDto = new TaskReportDto();
dto.taskDirectionsDto = new TaskDirectionsDto();
// #32782 指示者テーブル関連削除 end
dto.taskReportDto = new TaskReportDto();
dto.operationId = taskJson.getLong(OperationId); dto.operationId = taskJson.getLong(OperationId);
dto.taskId = taskJson.getLong(TaskId); dto.taskId = taskJson.getLong(TaskId);
...@@ -76,25 +63,43 @@ public class OperationDataJSON extends AcmsCommonJSON { ...@@ -76,25 +63,43 @@ public class OperationDataJSON extends AcmsCommonJSON {
dto.taskStatus = taskJson.getInt(TaskStatus); dto.taskStatus = taskJson.getInt(TaskStatus);
dto.taskHotSpotInfo = taskJson.getJSONObject(TaskHotspotInfo).toString(); dto.taskHotSpotInfo = taskJson.getJSONObject(TaskHotspotInfo).toString();
if(taskJson.has(TaskDirectionsInfo)) {
dto.taskDirectionsDto.jsonData = taskJson.getJSONObject(TaskDirectionsInfo).toString();
}
if(taskJson.has(TaskDirectionsKey)) {
dto.taskDirectionsDto.attachedFileName = taskJson.getString(TaskDirectionsKey);
}
if (taskJson.has(TaskReportInfo)) { // 作業報告詳細リスト
Object object = taskJson.get(TaskReportInfo); JSONArray taskReportList = taskJson.getJSONArray(TaskReportList);
if (object instanceof String) { dto.taskReportDtoList = new ArrayList<TaskReportDto>();
dto.taskReportDto.jsonData = null; for (int j = 0; j < taskReportList.length(); j++) {
} else {
dto.taskReportDto.jsonData = taskJson.getJSONObject(TaskReportInfo).toString(); TaskReportDto taskReportDto = new TaskReportDto();
JSONObject taskReportJson = taskReportList.getJSONObject(j);
taskReportDto.taskKey = dto.taskKey;
taskReportDto.taskReportLevel = taskReportJson.getInt(TaskReportLevel);
taskReportDto.enableReport = taskReportJson.getInt(EnableReport);
if (taskReportJson.has(TaskReportInfoId)) {
// 定期点検の場合
taskReportDto.taskReportInfoId = taskReportJson.getInt(TaskReportInfoId);
}
if (taskReportJson.has(ReportStartDate)) {
taskReportDto.reportStartDate = DateTimeUtil.toDate(taskReportJson.getString(ReportStartDate), DateTimeFormat.yyyyMMddHHmmss_hyphen);
}
if (taskReportJson.has(ReportEndDate)) {
taskReportDto.reportEndDate = DateTimeUtil.toDate(taskReportJson.getString(ReportEndDate), DateTimeFormat.yyyyMMddHHmmss_hyphen);
} }
}
if (taskJson.has(TaskReportKey)) {
dto.taskReportDto.attachedFileName = taskJson.getString(TaskReportKey);
}
if (taskReportJson.has(TaskReportKey)) {
taskReportDto.attachedFileName = taskReportJson.getString(TaskReportKey);
}
if (taskReportJson.has(TaskReportInfo)) {
Object object = taskReportJson.get(TaskReportInfo);
if (object instanceof String) {
taskReportDto.jsonData = null;
} else {
taskReportDto.jsonData = taskReportJson.getJSONObject(TaskReportInfo).toString();
}
}
dto.taskReportDtoList.add(taskReportDto);
}
taskDtoList.add(dto); taskDtoList.add(dto);
} }
} }
......
...@@ -6,11 +6,11 @@ import org.json.adf.JSONObject; ...@@ -6,11 +6,11 @@ import org.json.adf.JSONObject;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import jp.agentec.abook.abv.bl.acms.client.json.AcmsCommonJSON;
import jp.agentec.abook.abv.bl.common.exception.AcmsException; import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.dto.OperationContentDto; import jp.agentec.abook.abv.bl.dto.OperationContentDto;
import jp.agentec.abook.abv.bl.dto.OperationDto; import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.PushMessageDto; import jp.agentec.abook.abv.bl.dto.PushMessageDto;
import jp.agentec.abook.abv.bl.dto.TaskWorkerGroupDto;
import jp.agentec.adf.util.DateTimeFormat; import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil; import jp.agentec.adf.util.DateTimeUtil;
...@@ -20,33 +20,39 @@ import jp.agentec.adf.util.DateTimeUtil; ...@@ -20,33 +20,39 @@ import jp.agentec.adf.util.DateTimeUtil;
public class OperationListJSON extends AcmsCommonJSON { public class OperationListJSON extends AcmsCommonJSON {
// TODO public static final String OperationList = "operationList";
// サーバ作業後、対応必要「project」→「operation」 public static final String OperationId = "operationId";
public static final String OperationList = "projectList"; public static final String OperationType = "operationType";
public static final String OperationId = "projectId"; public static final String ReportType = "reportType";
public static final String OperationName = "projectName"; public static final String OperationName = "operationName";
public static final String OperationDescriptions = "projectDescriptions"; public static final String OperationDescriptions = "operationDescriptions";
public static final String OperationStartDate = "projectStartDate"; public static final String OperationStartDate = "operationStartDate";
public static final String OperationEndDate = "projectEndDate"; public static final String OperationEndDate = "operationEndDate";
public static final String OperationType = "projectType"; public static final String OperationLastEditDate = "operationLastEditDate";
public static final String ReportUpdateType = "reportUpdateType";
public static final String OperationLastEditDate = "projectLastEditDate";
public static final String OperationStatus = "projectStatus";
public static final String DecisionStatus = "decisionStatus";
public static final String DecisionType = "decisionType";
public static final String ContentId = "contentId"; public static final String ContentId = "contentId";
//定期点検用
public static final String ReportCycle = "reportCycle";
public static final String EnableReportUpdate = "enableReportUpdate";
public static final String EnableReportHistory = "enableReportHistory";
// 作業編集可能区分
public static final String EnableReportEdit = "enableReportEdit";
// 作業担当グループリスト
public static final String WorkingGroupList = "workingGroupList";
public static final String ReportLevel = "reportLevel"; // 報告階層
public static final String GroupId = "groupId"; // グループID
public static final String GroupList = "groupList"; // グループリスト
public static final String RelatedContentList = "relatedContentList"; public static final String RelatedContentList = "relatedContentList";
public static final String PushMessageList = "pushMessageList"; public static final String PushMessageList = "pushMessageList";
public static final String PushMessageId = "pushMessageId"; public static final String PushMessageId = "pushMessageId";
public static final String PushSendLoginId = "pushSendLoginId"; public static final String PushSendLoginId = "pushSendLoginId";
public static final String PushSendDate = "pushSendDate"; public static final String PushSendDate = "pushSendDate";
public static final String PushMessage = "pushMessage";
//定期点検用 public static final String PushMessage = "pushMessage";
public static final String OperationReportType = "projectReportType";
public static final String ReportCycle = "reportCycle";
public static final String EnableReportUpdate = "enableReportUpdate";
public List<OperationDto> operationList; public List<OperationDto> operationList;
...@@ -64,21 +70,22 @@ public class OperationListJSON extends AcmsCommonJSON { ...@@ -64,21 +70,22 @@ public class OperationListJSON extends AcmsCommonJSON {
JSONObject operationJson = operations.getJSONObject(i); JSONObject operationJson = operations.getJSONObject(i);
OperationDto dto = new OperationDto(); OperationDto dto = new OperationDto();
dto.operationContentDtoList = new ArrayList<OperationContentDto>(); dto.operationContentDtoList = new ArrayList<OperationContentDto>();
dto.taskWorkerGroupDtoList = new ArrayList<TaskWorkerGroupDto>();
dto.operationId = operationJson.getLong(OperationId); dto.operationId = operationJson.getLong(OperationId);
dto.operationType = operationJson.getInt(OperationType);
dto.operationName = operationJson.getString(OperationName); dto.operationName = operationJson.getString(OperationName);
dto.operationDescriptions = operationJson.getString(OperationDescriptions); dto.operationDescriptions = operationJson.getString(OperationDescriptions);
dto.operationStartDate = DateTimeUtil.toDate(operationJson.getString(OperationStartDate), "UTC", DateTimeFormat.yyyyMMdd_hyphen); dto.operationStartDate = DateTimeUtil.toDate(operationJson.getString(OperationStartDate), "UTC", DateTimeFormat.yyyyMMdd_hyphen);
dto.operationEndDate = DateTimeUtil.toDate(operationJson.getString(OperationEndDate), "UTC", DateTimeFormat.yyyyMMdd_hyphen); dto.operationEndDate = DateTimeUtil.toDate(operationJson.getString(OperationEndDate), "UTC", DateTimeFormat.yyyyMMdd_hyphen);
dto.operationType = operationJson.getInt(OperationType); dto.reportType = operationJson.getInt(ReportType); // 作業報告タイプ
dto.reportUpdateType = operationJson.has(ReportUpdateType) ? operationJson.getInt(ReportUpdateType) : 0; dto.enableReportHistory = operationJson.getInt(EnableReportHistory); // 報告履歴管理
dto.enableReportEdit = operationJson.has(EnableReportEdit) ? operationJson.getInt(EnableReportEdit) : 0; // 作業編集区分
// 作業終了更新日
if (operationJson.has(OperationLastEditDate)) { if (operationJson.has(OperationLastEditDate)) {
dto.lastEditDate = DateTimeUtil.toDate(operationJson.getString(OperationLastEditDate), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen); dto.lastEditDate = DateTimeUtil.toDate(operationJson.getString(OperationLastEditDate), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
} }
if (operationJson.has(OperationReportType)) {
dto.operationReportType = operationJson.getInt(OperationReportType);
}
if (operationJson.has(ReportCycle)) { if (operationJson.has(ReportCycle)) {
dto.reportCycle = operationJson.getInt(ReportCycle); dto.reportCycle = operationJson.getInt(ReportCycle);
} }
...@@ -124,6 +131,26 @@ public class OperationListJSON extends AcmsCommonJSON { ...@@ -124,6 +131,26 @@ public class OperationListJSON extends AcmsCommonJSON {
dto.pushMessageList.add(pushMessageDto); dto.pushMessageList.add(pushMessageDto);
} }
} }
if (operationJson.has(WorkingGroupList)) {
JSONArray workingGroupJsonArray = operationJson.getJSONArray(WorkingGroupList);
for (int k = 0; k < workingGroupJsonArray.length(); k++) {
if (workingGroupJsonArray.getJSONObject(k).length() == 0) {
// リストの情報が空の場合、以下の処理を行わないようにする
break;
}
// 作業担当グループリストセット
TaskWorkerGroupDto taskWorkerGroupDto = new TaskWorkerGroupDto();
taskWorkerGroupDto.taskReportLevel = workingGroupJsonArray.getJSONObject(k).getInt(ReportLevel);
taskWorkerGroupDto.groupList = new ArrayList<Integer>();
JSONArray workingGroupListArray = workingGroupJsonArray.getJSONObject(k).getJSONArray(GroupList);
for (int j = 0; j < workingGroupListArray.length(); j++) {
taskWorkerGroupDto.groupList.add(workingGroupListArray.getJSONObject(j).getInt(GroupId));
}
dto.taskWorkerGroupDtoList.add(taskWorkerGroupDto);
}
}
operationList.add(dto); operationList.add(dto);
} }
} }
......
package jp.agentec.abook.abv.bl.acms.client.json;
import org.json.adf.JSONArray;
import org.json.adf.JSONObject;
import java.util.ArrayList;
import java.util.List;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.dto.RoutineTaskReportDto;
import jp.agentec.abook.abv.bl.dto.TaskDirectionsDto;
import jp.agentec.abook.abv.bl.dto.TaskDto;
import jp.agentec.abook.abv.bl.dto.TaskReportDto;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
/**
* Created by seo-y on 2018/12/19.
*/
public class RoutineTaskDataJSON extends OperationDataJSON {
public static final String TaskReportId = "taskReportId";
public static final String TaskReportInfoId = "taskReportInfoId";
public static final String ReportStartDate = "reportStartDate";
public static final String ReportEndDate = "reportEndDate";
public static final String TaskReportInfo = "taskReportInfo";
public static final String TaskReportKey = "taskReportKey";
public static final String ReportList = "reportList";
public List<RoutineTaskReportDto> reportDtoList;
public RoutineTaskDataJSON(String jsonString) throws AcmsException {
super(jsonString);
}
@Override
protected void parse(JSONObject json) {
lastEditDate = DateTimeUtil.toDate(json.getString(OperationLastEditDate), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
taskDtoList = new ArrayList<TaskDto>();
if (json.has(TaskList)) {
JSONArray taskList = json.getJSONArray(TaskList);
for (int i = 0; i < taskList.length(); i++) {
JSONObject taskJson = taskList.getJSONObject(i);
TaskDto dto = new TaskDto();
// #32782 指示者テーブル関連削除 start
// TODO change
// dto.taskDirectionsDto = new TaskReportDto();
dto.taskDirectionsDto = new TaskDirectionsDto();
// #32782 指示者テーブル関連削除 end
dto.taskReportDto = new TaskReportDto();
dto.operationId = taskJson.getLong(OperationId);
dto.taskId = taskJson.getLong(TaskId);
dto.taskKey = taskJson.getString(TaskKey);
dto.taskReportId = taskJson.getInt(TaskReportId);
if (taskJson.has(TaskHotspotInfo)) {
dto.taskHotSpotInfo = taskJson.getJSONObject(TaskHotspotInfo).toString();
} else {
dto.taskHotSpotInfo = "";
}
reportDtoList = new ArrayList<RoutineTaskReportDto>();
if (taskJson.has(ReportList)) {
JSONArray reportList = taskJson.getJSONArray(ReportList);
String taskReportInfoId;
for (int j = 0; j < reportList.length(); j++) {
JSONObject reportJson = reportList.getJSONObject(j);
RoutineTaskReportDto reportDto = new RoutineTaskReportDto();
reportDto.taskKey = dto.taskKey;
reportDto.taskReportId = dto.taskReportId;
reportDto.taskReportInfoId = reportJson.getInt(TaskReportInfoId);
reportDto.reportStartDate = DateTimeUtil.toDate(reportJson.getString(ReportStartDate), DateTimeFormat.yyyyMMddHHmmss_hyphen);
reportDto.reportEndDate = DateTimeUtil.toDate(reportJson.getString(ReportEndDate), DateTimeFormat.yyyyMMddHHmmss_hyphen);
if (reportJson.has(TaskReportInfo)) {
Object obj = reportJson.get(TaskReportInfo);
if (obj instanceof String) {
reportDto.jsonData = (String)obj;
} else if (obj instanceof JSONObject) {
reportDto.jsonData = ((JSONObject)obj).toString();
} else {
reportDto.jsonData = "";
}
} else {
reportDto.jsonData = "";
}
if (reportJson.has(TaskReportKey)) {
reportDto.attachedFileName = reportJson.getString(TaskReportKey);
}
reportDtoList.add(reportDto);
}
}
dto.RoutineTaskReportList = reportDtoList;
taskDtoList.add(dto);
}
}
}
}
...@@ -13,9 +13,7 @@ public class GetOperationDataParameters extends AcmsParameters { ...@@ -13,9 +13,7 @@ public class GetOperationDataParameters extends AcmsParameters {
this.operationId = operationId; this.operationId = operationId;
} }
// TODO public long getOperationId() {
// サーバ作業後、対応必要「project」→「operation」
public long getProjectId() {
return operationId; return operationId;
} }
......
...@@ -133,13 +133,13 @@ public class AcmsApis { ...@@ -133,13 +133,13 @@ public class AcmsApis {
// デバイストークン更新 // デバイストークン更新
public static final String ApiUrlUpdateDeviceToken = "updateDeviceToken"; public static final String ApiUrlUpdateDeviceToken = "updateDeviceToken";
// プロジェクト一覧取得 // プロジェクト一覧取得
public static final String ApiOperationList = "projectList"; public static final String ApiOperationList = "operationList";
// 作業者グループ取得 // 作業者グループ取得
public static final String ApiWorkerGroupList = "workerGroupList"; public static final String ApiWorkingGroupList = "workingGroupList";
// 作業データ送信 // 作業データ送信
public static final String ApiSendTaskData = "taskData"; public static final String ApiSendTaskData = "taskData";
// 作業データ取得 // 作業データ取得
public static final String ApiGetOperationData = "getProjectData"; public static final String ApiGetOperationData = "getOperationData";
// 定期点検データ取得 // 定期点検データ取得
public static final String ApiGetRoutineTaskData = "getProjectInspectData"; public static final String ApiGetRoutineTaskData = "getProjectInspectData";
// 作業ファイル取得 // 作業ファイル取得
...@@ -196,7 +196,7 @@ public class AcmsApis { ...@@ -196,7 +196,7 @@ public class AcmsApis {
if (methodName.equals(ApiUrlNewAppStoreLogin) || methodName.equals(ApiUrlAppStoreNewLogin) || methodName.equals(ApiUrlServerTime) || methodName.equals(ApiUrlServerTimeZone)) { if (methodName.equals(ApiUrlNewAppStoreLogin) || methodName.equals(ApiUrlAppStoreNewLogin) || methodName.equals(ApiUrlServerTime) || methodName.equals(ApiUrlServerTimeZone)) {
apiValue = Constant.ApiValue.nuapi; apiValue = Constant.ApiValue.nuapi;
} else if (methodName.equals(ApiOperationList) || methodName.equals(ApiWorkerGroupList) || methodName.equals(ApiSendTaskData) || methodName.equals(ApiGetOperationData) || } else if (methodName.equals(ApiOperationList) || methodName.equals(ApiWorkingGroupList) || methodName.equals(ApiSendTaskData) || methodName.equals(ApiGetOperationData) ||
methodName.equals(ApiGetTaskFile) || methodName.equals(ApiSceneEntry) || methodName.equals(ApiTaskContentEntry) || methodName.equals(ApiGetTaskFile) || methodName.equals(ApiSceneEntry) || methodName.equals(ApiTaskContentEntry) ||
methodName.equals(ApiSendPushMessage) || methodName.equals(ApiGetPushMessages) || methodName.equals(ApiGetRoutineTaskData) || methodName.equals(ApiSendRoutineTaskData)) { methodName.equals(ApiSendPushMessage) || methodName.equals(ApiGetPushMessages) || methodName.equals(ApiGetRoutineTaskData) || methodName.equals(ApiSendRoutineTaskData)) {
apiValue = Constant.ApiValue.checkapi; apiValue = Constant.ApiValue.checkapi;
......
...@@ -140,9 +140,9 @@ public class ABVEnvironment { ...@@ -140,9 +140,9 @@ public class ABVEnvironment {
public static final String SavedOzFileFormat = OperationDirectionOrReportDirFormat + TaskReportLevelDir + "/%s"; public static final String SavedOzFileFormat = OperationDirectionOrReportDirFormat + TaskReportLevelDir + "/%s";
public static final String RoutineTaskSavedOzFileFormat = OperationDirectionOrReportDirFormat + TaskReportLevelDir + "/%d/%s/%s"; public static final String RoutineTaskSavedOzFileFormat = OperationDirectionOrReportDirFormat + TaskReportLevelDir + "/%d/%s/%s";
public static final String OperationTaskKeyReportSendDirFormat = OperationTaskKeyDirFormat + TaskReportLevelDir + "/reportSend/%d"; public static final String OperationTaskKeyReportSendDirFormat = OperationTaskKeyDirFormat + TaskReportLevelDir + "/reportSend/%d";
public static final String OperationTaskKeyRoutineTaskReportSendDirFormat = OperationTaskKeyDirFormat + TaskReportLevelDir + "/reportSend/%d/%s/%d"; public static final String OperationTaskKeyRoutineTaskReportSendDirFormat = OperationTaskKeyDirFormat + "/reportSend/%d/%s/%d";
public static final String OperationTaskKeyRoutineTaskReportSendDirFormatForDelete = OperationTaskKeyDirFormat + TaskReportLevelDir + "/reportSend/%d/%s"; public static final String OperationTaskKeyRoutineTaskReportSendDirFormatForDelete = OperationTaskKeyDirFormat + "/reportSend/%d/%s";
public static final String OperationTaskKeyRoutineTaskReportDirFormat = OperationTaskKeyDirFormat + TaskReportLevelDir + "/report/%d/%s"; public static final String OperationTaskKeyRoutineTaskReportDirFormat = OperationTaskKeyDirFormat + "/report/%d/%s";
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
/** /**
...@@ -678,32 +678,43 @@ public class ABVEnvironment { ...@@ -678,32 +678,43 @@ public class ABVEnvironment {
return String.format(OperationTaskKeyDirFormat, rootDirectory, operationId, taskKey); return String.format(OperationTaskKeyDirFormat, rootDirectory, operationId, taskKey);
} }
// #32926 作業報告画面改善 start
// taskReportLevelの値によってディレクトリを構成 // taskReportLevelの値によってディレクトリを構成
public String getOperationTaskReportSendDirFilePath(long operationId, String taskKey, int taskReportSendId, int taskReportLevel) { public String getOperationTaskReportSendDirFilePath(long operationId, String taskKey, int taskReportLevel, int taskReportSendId) {
return String.format(OperationTaskKeyReportSendDirFormat, rootDirectory, operationId, taskKey, String.valueOf(taskReportLevel), taskReportSendId); return String.format(OperationTaskKeyReportSendDirFormat, rootDirectory, operationId, taskKey, taskReportLevel, taskReportSendId);
} }
public String getRoutineTaskReportSendDirFilePath(long operationId, String taskKey, int taskReportId, String reportStartDate, int taskReportLevel) { public String getRoutineTaskReportSendDirFilePath(long operationId, String taskKey, int taskReportId, String reportStartDate) {
return String.format(OperationTaskKeyRoutineTaskReportSendDirFormatForDelete, rootDirectory, operationId, taskKey, String.valueOf(taskReportLevel), taskReportId, getReportDate(reportStartDate)); return String.format(OperationTaskKeyRoutineTaskReportSendDirFormatForDelete, rootDirectory, operationId, taskKey, taskReportId, getReportDate(reportStartDate));
} }
public String getRoutineTaskReportSendDirFilePath(long operationId, String taskKey, int taskReportId, String reportStartDate, int taskReportSendId, int taskReportLevel) { public String getRoutineTaskReportSendDirFilePath(long operationId, String taskKey, int taskReportId, String reportStartDate, int taskReportSendId) {
return String.format(OperationTaskKeyRoutineTaskReportSendDirFormat, rootDirectory, operationId, taskKey, String.valueOf(taskReportLevel), taskReportId, getReportDate(reportStartDate), taskReportSendId); return String.format(OperationTaskKeyRoutineTaskReportSendDirFormat, rootDirectory, operationId, taskKey, taskReportId, getReportDate(reportStartDate), taskReportSendId);
} }
public String getRoutineTaskReportDirFilePath(long operationId, String taskKey, int taskReportId, String reportStartDate, int taskReportLevel) { public String getRoutineTaskReportDirFilePath(long operationId, String taskKey, int taskReportId, String reportStartDate) {
return String.format(OperationTaskKeyRoutineTaskReportDirFormat, rootDirectory, operationId, taskKey, String.valueOf(taskReportLevel), taskReportId, getReportDate(reportStartDate)); return String.format(OperationTaskKeyRoutineTaskReportDirFormat, rootDirectory, operationId, taskKey, taskReportId, getReportDate(reportStartDate));
} }
public String getOperationDirectionOrReportDirPath(long operationId, String taskKey, String taskReportLevel) { public String getOperationDirectionOrReportDirPath(long operationId, String taskKey, int taskReportLevel) {
return String.format(OperationDirectionOrReportDirFormat, rootDirectory, operationId, taskKey, taskReportLevel); return String.format(OperationDirectionOrReportDirFormat, rootDirectory, operationId, taskKey, String.valueOf(taskReportLevel));
} }
public String getOperationTaskReportLevelDirPath(long operationId, String taskKey, String taskReportLevel) { /**
return String.format(OperationDirectionOrReportDirFormat, rootDirectory, operationId, taskKey, taskReportLevel); * 作業報告レベルのディレクトリパス
* 例)root/files/ABook/projects/[project_id]/[task_key]/[taskReportLevel]
* @param operationId
* @param taskKey
* @param taskReportLevel
* @return
*/
public String getOperationTaskReportLevelDirPath(long operationId, String taskKey, int taskReportLevel) {
return String.format(OperationDirectionOrReportDirFormat, rootDirectory, operationId, taskKey, String.valueOf(taskReportLevel));
}
public String getOperationTaskReportDirPath(long operationId, String taskKey) {
return String.format(OperationDirectionOrReportDirFormat, rootDirectory, operationId, taskKey);
} }
// #32926 作業報告画面改善 end
public String getOperationReportSendDirPath(long operationId, String taskKey) { public String getOperationReportSendDirPath(long operationId, String taskKey) {
return String.format(OperationDirectionOrReportDirFormat, rootDirectory, operationId, taskKey, REPORT_SEND); return String.format(OperationDirectionOrReportDirFormat, rootDirectory, operationId, taskKey, REPORT_SEND);
...@@ -716,8 +727,8 @@ public class ABVEnvironment { ...@@ -716,8 +727,8 @@ public class ABVEnvironment {
// #32926 作業報告画面改善 start // #32926 作業報告画面改善 start
// taskReportLevelの値によってディレクトリを構成 // taskReportLevelの値によってディレクトリを構成
public String getAttachedDirectionOrReportDirPath(long contentId, String taskKey, String taskReportLevel) { public String getAttachedDirectionOrReportDirPath(long contentId, String taskKey, int taskReportLevel) {
return String.format(AttachedMoviesTaskTypeDir, cacheDirectory, contentId, taskKey, taskReportLevel); return String.format(AttachedMoviesTaskTypeDir, cacheDirectory, contentId, taskKey, String.valueOf(taskReportLevel));
} }
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
......
...@@ -88,17 +88,10 @@ public class Constant { ...@@ -88,17 +88,10 @@ public class Constant {
String REPORT_GPS = "reportGps"; String REPORT_GPS = "reportGps";
} }
public interface OperationUpdateType {
int HISTORY_NO = 0;
int HISTORY_ADD = 1;
int HISTORY_UPDATE = 2;
}
public interface OperationReportType { public interface OperationReportType {
// TODO 変数名は仮実装、変更必要 int REPORT_TYPE = 0;
int DEFAULT = 0;
int ROUTINE_TASK = 1; int ROUTINE_TASK = 1;
int REPORT_TYPE = 2; int REPORT_RESPONSE_TYPE = 2;
} }
public interface PushMessageSendType { public interface PushMessageSendType {
...@@ -141,11 +134,26 @@ public class Constant { ...@@ -141,11 +134,26 @@ public class Constant {
int Audio =3; int Audio =3;
} }
// #32926 作業報告画面改善 start public interface TaskReportLevel {
int ReportType = 0; // 報告タイプ
int ReportReplyType = 1; // 報告(回答)タイプ
}
public interface ReportType { public interface ReportType {
int Report = 0; // 報告 int Report = 0; // 報告
int Routine = 1; // 定期点検 int Routine = 1; // 定期点検
int Report_Answer = 2; // 報告(回答) int ReportReply = 2; // 報告(回答)
}
// 報告履歴管理
public interface EnableReportHistory {
int Invalid = 0; // 無効
int Enable = 1; // 有効
}
// 作業編集可能区分
public interface EnableReportEdit {
int NO = 0;
int YES = 1;
} }
// #32926 作業報告画面改善 end
} }
...@@ -12,18 +12,11 @@ public class ABookKeys { ...@@ -12,18 +12,11 @@ public class ABookKeys {
public static final String CONTENT_ID = "contentId"; public static final String CONTENT_ID = "contentId";
public static final String CONTENT_NAME = "contentName"; public static final String CONTENT_NAME = "contentName";
public static final String CONTENT_TYPE = "contentType"; public static final String CONTENT_TYPE = "contentType";
public static final String OPERATION_ID = "projectId"; public static final String OPERATION_ID = "operationId";
public static final String OPERATION_NAME = "projectName"; public static final String OPERATION_NAME = "operationName";
// ABOOKCHECK SCHEME // ABOOKCHECK SCHEME
public static final String ABOOK_CHECK_API = "abookcheck-api"; public static final String ABOOK_CHECK_API = "abookcheck-api";
// #32782 指示者テーブル関連削除 start
// TODO TaskDirections 削除処理が必要
public static final String CMD_INSERT_TASK_DIRECTIONS = "insertTaskDirections";
public static final String CMD_UPDATE_TASK_DIRECTIONS = "updateTaskDirections";
public static final String CMD_DELETE_TASK_DIRECTIONS = "deleteTaskDirections";
public static final String CMD_CANCEL_TASK_DIRECTIONS = "cancelTaskDirections";
// #32782 指示者テーブル関連削除 end
public static final String CMD_MOVE_HOT_SPOT = "moveHotspot"; public static final String CMD_MOVE_HOT_SPOT = "moveHotspot";
public static final String CMD_SHOW_DIRECTION_OZD = "showDirectionOzd"; public static final String CMD_SHOW_DIRECTION_OZD = "showDirectionOzd";
public static final String CMD_PREVIEW_DIRECTION_OZD = "previewDirectionOzd"; public static final String CMD_PREVIEW_DIRECTION_OZD = "previewDirectionOzd";
...@@ -50,6 +43,7 @@ public class ABookKeys { ...@@ -50,6 +43,7 @@ public class ABookKeys {
public static final String READ_ONLY_FLG = "readOnlyFlg"; public static final String READ_ONLY_FLG = "readOnlyFlg";
public static final String DIRECTION_FLG = "directionFlg"; public static final String DIRECTION_FLG = "directionFlg";
public static final String ATTACHED_CHANGE_FLAG = "attachedChangeFlag"; public static final String ATTACHED_CHANGE_FLAG = "attachedChangeFlag";
public static final String ROUTINE_TASK_FLAG = "routineTaskFlag";
// #32782 指示者テーブル関連削除 start // #32782 指示者テーブル関連削除 start
// TODO change TASK_DIRECTIONS 削除が必要 // TODO change TASK_DIRECTIONS 削除が必要
// public static final String TASK_DIRECTIONS = "taskReport"; // public static final String TASK_DIRECTIONS = "taskReport";
...@@ -77,7 +71,7 @@ public class ABookKeys { ...@@ -77,7 +71,7 @@ public class ABookKeys {
public static final String SID = "sid"; public static final String SID = "sid";
public static final String FORM_FILE = "formFile"; public static final String FORM_FILE = "formFile";
public static final String DEL_FLAG = "delFlag"; public static final String DEL_FLAG = "delFlag";
public static final String TASK_TYPE = "taskType"; public static final String TASK_REPORT_LEVEL = "taskReportLevel";
public static final String TASK_HOT_SPOT_INFO = "taskHotspotInfo"; public static final String TASK_HOT_SPOT_INFO = "taskHotspotInfo";
public static final String TASK_REPORT_INFO = "taskReportInfo"; public static final String TASK_REPORT_INFO = "taskReportInfo";
public static final String TASK_REPORT_SAVE_DATE = "saveDate"; public static final String TASK_REPORT_SAVE_DATE = "saveDate";
...@@ -123,7 +117,6 @@ public class ABookKeys { ...@@ -123,7 +117,6 @@ public class ABookKeys {
public static final String CMD_LOCAL_SAVE_TASK_REPORT = "localSaveTaskReport"; // 一時保存 public static final String CMD_LOCAL_SAVE_TASK_REPORT = "localSaveTaskReport"; // 一時保存
// #32861 作業情報追加 end // #32861 作業情報追加 end
// #32926 作業報告画面改善 start // #32926 作業報告画面改善 start
public static final String TASK_REPORT_LEVEL = "taskReportLevel"; // 作業報告レベル(0:報告、1:報告(回答)、2:報告(回答)) public static final String HAS_AUTHORITY = "hasAuthority";
public static final String TASK_HAS_AUTHORITY = "taskHasAuthority";
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
} }
...@@ -19,6 +19,7 @@ import jp.agentec.abook.abv.bl.data.tables.MWorkerGroup; ...@@ -19,6 +19,7 @@ import jp.agentec.abook.abv.bl.data.tables.MWorkerGroup;
import jp.agentec.abook.abv.bl.data.tables.ROperationContent; import jp.agentec.abook.abv.bl.data.tables.ROperationContent;
import jp.agentec.abook.abv.bl.data.tables.RContentCategory; import jp.agentec.abook.abv.bl.data.tables.RContentCategory;
import jp.agentec.abook.abv.bl.data.tables.RContentGroup; import jp.agentec.abook.abv.bl.data.tables.RContentGroup;
import jp.agentec.abook.abv.bl.data.tables.RTaskWorkerGroup;
import jp.agentec.abook.abv.bl.data.tables.SQLiteTableScript; import jp.agentec.abook.abv.bl.data.tables.SQLiteTableScript;
import jp.agentec.abook.abv.bl.data.tables.TContent; import jp.agentec.abook.abv.bl.data.tables.TContent;
import jp.agentec.abook.abv.bl.data.tables.TContentBookmark; import jp.agentec.abook.abv.bl.data.tables.TContentBookmark;
...@@ -31,13 +32,10 @@ import jp.agentec.abook.abv.bl.data.tables.TContentResource; ...@@ -31,13 +32,10 @@ import jp.agentec.abook.abv.bl.data.tables.TContentResource;
import jp.agentec.abook.abv.bl.data.tables.TContentServerSearched; import jp.agentec.abook.abv.bl.data.tables.TContentServerSearched;
import jp.agentec.abook.abv.bl.data.tables.TContentTag; import jp.agentec.abook.abv.bl.data.tables.TContentTag;
import jp.agentec.abook.abv.bl.data.tables.TEnquete; import jp.agentec.abook.abv.bl.data.tables.TEnquete;
import jp.agentec.abook.abv.bl.data.tables.TRoutineTaskReport;
import jp.agentec.abook.abv.bl.data.tables.TMarkingSetting; import jp.agentec.abook.abv.bl.data.tables.TMarkingSetting;
import jp.agentec.abook.abv.bl.data.tables.TOperation; import jp.agentec.abook.abv.bl.data.tables.TOperation;
import jp.agentec.abook.abv.bl.data.tables.TPushMessage; import jp.agentec.abook.abv.bl.data.tables.TPushMessage;
import jp.agentec.abook.abv.bl.data.tables.TTask; import jp.agentec.abook.abv.bl.data.tables.TTask;
import jp.agentec.abook.abv.bl.data.tables.TTaskDirections;
import jp.agentec.abook.abv.bl.data.tables.TTaskDirectionsItems;
import jp.agentec.abook.abv.bl.data.tables.TTaskReport; import jp.agentec.abook.abv.bl.data.tables.TTaskReport;
import jp.agentec.abook.abv.bl.data.tables.TTaskReportItems; import jp.agentec.abook.abv.bl.data.tables.TTaskReportItems;
import jp.agentec.abook.abv.bl.data.tables.TTaskReportSend; import jp.agentec.abook.abv.bl.data.tables.TTaskReportSend;
...@@ -89,18 +87,13 @@ public class ABVDataOpenHelper { ...@@ -89,18 +87,13 @@ public class ABVDataOpenHelper {
iTableScripts.add(new MWorkerGroup()); iTableScripts.add(new MWorkerGroup());
iTableScripts.add(new TOperation()); iTableScripts.add(new TOperation());
iTableScripts.add(new RTaskWorkerGroup());
iTableScripts.add(new ROperationContent()); iTableScripts.add(new ROperationContent());
iTableScripts.add(new TTask()); iTableScripts.add(new TTask());
// #32782 指示者テーブル関連削除 start
// TODO delete
iTableScripts.add(new TTaskDirections());
iTableScripts.add(new TTaskDirectionsItems());
// #32782 指示者テーブル関連削除 end
iTableScripts.add(new TTaskReport()); iTableScripts.add(new TTaskReport());
iTableScripts.add(new TTaskReportSend()); iTableScripts.add(new TTaskReportSend());
iTableScripts.add(new TTaskReportItems()); iTableScripts.add(new TTaskReportItems());
iTableScripts.add(new TPushMessage()); iTableScripts.add(new TPushMessage());
iTableScripts.add(new TRoutineTaskReport());
return iTableScripts; return iTableScripts;
} }
......
...@@ -255,6 +255,34 @@ public class AbstractDao { ...@@ -255,6 +255,34 @@ public class AbstractDao {
} }
} }
} }
/**
* クエリを実行し、最初の行の最初の列の値をInteger型リストで返します。
*
* @param sql
* @param bindArgs
* @return
*/
public List<Integer> rawQueryGetIntegerList(String sql, String[] bindArgs) {
SQLiteDatabase db = dbConn.getDatabase();
Cursor cursor = null;
try {
List<Integer> list = new ArrayList<Integer>();
if (Logger.isVerboseEnabled()) {
Logger.v(TAG, "%s [%s]", sql, join(bindArgs));
}
cursor = db.rawQuery(sql, bindArgs);
while (cursor.moveToNext()) {
list.add(cursor.getInt(0));
}
return list;
}
finally {
if (cursor != null) {
cursor.close();
}
}
}
/** /**
* クエリを実行し、最初の行の最初の列の値をLong型リストで返します。 * クエリを実行し、最初の行の最初の列の値をLong型リストで返します。
......
...@@ -70,16 +70,6 @@ public class OperationDao extends AbstractDao { ...@@ -70,16 +70,6 @@ public class OperationDao extends AbstractDao {
dto.contentCreatingFlg = toBool(cursor.getInt(column)); dto.contentCreatingFlg = toBool(cursor.getInt(column));
} }
column = cursor.getColumnIndex("report_update_type");
if (column != -1) {
dto.reportUpdateType = cursor.getInt(column);
}
column = cursor.getColumnIndex("operation_report_type");
if (column != -1) {
dto.operationReportType = cursor.getInt(column);
}
column = cursor.getColumnIndex("report_cycle"); column = cursor.getColumnIndex("report_cycle");
if (column != -1) { if (column != -1) {
dto.reportCycle = cursor.getInt(column); dto.reportCycle = cursor.getInt(column);
...@@ -100,22 +90,32 @@ public class OperationDao extends AbstractDao { ...@@ -100,22 +90,32 @@ public class OperationDao extends AbstractDao {
dto.reportCount = cursor.getInt(column); dto.reportCount = cursor.getInt(column);
} }
column = cursor.getColumnIndex("enable_report_history");
if (column != -1) {
dto.enableReportHistory = cursor.getInt(column);
}
column = cursor.getColumnIndex("enable_report_edit");
if (column != -1) {
dto.enableReportEdit = cursor.getInt(column);
}
return dto; return dto;
} }
public List<OperationDto> getAllOperation() { public List<OperationDto> getAllOperation() {
return rawQueryGetDtoList("select tp.*, rpc.content_id from t_project AS tp left outer join r_operation_content AS rpc on tp.operation_id = rpc.operation_id", null, OperationDto.class); return rawQueryGetDtoList("select tp.*, rpc.content_id from t_operation AS tp left outer join r_operation_content AS rpc on tp.operation_id = rpc.operation_id", null, OperationDto.class);
} }
public List<OperationDto> getLatestOperations() { public List<OperationDto> getLatestOperations() {
return rawQueryGetDtoList("select * from t_project where operation_start_date <= ? order by operation_start_date DESC " , new String[]{DateTimeUtil.toStringInTimeZone(DateTimeUtil.getCurrentDate(), DateTimeFormat.yyyyMMddHHmmss_hyphen, "GMT")}, OperationDto.class); return rawQueryGetDtoList("select * from t_operation where operation_start_date <= ? order by operation_start_date DESC " , new String[]{DateTimeUtil.toStringInTimeZone(DateTimeUtil.getCurrentDate(), DateTimeFormat.yyyyMMddHHmmss_hyphen, "GMT")}, OperationDto.class);
} }
public OperationDto getOperation(long operationId) { public OperationDto getOperation(long operationId) {
StringBuffer sql = new StringBuffer(); StringBuffer sql = new StringBuffer();
String[] args = new String[] { "" + operationId }; String[] args = new String[] { "" + operationId };
sql.append(" SELECT * "); sql.append(" SELECT * ");
sql.append(" FROM t_project "); sql.append(" FROM t_operation ");
sql.append(" WHERE operation_id = ?"); sql.append(" WHERE operation_id = ?");
return rawQueryGetDto(sql.toString(), args, OperationDto.class); return rawQueryGetDto(sql.toString(), args, OperationDto.class);
} }
...@@ -124,7 +124,7 @@ public class OperationDao extends AbstractDao { ...@@ -124,7 +124,7 @@ public class OperationDao extends AbstractDao {
StringBuffer sql = new StringBuffer(); StringBuffer sql = new StringBuffer();
String[] args = new String[] { "" + operationId }; String[] args = new String[] { "" + operationId };
sql.append(" SELECT * "); sql.append(" SELECT * ");
sql.append(" FROM t_project AS tp "); sql.append(" FROM t_operation AS tp ");
sql.append(" LEFT OUTER JOIN r_operation_content AS rpc "); sql.append(" LEFT OUTER JOIN r_operation_content AS rpc ");
sql.append(" ON tp.operation_id = rpc.operation_id "); sql.append(" ON tp.operation_id = rpc.operation_id ");
sql.append(" AND rpc.operation_content_flg = 1 "); sql.append(" AND rpc.operation_content_flg = 1 ");
...@@ -136,7 +136,7 @@ public class OperationDao extends AbstractDao { ...@@ -136,7 +136,7 @@ public class OperationDao extends AbstractDao {
StringBuffer sql = new StringBuffer(); StringBuffer sql = new StringBuffer();
String[] args = new String[] { "" + contentId }; String[] args = new String[] { "" + contentId };
sql.append(" SELECT * "); sql.append(" SELECT * ");
sql.append(" FROM t_project AS tp "); sql.append(" FROM t_operation AS tp ");
sql.append(" LEFT OUTER JOIN r_operation_content AS rpc "); sql.append(" LEFT OUTER JOIN r_operation_content AS rpc ");
sql.append(" ON tp.operation_id = rpc.operation_id "); sql.append(" ON tp.operation_id = rpc.operation_id ");
sql.append(" AND rpc.operation_content_flg = 1 "); sql.append(" AND rpc.operation_content_flg = 1 ");
...@@ -154,95 +154,93 @@ public class OperationDao extends AbstractDao { ...@@ -154,95 +154,93 @@ public class OperationDao extends AbstractDao {
} }
public void insert(OperationDto dto) { public void insert(OperationDto dto) {
insert("insert into t_project " insert("insert into t_operation "
+ "(operation_id, " + "(operation_id, "
+ "operation_name, " + "operation_name, "
+ "operation_descriptions, " + "operation_descriptions, "
+ "operation_start_date, " + "operation_start_date, "
+ "operation_end_date, " + "operation_end_date, "
+ "operation_type, " + "operation_type, "
+ "report_type, "
+ "last_edit_date, " + "last_edit_date, "
+ "content_creating_flg, " + "content_creating_flg, "
+ "edit_lock_flg, " + "edit_lock_flg, "
+ "need_sync_flg, " + "need_sync_flg, "
+ "report_update_type, "
+ "operation_report_type, "
+ "report_cycle, " + "report_cycle, "
+ "enable_report_update) " + "enable_report_update, "
+ "enable_report_history, "
+ "enable_report_edit) "
+ "values " + "values "
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?,?)", + "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
dto.getInsertValues()); dto.getInsertValues());
} }
public boolean update(OperationDto dto) { public boolean update(OperationDto dto) {
long count = update("update t_project " long count = update("update t_operation "
+ "set " + "set "
+ "operation_name=?, " + "operation_name=?, "
+ "operation_descriptions=?, " + "operation_descriptions=?, "
+ "operation_start_date=?, " + "operation_start_date=?, "
+ "operation_end_date=?, " + "operation_end_date=?, "
+ "operation_type=?, " + "operation_type=?, "
+ "report_type=?, "
+ "last_edit_date=?, " + "last_edit_date=?, "
+ "content_creating_flg=?, " + "content_creating_flg=?, "
+ "edit_lock_flg=?, " + "edit_lock_flg=?, "
+ "need_sync_flg=?, " + "need_sync_flg=?, "
+ "report_update_type=?, "
+ "operation_report_type=?, "
+ "report_cycle=?, " + "report_cycle=?, "
+ "enable_report_update=? " + "enable_report_update=?, "
+ "enable_report_history=?, "
+ "enable_report_edit=? "
+ "where operation_id=?", + "where operation_id=?",
dto.getUpdateValues()); dto.getUpdateValues());
return count > 0; return count > 0;
} }
public void delete(OperationDto dto) { public void delete(OperationDto dto) {
delete("r_task_worker_group", "operation_id=?", dto.getKeyValues());
delete("r_operation_content", "operation_id=?", dto.getKeyValues()); delete("r_operation_content", "operation_id=?", dto.getKeyValues());
delete("t_project", "operation_id=?", dto.getKeyValues()); delete("t_operation", "operation_id=?", dto.getKeyValues());
} }
public void deleteAll() { public void deleteAll() {
delete("t_push_message", null, null); delete("t_push_message", null, null);
delete("r_operation_content", null, null); delete("r_operation_content", null, null);
delete("t_project", null, null); delete("t_operation", null, null);
delete("t_task", null, null); delete("t_task", null, null);
// #32782 指示者テーブル関連削除 start
// TODO delete
delete("t_task_directions", null, null);
delete("t_task_directions_items", null, null);
// #32782 指示者テーブル関連削除 end
delete("t_task_report", null, null); delete("t_task_report", null, null);
delete("t_task_report_send", null, null); delete("t_task_report_send", null, null);
delete("t_task_report_items", null, null); delete("t_task_report_items", null, null);
delete("t_inspect_task_report", null, null); delete("t_inspect_task_report", null, null);
delete("m_worker_group", null, null); delete("m_worker_group", null, null);
delete("r_task_worker_group", null, null);
} }
public List<OperationDto> getOperations(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String operationReportTypeStr) { public List<OperationDto> getOperations(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String reportTypeStr) {
String sql = generateGetOperationQuery(searchOperationName, searchStartDateStr, searchEndDateStr, operationReportTypeStr); String sql = generateGetOperationQuery(searchOperationName, searchStartDateStr, searchEndDateStr, reportTypeStr);
return rawQueryGetDtoList(sql, null, OperationDto.class); return rawQueryGetDtoList(sql, null, OperationDto.class);
} }
private String generateGetOperationQuery(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String operationReportTypeStr) { private String generateGetOperationQuery(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String reportTypeStr) {
String curDate = DateTimeUtil.toStringInTimeZone(new Date(), DateTimeFormat.yyyyMMddHHmmss_hyphen, "UTC"); String curDate = DateTimeUtil.toStringInTimeZone(new Date(), DateTimeFormat.yyyyMMddHHmmss_hyphen, "UTC");
StringBuffer sql = new StringBuffer(); StringBuffer sql = new StringBuffer();
sql.append(" SELECT tp.operation_id, "); sql.append(" SELECT top.operation_id, ");
sql.append(" tp.operation_name, "); sql.append(" top.operation_name, ");
sql.append(" tp.operation_type, "); sql.append(" top.operation_type, ");
sql.append(" tp.operation_descriptions, "); sql.append(" top.operation_descriptions, ");
sql.append(" tp.operation_start_date, "); sql.append(" top.operation_start_date, ");
sql.append(" tp.operation_end_date, "); sql.append(" top.operation_end_date, ");
sql.append(" tp.last_edit_date, "); sql.append(" top.last_edit_date, ");
sql.append(" tp.edit_lock_flg, "); sql.append(" top.edit_lock_flg, ");
sql.append(" tp.need_sync_flg, "); sql.append(" top.need_sync_flg, ");
sql.append(" tp.content_creating_flg, "); sql.append(" top.content_creating_flg, ");
sql.append(" tp.report_update_type, "); sql.append(" top.report_type, ");
sql.append(" tp.operation_report_type, "); sql.append(" top.report_cycle, ");
sql.append(" tp.report_cycle, "); sql.append(" top.enable_report_update, ");
sql.append(" tp.enable_report_update, ");
sql.append(" CASE "); sql.append(" CASE ");
sql.append(" WHEN operation_report_type = 1 THEN ( "); sql.append(" WHEN report_type = 1 THEN ( ");
sql.append(" SELECT strftime('%Y/%m/%d %H:%M', datetime(ti.report_start_date, 'localtime')) || ' ~ ' || strftime('%Y/%m/%d %H:%M', datetime(ti.report_end_date, 'localtime')) "); sql.append(" SELECT strftime('%Y/%m/%d %H:%M', datetime(ti.report_start_date, 'localtime')) || ' ~ ' || strftime('%Y/%m/%d %H:%M', datetime(ti.report_end_date, 'localtime')) ");
sql.append(" FROM t_task tt "); sql.append(" FROM t_task tt ");
sql.append(" INNER JOIN t_inspect_task_report ti "); sql.append(" INNER JOIN t_inspect_task_report ti ");
...@@ -250,52 +248,52 @@ public class OperationDao extends AbstractDao { ...@@ -250,52 +248,52 @@ public class OperationDao extends AbstractDao {
sql.append(" AND tt.del_flg = 0 "); sql.append(" AND tt.del_flg = 0 ");
//sql.append(" AND datetime(ti.report_start_date) <= datetime('" + curDate + "') "); //sql.append(" AND datetime(ti.report_start_date) <= datetime('" + curDate + "') ");
sql.append(" AND datetime(ti.report_end_date) >= datetime('" + curDate + "') "); sql.append(" AND datetime(ti.report_end_date) >= datetime('" + curDate + "') ");
sql.append(" WHERE tt.operation_id = tp.operation_id "); sql.append(" WHERE tt.operation_id = top.operation_id ");
sql.append(" ORDER BY ti.report_start_date ASC LIMIT 1 ) "); sql.append(" ORDER BY ti.report_start_date ASC LIMIT 1 ) ");
sql.append(" ELSE '' "); sql.append(" ELSE '' ");
sql.append(" END AS report_period, "); sql.append(" END AS report_period, ");
sql.append(" CASE "); sql.append(" CASE ");
sql.append(" WHEN operation_report_type = 1 THEN ( "); sql.append(" WHEN report_type = 1 THEN ( ");
sql.append(" SELECT count(*) "); sql.append(" SELECT count(*) ");
sql.append(" FROM t_inspect_task_report "); sql.append(" FROM t_inspect_task_report ");
sql.append(" WHERE task_key = (SELECT task_key FROM t_task WHERE operation_id = tp.operation_id LIMIT 1) ) "); sql.append(" WHERE task_key = (SELECT task_key FROM t_task WHERE operation_id = top.operation_id LIMIT 1) ) ");
sql.append(" ELSE 0 "); sql.append(" ELSE 0 ");
sql.append(" END AS report_count, "); sql.append(" END AS report_count, ");
sql.append(" rpc.content_id "); sql.append(" rpc.content_id ");
sql.append(" FROM t_project AS tp "); sql.append(" FROM t_operation AS top ");
sql.append(" LEFT OUTER JOIN r_operation_content AS rpc "); sql.append(" LEFT OUTER JOIN r_operation_content AS rpc ");
sql.append(" ON tp.operation_id = rpc.operation_id "); sql.append(" ON top.operation_id = rpc.operation_id ");
sql.append(" AND rpc.operation_content_flg = 1 "); sql.append(" AND rpc.operation_content_flg = 1 ");
sql.append(" WHERE tp.operation_id IS NOT NULL "); sql.append(" WHERE top.operation_id IS NOT NULL ");
if (!StringUtil.isNullOrEmpty(searchOperationName)) { if (!StringUtil.isNullOrEmpty(searchOperationName)) {
sql.append(" AND tp.operation_name GLOB " + "'*" + searchOperationName + "*'"); sql.append(" AND top.operation_name GLOB " + "'*" + searchOperationName + "*'");
} }
if (!StringUtil.isNullOrEmpty(searchStartDateStr)) { if (!StringUtil.isNullOrEmpty(searchStartDateStr)) {
Date startDate = DateTimeUtil.toDate(searchStartDateStr, "UTC", DateTimeFormat.yyyyMMdd_hyphen); Date startDate = DateTimeUtil.toDate(searchStartDateStr, "UTC", DateTimeFormat.yyyyMMdd_hyphen);
sql.append(" AND tp.operation_end_date >= '" + DateTimeUtil.toString(startDate, DateTimeFormat.yyyyMMdd_hyphen) + "'"); sql.append(" AND top.operation_end_date >= '" + DateTimeUtil.toString(startDate, DateTimeFormat.yyyyMMdd_hyphen) + "'");
} }
if (!StringUtil.isNullOrEmpty(searchEndDateStr)) { if (!StringUtil.isNullOrEmpty(searchEndDateStr)) {
Date endDate = DateTimeUtil.toDate(searchEndDateStr, "UTC", DateTimeFormat.yyyyMMdd_hyphen); Date endDate = DateTimeUtil.toDate(searchEndDateStr, "UTC", DateTimeFormat.yyyyMMdd_hyphen);
sql.append(" AND tp.operation_start_date <= '" + DateTimeUtil.toString(endDate, DateTimeFormat.yyyyMMdd_hyphen) + "'"); sql.append(" AND top.operation_start_date <= '" + DateTimeUtil.toString(endDate, DateTimeFormat.yyyyMMdd_hyphen) + "'");
} }
if (operationReportTypeStr != null) { if (reportTypeStr != null) {
sql.append(" AND tp.operation_report_type in ("+ operationReportTypeStr +")"); sql.append(" AND top.report_type in ("+ reportTypeStr +")");
} }
sql.append(" ORDER BY tp.operation_report_type DESC, tp.operation_start_date DESC, tp.operation_id DESC"); sql.append(" ORDER BY top.operation_start_date DESC, top.operation_name ASC");
Logger.v(TAG, "sql=%s", sql); Logger.v(TAG, "sql=%s", sql);
return sql.toString(); return sql.toString();
} }
public boolean updateContentCreatingFlg(long operationId, boolean content_creating_flg){ public boolean updateContentCreatingFlg(long operationId, boolean contentCreatingFlg) {
OperationDto dto = getOperation(operationId); OperationDto dto = getOperation(operationId);
if (dto != null) { if (dto != null) {
dto.contentCreatingFlg = content_creating_flg; dto.contentCreatingFlg = contentCreatingFlg;
return update(dto); return update(dto);
} }
return false; return false;
......
...@@ -94,10 +94,10 @@ public class PushMessageDao extends AbstractDao { ...@@ -94,10 +94,10 @@ public class PushMessageDao extends AbstractDao {
public List<PushMessageDto> selectAll() { public List<PushMessageDto> selectAll() {
StringBuffer sql = new StringBuffer(); StringBuffer sql = new StringBuffer();
sql.append(" SELECT tpm.push_message_id, tpm.operation_id, tpm.push_send_login_id, tpm.push_send_date, tpm.push_message, tpm.reading_flg, tp.operation_name "); sql.append(" SELECT tpm.push_message_id, tpm.operation_id, tpm.push_send_login_id, tpm.push_send_date, tpm.push_message, tpm.reading_flg, top.operation_name ");
sql.append(" FROM t_push_message AS tpm "); sql.append(" FROM t_push_message AS tpm ");
sql.append(" INNER JOIN t_project AS tp "); sql.append(" INNER JOIN t_operation AS top ");
sql.append(" ON tpm.operation_id = tp.operation_id "); sql.append(" ON tpm.operation_id = top.operation_id ");
sql.append(" ORDER BY tpm.push_message_id DESC "); sql.append(" ORDER BY tpm.push_message_id DESC ");
Logger.v(TAG, "sql=%s", sql); Logger.v(TAG, "sql=%s", sql);
return rawQueryGetDtoList(sql.toString(), null, PushMessageDto.class); return rawQueryGetDtoList(sql.toString(), null, PushMessageDto.class);
...@@ -106,10 +106,10 @@ public class PushMessageDao extends AbstractDao { ...@@ -106,10 +106,10 @@ public class PushMessageDao extends AbstractDao {
public PushMessageDto select(long pushMessageId) { public PushMessageDto select(long pushMessageId) {
String[] args = new String[] { "" + pushMessageId }; String[] args = new String[] { "" + pushMessageId };
StringBuffer sql = new StringBuffer(); StringBuffer sql = new StringBuffer();
sql.append(" SELECT tpm.push_message_id, tpm.operation_id, tpm.push_send_login_id, tpm.push_send_date, tpm.push_message, tpm.reading_flg, tp.operation_name "); sql.append(" SELECT tpm.push_message_id, tpm.operation_id, tpm.push_send_login_id, tpm.push_send_date, tpm.push_message, tpm.reading_flg, top.operation_name ");
sql.append(" FROM t_push_message AS tpm "); sql.append(" FROM t_push_message AS tpm ");
sql.append(" INNER JOIN t_project AS tp "); sql.append(" INNER JOIN t_operation AS top ");
sql.append(" ON tpm.operation_id = tp.operation_id "); sql.append(" ON tpm.operation_id = top.operation_id ");
sql.append(" WHERE tpm.push_message_id = ? "); sql.append(" WHERE tpm.push_message_id = ? ");
Logger.v(TAG, "sql=%s", sql); Logger.v(TAG, "sql=%s", sql);
return rawQueryGetDto(sql.toString(), args, PushMessageDto.class); return rawQueryGetDto(sql.toString(), args, PushMessageDto.class);
......
package jp.agentec.abook.abv.bl.data.dao;
import java.util.List;
import jp.agentec.abook.abv.bl.common.db.Cursor;
import jp.agentec.abook.abv.bl.dto.RoutineTaskReportDto;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
/**
* Created by seo-y on 2018/12/17.
*/
public class RoutineTaskReportDao extends AbstractDao {
private static final String TAG = "InspectTaskReportDao";
@Override
public RoutineTaskReportDto convert(Cursor cursor) {
RoutineTaskReportDto dto = new RoutineTaskReportDto();
int column = cursor.getColumnIndex("task_key");
if (column != -1) {
dto.taskKey = cursor.getString(column);
}
column = cursor.getColumnIndex("task_report_id");
if (column != -1) {
dto.taskReportId = cursor.getInt(column);
}
column = cursor.getColumnIndex("task_report_info_id");
if (column != -1) {
dto.taskReportInfoId = cursor.getInt(column);
}
column = cursor.getColumnIndex("report_start_date");
if (column != -1) {
dto.reportStartDate = DateTimeUtil.toDate(cursor.getString(column), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
}
column = cursor.getColumnIndex("report_end_date");
if (column != -1) {
dto.reportEndDate = DateTimeUtil.toDate(cursor.getString(column), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
}
column = cursor.getColumnIndex("attached_file_name");
if (column != -1) {
dto.attachedFileName = cursor.getString(column);
}
column = cursor.getColumnIndex("local_attached_file_name");
if (column != -1) {
dto.localAttachedFileName = cursor.getString(column);
}
column = cursor.getColumnIndex("json_data");
if (column != -1) {
dto.jsonData = cursor.getString(column);
}
column = cursor.getColumnIndex("data_send_flag");
if (column != -1) {
dto.dataSendFlag = toBool(cursor.getInt(column));
}
column = cursor.getColumnIndex("attached_file_send_flag");
if (column != -1) {
dto.attachedFileSendFlag = toBool(cursor.getInt(column));
}
column = cursor.getColumnIndex("reported_flag");
if (column != -1) {
dto.reportedFlag = toBool(cursor.getInt(column));
}
return dto;
}
public void insert(RoutineTaskReportDto dto) {
insert("insert into t_inspect_task_report "
+ "(task_key, "
+ "task_report_id, "
+ "task_report_info_id, "
+ "report_start_date, "
+ "report_end_date, "
+ "attached_file_name, "
+ "local_attached_file_name, "
+ "json_data, "
+ "data_send_flag, "
+ "attached_file_send_flag, "
+ "reported_flag) "
+ "values (?,?,?,?,?,?,?,?,?,?,?)",
dto.getInsertValues());
}
public boolean update(RoutineTaskReportDto dto, boolean reportedFlg) {
long count;
if (reportedFlg) {
dto.reportedFlag = true;
count = update("update t_inspect_task_report "
+ "set "
+ "report_end_date=?, "
+ "attached_file_name=?, "
+ "local_attached_file_name=?, "
+ "json_data=?, "
+ "data_send_flag=?, "
+ "attached_file_send_flag=?, "
+ "reported_flag=? "
+ "where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?)",
dto.getUpdateValues());
} else {
count = update("update t_inspect_task_report "
+ "set "
+ "report_end_date=?, "
+ "attached_file_name=?, "
+ "local_attached_file_name=?, "
+ "json_data=?, "
+ "data_send_flag=?, "
+ "attached_file_send_flag=? "
+ "where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?)",
new Object[] { dto.reportEndDate, dto.attachedFileName, dto.localAttachedFileName, dto.jsonData, dto.dataSendFlag, dto.attachedFileSendFlag, dto.taskKey, dto.taskReportId, dto.reportStartDate });
}
return count > 0;
}
public void delete(RoutineTaskReportDto dto) {
delete("t_inspect_task_report", "task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?, 'utc')", new String[] { dto.taskKey, "" + dto.taskReportId, DateTimeUtil.toString(dto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen) });
}
public RoutineTaskReportDto getLastRoutineTaskReportData(long operationId) {
StringBuilder sb = new StringBuilder();
sb.append(" select tr.* ");
sb.append(" from t_inspect_task_report tr ");
sb.append(" inner join ");
sb.append(" t_task tt ");
sb.append(" ON tr.task_key == tt.task_key");
sb.append(" WHERE tt.operation_id = ? ORDER BY tr.report_start_date DESC LIMIT 1");
List<RoutineTaskReportDto> dtoList = rawQueryGetDtoList(sb.toString(), new String[]{ "" + operationId }, RoutineTaskReportDto.class);
if (dtoList != null && dtoList.size() > 0) {
return dtoList.get(0);
} else {
RoutineTaskReportDto dto = new RoutineTaskReportDto();
dto.taskReportId = 0;
return dto;
}
}
public RoutineTaskReportDto getRoutineTaskReportUtc(String taskKey, int taskReportId, String reportStartDate){
return rawQueryGetDto("select * from t_inspect_task_report where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?, 'utc')", new String[]{ taskKey, "" + taskReportId, reportStartDate }, RoutineTaskReportDto.class);
}
public List<RoutineTaskReportDto> selectRoutineTaskReportByTaskKey(String taskKey) {
return rawQueryGetDtoList("select * from t_inspect_task_report where task_key=?", new String[]{ taskKey }, RoutineTaskReportDto.class);
}
public List<RoutineTaskReportDto> getRoutineTaskReportByOperationId(Long operationId) {
StringBuilder sb = new StringBuilder();
sb.append(" select tr.* ");
sb.append(" from t_inspect_task_report tr ");
sb.append(" inner join ");
sb.append(" t_task tt ");
sb.append(" ON tt.task_key == tr.task_key ");
sb.append(" WHERE tt.del_flg = 0");
sb.append(" AND tt.operation_id = ?");
sb.append(" ORDER BY task_report_id ASC, report_start_date ASC");
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, RoutineTaskReportDto.class);
}
public List<RoutineTaskReportDto> getSendableRoutineTaskReportData(long operationId) {
StringBuilder sb = new StringBuilder();
sb.append(" select * ");
sb.append(" from t_inspect_task_report tr ");
sb.append(" inner join ");
sb.append(" t_task tt ");
sb.append(" ON tr.task_key == tt.task_key");
sb.append(" WHERE tr.data_send_flag = 1");
sb.append(" AND tt.operation_id = ?");
return rawQueryGetDtoList(sb.toString(), new String[]{ "" + operationId }, RoutineTaskReportDto.class);
}
public List<RoutineTaskReportDto> getSendableRoutineTaskReportData(long operationId, String taskKey) {
StringBuilder sb = new StringBuilder();
sb.append(" select * ");
sb.append(" from t_inspect_task_report tr ");
sb.append(" inner join ");
sb.append(" t_task tt ");
sb.append(" ON tr.task_key == tt.task_key");
sb.append(" WHERE tr.data_send_flag = 1");
sb.append(" AND tt.operation_id = ?");
sb.append(" AND tt.task_key = ?");
return rawQueryGetDtoList(sb.toString(), new String[]{ "" + operationId, "" + taskKey }, RoutineTaskReportDto.class);
}
public boolean isExistSendRoutineTaskData(Long operationId) {
return getSendableRoutineTaskReportData(operationId).size() > 0;
}
public boolean existsToDoRoutineTaskReportData(long operationId) {
String currDate = DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMddHHmmss_hyphen);
StringBuilder sb = new StringBuilder();
sb.append(" select count(*) ");
sb.append(" from t_inspect_task_report tr ");
sb.append(" inner join t_task tt ON tt.task_key == tr.task_key ");
sb.append(" WHERE tt.del_flg = 0 ");
sb.append(" AND tt.operation_id = ? ");
sb.append(" AND datetime(report_end_date) >= datetime(?, 'utc') ");
return rawQueryGetInt(sb.toString(), new String[]{ "" + operationId, currDate }) > 0;
}
public List<RoutineTaskReportDto> geRoutineTaskReportByTaskKey(String taskKey) {
StringBuilder sb = new StringBuilder();
sb.append(" SELECT * ");
sb.append(" FROM t_inspect_task_report ");
sb.append(" WHERE task_key = ? ");
sb.append(" ORDER BY task_report_id, report_start_date ");
return rawQueryGetDtoList(sb.toString(), new String[]{ taskKey }, RoutineTaskReportDto.class);
}
public String getRoutineTaskReportAttachedFileName(String taskKey, int taskReportId, String reportStartDate) {
return rawQueryGetString("select local_attached_file_name from t_inspect_task_report where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?)", new String[]{ taskKey, "" + taskReportId, reportStartDate });
}
}
...@@ -99,24 +99,12 @@ public class TaskDao extends AbstractDao { ...@@ -99,24 +99,12 @@ public class TaskDao extends AbstractDao {
/** /**
* 作業削除 * 作業削除
* @param taskKey * @param taskKey
* @param directionFlg
*/ */
public void deleteTaskData(String taskKey, boolean directionFlg) { public void deleteTaskData(String taskKey) {
String[] keyValues = new String[]{""+ taskKey}; String[] keyValues = new String[]{""+ taskKey};
delete("t_task", "task_key=?", keyValues);
if (directionFlg) { delete("t_task_report", "task_key=?", keyValues);
delete("t_task", "task_key=?", keyValues); delete("t_task_report_items", "task_key=?", keyValues);
// #32782 指示者テーブル関連削除 start
// TODO delete
delete("t_task_directions", "task_key=?", keyValues);
delete("t_task_directions_items", "task_key=?", keyValues);
// #32782 指示者テーブル関連削除 end
delete("t_task_report", "task_key=?", keyValues);
delete("t_task_report_items", "task_key=?", keyValues);
} else {
delete("t_task_report", "task_key=?", keyValues);
delete("t_task_report_items", "task_key=?", keyValues);
}
} }
/** /**
...@@ -125,11 +113,6 @@ public class TaskDao extends AbstractDao { ...@@ -125,11 +113,6 @@ public class TaskDao extends AbstractDao {
*/ */
public void delete(TaskDto dto) { public void delete(TaskDto dto) {
delete("t_task", "task_key=?", dto.getKeyValues()); delete("t_task", "task_key=?", dto.getKeyValues());
// #32782 指示者テーブル関連削除 start
// TODO delete
delete("t_task_directions", "task_key=?", dto.getKeyValues());
delete("t_task_directions_items", "task_key=?", dto.getKeyValues());
// #32782 指示者テーブル関連削除 end
delete("t_task_report", "task_key=?", dto.getKeyValues()); delete("t_task_report", "task_key=?", dto.getKeyValues());
delete("t_task_report_items", "task_key=?", dto.getKeyValues()); delete("t_task_report_items", "task_key=?", dto.getKeyValues());
delete("t_inspect_task_report", "task_key=?", new String[] { dto.taskKey }); delete("t_inspect_task_report", "task_key=?", new String[] { dto.taskKey });
......
package jp.agentec.abook.abv.bl.data.dao;
import java.util.List;
import jp.agentec.abook.abv.bl.common.db.Cursor;
import jp.agentec.abook.abv.bl.dto.TaskDirectionsDto;
/**
* Created by leej on 2018/08/31.
*/
public class TaskDirectionsDao extends AbstractDao {
private static final String TAG = "TaskDirectionsDao";
/*package*/ TaskDirectionsDao() {
}
@Override
protected TaskDirectionsDto convert(Cursor cursor) {
TaskDirectionsDto dto = new TaskDirectionsDto();
int column = cursor.getColumnIndex("task_key");
if (column != -1) {
dto.taskKey = cursor.getString(column);
}
column = cursor.getColumnIndex("json_data");
if (column != -1) {
dto.jsonData = cursor.getString(column);
}
column = cursor.getColumnIndex("attached_file_name");
if (column != -1) {
dto.attachedFileName = cursor.getString(column);
}
column = cursor.getColumnIndex("local_attached_file_name");
if (column != -1) {
dto.localAttachedFileName = cursor.getString(column);
}
column = cursor.getColumnIndex("attached_file_send_flg");
if (column != -1) {
dto.attachedFileSendFlg = toBool(cursor.getInt(column));
}
column = cursor.getColumnIndex("data_send_flg");
if (column != -1) {
dto.dataSendFlg = toBool(cursor.getInt(column));
}
// t_taskテーブルへINNER JOINで取得したカラム取得
column = cursor.getColumnIndex("task_hotspot_info");
if (column != -1) {
dto.taskHotSpotInfo = cursor.getString(column);
}
column = cursor.getColumnIndex("del_flg");
if (column != -1) {
dto.delFlg = toBool(cursor.getInt(column));
}
return dto;
}
public void insert(TaskDirectionsDto dto) {
insert("insert into t_task_directions "
+ "(task_key, "
+ "json_data, "
+ "attached_file_name, "
+ "local_attached_file_name, "
+ "attached_file_send_flg, "
+ "data_send_flg) "
+ "values "
+ "(?,?,?,?,?,?)",
dto.getInsertValues());
}
public List<TaskDirectionsDto> getTaskDirectionsByOperationId(Long operationId) {
StringBuilder sb = new StringBuilder();
sb.append(" select ttd.* ");
sb.append(" from t_task_directions ttd ");
sb.append(" inner join ");
sb.append(" t_task tt ");
sb.append(" ON tt.task_key == ttd.task_key ");
sb.append(" WHERE tt.del_flg = 0");
sb.append(" AND tt.operation_id = ?");
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskDirectionsDto.class);
}
public TaskDirectionsDto getTaskDirections(String taskKey) {
return rawQueryGetDto("select * from t_task_directions where task_key=?", new String[]{"" + taskKey}, TaskDirectionsDto.class);
}
public String getTaskDirectionsAttachedFileName(String taskKey) {
return rawQueryGetString("select local_attached_file_name from t_task_directions where task_key=?", new String[]{"" + taskKey});
}
public boolean update(TaskDirectionsDto dto) {
long count = update("update t_task_directions "
+ "set "
+ "json_data=?, "
+ "attached_file_name=?, "
+ "local_attached_file_name=?, "
+ "attached_file_send_flg=?, "
+ "data_send_flg=? "
+ "where task_key=?",
dto.getUpdateValues());
return count > 0;
}
public boolean isExistSendTaskData(Long operationId) {
return getSendableTaskData(operationId).size() > 0;
}
public List<TaskDirectionsDto> getSendableTaskData(Long operationId) {
StringBuilder sb = new StringBuilder();
sb.append(" select * ");
sb.append(" from t_task_directions ttd ");
sb.append(" inner join ");
sb.append(" t_task tt ");
sb.append(" ON tt.task_key == ttd.task_key ");
sb.append(" WHERE ttd.data_send_flg = 1");
sb.append(" AND tt.operation_id = ?");
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskDirectionsDto.class);
}
public List<TaskDirectionsDto> getSendableTaskData(Long operationId, String taskKey) {
StringBuilder sb = new StringBuilder();
sb.append(" select * ");
sb.append(" from t_task_directions ttd ");
sb.append(" inner join ");
sb.append(" t_task tt ");
sb.append(" ON tt.task_key == ttd.task_key ");
sb.append(" WHERE ttd.data_send_flg = 1");
sb.append(" AND tt.operation_id = ?");
sb.append(" AND tt.task_key = ?");
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId, "" + taskKey}, TaskDirectionsDto.class);
}
}
package jp.agentec.abook.abv.bl.data.dao;
import java.util.List;
import jp.agentec.abook.abv.bl.common.db.Cursor;
import jp.agentec.abook.abv.bl.dto.TaskDirectionsItemsDto;
/**
* Created by leej on 2018/08/31.
*/
public class TaskDirectionsItemsDao extends AbstractDao {
/*package*/ TaskDirectionsItemsDao() {
}
@Override
protected TaskDirectionsItemsDto convert(Cursor cursor) {
TaskDirectionsItemsDto dto = new TaskDirectionsItemsDto();
int column = cursor.getColumnIndex("task_key");
if (column != -1) {
dto.taskKey = cursor.getString(column);
}
column = cursor.getColumnIndex("item_key");
if (column != -1) {
dto.itemKey = cursor.getString(column);
}
column = cursor.getColumnIndex("input_value");
if (column != -1) {
dto.inputValue = cursor.getString(column);
}
return dto;
}
public void insertTaskDirectionsItems(TaskDirectionsItemsDto dto) {
insert("insert into t_task_directions_items (task_key, item_key, input_value) values (?,?,?)", dto.getInsertValues());
}
public List<TaskDirectionsItemsDto> getTaskDirectionsItemByTaskKey(String taskKey) {
return rawQueryGetDtoList("select * from t_task_directions_items where task_key=?", new String[]{"" + taskKey}, TaskDirectionsItemsDto.class);
}
public List<TaskDirectionsItemsDto> getTaskDirectionsItemByOperationId(Long operationId) {
StringBuilder sb = new StringBuilder();
sb.append(" select distinct ttdi.* ");
sb.append(" from t_task_directions_items ttdi ");
sb.append(" inner join ");
sb.append(" t_task tt ");
sb.append(" ON tt.task_key == ttdi.task_key ");
sb.append(" WHERE tt.del_flg = 0");
sb.append(" AND tt.operation_id = ?");
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskDirectionsItemsDto.class);
}
public boolean updateTaskDirectionsItems(TaskDirectionsItemsDto dto) {
long count = update("update t_task_directions_items set input_value=? where item_key=? and task_key=? ", dto.getUpdateValues());
return (count > 0);
}
}
\ No newline at end of file
package jp.agentec.abook.abv.bl.data.dao; package jp.agentec.abook.abv.bl.data.dao;
import java.util.Date;
import java.util.List; import java.util.List;
import jp.agentec.abook.abv.bl.common.db.Cursor; import jp.agentec.abook.abv.bl.common.db.Cursor;
import jp.agentec.abook.abv.bl.dto.TaskReportDto; import jp.agentec.abook.abv.bl.dto.TaskReportDto;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
/** /**
* Created by leej on 2018/09/10. * Created by leej on 2018/09/10.
...@@ -53,13 +56,10 @@ public class TaskReportDao extends AbstractDao { ...@@ -53,13 +56,10 @@ public class TaskReportDao extends AbstractDao {
if (column != -1) { if (column != -1) {
dto.delFlg = toBool(cursor.getInt(column)); dto.delFlg = toBool(cursor.getInt(column));
} }
// #32782 指示者テーブル関連削除 start column = cursor.getColumnIndex("reported_flag");
// TODO append if (column != -1) {
// column = cursor.getColumnIndex("reportor_flag"); dto.reportedFlag = toBool(cursor.getInt(column));
// if (column != -1) { }
// dto.reporterFlag = toBool(cursor.getInt(column));
// }
// #32782 指示者テーブル関連削除 end
return dto; return dto;
} }
...@@ -71,14 +71,14 @@ public class TaskReportDao extends AbstractDao { ...@@ -71,14 +71,14 @@ public class TaskReportDao extends AbstractDao {
+ "attached_file_name, " + "attached_file_name, "
+ "local_attached_file_name, " + "local_attached_file_name, "
+ "attached_file_send_flg, " + "attached_file_send_flg, "
+ "data_send_flg) " + "data_send_flg, "
// #32782 指示者テーブル関連削除 start + "task_report_id, "
// TODO append + "task_report_info_id, "
// + "reporter_flag) " + "report_start_date, "
+ "report_end_date, "
+ "reported_flg) "
+ "values " + "values "
// + "(?,?,?,?,?,?,?)", + "(?,?,?,?,?,?,?,?,?,?,?)",
+ "(?,?,?,?,?,?)",
// #32782 指示者テーブル関連削除 end
dto.getInsertValues()); dto.getInsertValues());
} }
...@@ -91,11 +91,28 @@ public class TaskReportDao extends AbstractDao { ...@@ -91,11 +91,28 @@ public class TaskReportDao extends AbstractDao {
sb.append(" ON tt.task_key == ttr.task_key "); sb.append(" ON tt.task_key == ttr.task_key ");
sb.append(" WHERE tt.del_flg = 0"); sb.append(" WHERE tt.del_flg = 0");
sb.append(" AND tt.operation_id = ?"); sb.append(" AND tt.operation_id = ?");
sb.append(" ORDER BY task_report_id ASC, report_start_date ASC");
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskReportDto.class); return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskReportDto.class);
} }
public TaskReportDto getTaskReport(String taskKey) {
return rawQueryGetDto("select * from t_task_report where task_key=?", new String[]{"" + taskKey}, TaskReportDto.class); /**
* 作業キーと作業報告タイプで作業報告データ取得
* @param taskKey
* @param taskReportLevel
* @return
*/
public TaskReportDto getTaskReport(String taskKey, Integer taskReportLevel) {
return rawQueryGetDto("select * from t_task_report where task_key=? AND task_report_level=?", new String[]{ "" + taskKey, "" + taskReportLevel }, TaskReportDto.class);
}
/**
* 作業キーで報告リストを取得
* @param taskKey
* @return
*/
public List<TaskReportDto> getTaskReportListByTaskKey(String taskKey) {
return rawQueryGetDtoList("select * from t_task_report where task_key=? ORDER BY task_report_id, report_start_date", new String[]{ "" + taskKey }, TaskReportDto.class);
} }
public boolean update(TaskReportDto dto) { public boolean update(TaskReportDto dto) {
...@@ -105,11 +122,12 @@ public class TaskReportDao extends AbstractDao { ...@@ -105,11 +122,12 @@ public class TaskReportDao extends AbstractDao {
+ "attached_file_name=?, " + "attached_file_name=?, "
+ "local_attached_file_name=?, " + "local_attached_file_name=?, "
+ "attached_file_send_flg=?, " + "attached_file_send_flg=?, "
+ "data_send_flg=? " + "data_send_flg=?, "
// #32782 指示者テーブル関連削除 start + "task_report_id=?, "
// TODO append + "task_report_info_id=?, "
// + "reporter_flag=? " + "report_start_date=?, "
// #32782 指示者テーブル関連削除 end + "report_end_date=?, "
+ "reported_flg=? "
+ "where task_key=?", + "where task_key=?",
dto.getUpdateValues()); dto.getUpdateValues());
return count > 0; return count > 0;
...@@ -137,11 +155,15 @@ public class TaskReportDao extends AbstractDao { ...@@ -137,11 +155,15 @@ public class TaskReportDao extends AbstractDao {
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskReportDto.class); return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskReportDto.class);
} }
// #32782 指示者テーブル関連削除 start
// TODO append /**
// public List<TaskReportDto> getSendableTaskData(Long operationId, String taskKey, boolean reporterFlag) { * 送信フラグがtrueのデータを取得
public List<TaskReportDto> getSendableTaskData(Long operationId, String taskKey) { * @param operationId
// #32782 指示者テーブル関連削除 end * @param taskKey
* @param taskReportLevel
* @return
*/
public List<TaskReportDto> getSendableTaskData(Long operationId, String taskKey, int taskReportLevel) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(" select * "); sb.append(" select * ");
sb.append(" from t_task_report ttr "); sb.append(" from t_task_report ttr ");
...@@ -151,30 +173,139 @@ public class TaskReportDao extends AbstractDao { ...@@ -151,30 +173,139 @@ public class TaskReportDao extends AbstractDao {
sb.append(" WHERE ttr.data_send_flg = 1"); sb.append(" WHERE ttr.data_send_flg = 1");
sb.append(" AND tt.operation_id = ?"); sb.append(" AND tt.operation_id = ?");
sb.append(" AND tt.task_key = ?"); sb.append(" AND tt.task_key = ?");
// #32782 指示者テーブル関連削除 start sb.append(" AND ttr.task_report_level = ?");
// TODO append return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId, "" + taskKey, "" + taskReportLevel}, TaskReportDto.class);
// sb.append(" AND ttr.repertor_flag = ?");
// return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId, "" + taskKey, "" + reporterFlag}, TaskReportDto.class);
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId, "" + taskKey}, TaskReportDto.class);
// #32782 指示者テーブル関連削除 end
} }
// #32926 作業報告画面改善 start /**
// taskReportLevel によって添付ファイルを取得する *
public String getTaskReportAttachedFileName(String taskKey, String taskReportLevel) { * taskReportLevel によって添付ファイル名を取得する
return rawQueryGetString("select local_attached_file_name from t_task_report where task_key=?", new String[]{"" + taskKey, "" + taskReportLevel}); * @param taskKey
* @param taskReportLevel
* @return
*/
public String getTaskReportAttachedFileName(String taskKey, int taskReportLevel) {
return rawQueryGetString("select local_attached_file_name from t_task_report where task_key=? AND task_report_level=?", new String[]{"" + taskKey, "" + taskReportLevel});
} }
// #32926 作業報告画面改善 end
public List<TaskReportDto> selectByTaskKey(String taskKey) { public List<TaskReportDto> selectByTaskKey(String taskKey, int taskReportLevel) {
return rawQueryGetDtoList("select * from t_task_report where task_key=?", new String[]{ taskKey }, TaskReportDto.class); return rawQueryGetDtoList("select * from t_task_report where task_key=? and task_report_level", new String[]{ "" + taskKey, "" + taskReportLevel }, TaskReportDto.class);
} }
public List<TaskReportDto> selectAll() { public List<TaskReportDto> selectAll() {
return rawQueryGetDtoList("select * from t_task_report", null, TaskReportDto.class); return rawQueryGetDtoList("select * from t_task_report", null, TaskReportDto.class);
} }
public void deleteAll() { /**
delete("t_task_report", null, null); * データの存在チェック
* @param taskKey
* @param taskReportLevel
* @return
*/
public boolean isExistTaskReport(String taskKey, Integer taskReportLevel) {
return rawQueryGetInt("select COUNT(*) from t_task_report where task_key=? AND task_report_level=?", new String[]{"" + taskKey, "" + taskReportLevel }) > 0;
}
/**
* 定期点検用の報告更新
* @param dto
* @return
*/
public boolean updateRoutineTask(TaskReportDto dto) {
long count = update("update t_task_report "
+ "set "
+ "report_end_date=?, "
+ "attached_file_name=?, "
+ "local_attached_file_name=?, "
+ "json_data=?, "
+ "data_send_flag=?, "
+ "attached_file_send_flag=? "
+ "reported_flag=? "
+ "where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?)",
new Object[]{dto.reportEndDate, dto.attachedFileName, dto.localAttachedFileName, dto.jsonData, dto.dataSendFlg, dto.attachedFileSendFlg, dto.reportedFlag, dto.taskKey, dto.taskReportId, dto.reportStartDate});
return count > 0;
}
/**
* テーブル物理削除(定期点検専用)
* @param dto
*/
public void deleteRoutineTaskReport(TaskReportDto dto) {
delete("t_task_report", "task_key=? and task_report_level=? task_report_id=? and datetime(report_start_date)=datetime(?, 'utc')", new String[] { dto.taskKey, "" + dto.taskReportLevel, "" + dto.taskReportId, DateTimeUtil.toString(dto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen) });
}
/**
* 定期点検報告データで最後の時間データ取得
* @param operationId
* @return
*/
public TaskReportDto getLastRoutineTaskReportData(long operationId) {
StringBuilder sb = new StringBuilder();
sb.append(" select tr.* ");
sb.append(" from t_task_report tr ");
sb.append(" inner join ");
sb.append(" t_task tt ");
sb.append(" ON tr.task_key == tt.task_key");
sb.append(" WHERE tt.operation_id = ? ORDER BY tr.report_start_date DESC LIMIT 1");
List<TaskReportDto> dtoList = rawQueryGetDtoList(sb.toString(), new String[]{ "" + operationId }, TaskReportDto.class);
if (dtoList != null && dtoList.size() > 0) {
return dtoList.get(0);
} else {
TaskReportDto dto = new TaskReportDto();
dto.taskReportId = 0;
return dto;
}
}
/**
* 定期点検の報告データ取得
* @param taskKey
* @param taskReportId
* @param reportStartDate
* @return
*/
public TaskReportDto getRoutineTaskReportUtc(String taskKey, int taskReportId, String reportStartDate){
return rawQueryGetDto("select * from t_task_report where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?, 'utc')", new String[]{ taskKey, "" + taskReportId, reportStartDate }, TaskReportDto.class);
}
/**
* 定期点検のSQL専用のため、taskReportId, report_start_dateが存在するデータの条件追加
* @param operationId
* @return
*/
public boolean existsToDoRoutineTaskReportData(long operationId) {
String currDate = DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMddHHmmss_hyphen);
StringBuilder sb = new StringBuilder();
sb.append(" select count(*) ");
sb.append(" from t_task_report tr ");
sb.append(" inner join t_task tt ON tt.task_key == tr.task_key ");
sb.append(" WHERE tt.del_flg = 0 ");
sb.append(" AND tt.operation_id = ? ");
// 定期点検のみ
sb.append(" AND tr.task_report_id != 0");
sb.append(" AND tr.report_start_date IS NOT NULL");
sb.append(" AND datetime(report_end_date) >= datetime(?, 'utc') ");
return rawQueryGetInt(sb.toString(), new String[]{ "" + operationId, currDate }) > 0;
}
/**
* 定期点検報告の添付zipファイル名を取得
* @param taskKey
* @param taskReportId
* @param reportStartDate
* @return
*/
public String getRoutineTaskReportAttachedFileName(String taskKey, int taskReportId, String reportStartDate) {
return rawQueryGetString("select local_attached_file_name from t_inspect_task_report where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?)", new String[]{ taskKey, "" + taskReportId, reportStartDate });
}
/**
* 作業キーで作業時間が存在する作業報告データ取得(定期点検)
* @param taskKey
* @return
*/
public List<TaskReportDto> getNotNullStartDateTaskReportByTaskKey(String taskKey) {
return rawQueryGetDtoList("select * from t_task_report where task_key=? AND report_start_date IS NOT NULL", new String[]{ taskKey }, TaskReportDto.class);
} }
} }
...@@ -22,6 +22,12 @@ public class TaskReportItemsDao extends AbstractDao { ...@@ -22,6 +22,12 @@ public class TaskReportItemsDao extends AbstractDao {
if (column != -1) { if (column != -1) {
dto.taskKey = cursor.getString(column); dto.taskKey = cursor.getString(column);
} }
column = cursor.getColumnIndex("task_report_level");
if (column != -1) {
dto.taskReportLevel = cursor.getInt(column);
}
column = cursor.getColumnIndex("item_key"); column = cursor.getColumnIndex("item_key");
if (column != -1) { if (column != -1) {
dto.itemKey = cursor.getString(column); dto.itemKey = cursor.getString(column);
...@@ -35,11 +41,11 @@ public class TaskReportItemsDao extends AbstractDao { ...@@ -35,11 +41,11 @@ public class TaskReportItemsDao extends AbstractDao {
} }
public void insertTaskReportItems(TaskReportItemsDto dto) { public void insertTaskReportItems(TaskReportItemsDto dto) {
insert("insert into t_task_report_items (task_key, item_key, input_value) values (?,?,?)", dto.getInsertValues()); insert("insert into t_task_report_items (task_key, task_report_level, item_key, input_value) values (?,?,?,?)", dto.getInsertValues());
} }
public List<TaskReportItemsDto> getTaskReportItemByTaskKey(String taskKey) { public List<TaskReportItemsDto> getTaskReportItemByTaskKey(String taskKey, int taskReportLevel) {
return rawQueryGetDtoList("select * from t_task_report_items where task_key=?", new String[]{"" + taskKey}, TaskReportItemsDto.class); return rawQueryGetDtoList("select * from t_task_report_items where task_key=? and task_report_level=?", new String[]{"" + taskKey, "" + taskReportLevel}, TaskReportItemsDto.class);
} }
public List<TaskReportItemsDto> getTaskReportItemByOperationId(Long operationId) { public List<TaskReportItemsDto> getTaskReportItemByOperationId(Long operationId) {
...@@ -55,7 +61,7 @@ public class TaskReportItemsDao extends AbstractDao { ...@@ -55,7 +61,7 @@ public class TaskReportItemsDao extends AbstractDao {
} }
public boolean updateTaskReportItems(TaskReportItemsDto dto) { public boolean updateTaskReportItems(TaskReportItemsDto dto) {
long count = update("update t_task_report_items set input_value=? where item_key=? and task_key=? ", dto.getUpdateValues()); long count = update("update t_task_report_items set input_value=? where task_report_level=? and item_key=? and task_key=? ", dto.getUpdateValues());
return (count > 0); return (count > 0);
} }
} }
\ No newline at end of file
package jp.agentec.abook.abv.bl.data.dao;
import java.util.List;
import jp.agentec.abook.abv.bl.common.db.Cursor;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.dto.TaskWorkerGroupDto;
import jp.agentec.abook.abv.bl.dto.WorkerGroupDto;
/**
* Created by leej on 2019/03/19.
*/
public class TaskWorkerGroupDao extends AbstractDao {
private static final String TAG = "TaskReportDao";
/*package*/ TaskWorkerGroupDao() {
}
@Override
protected TaskWorkerGroupDto convert(Cursor cursor) {
TaskWorkerGroupDto dto = new TaskWorkerGroupDto();
int column = cursor.getColumnIndex("task_report_level");
if (column != -1) {
dto.taskReportLevel = cursor.getInt(column);
}
column = cursor.getColumnIndex("operation_id");
if (column != -1) {
dto.operationId = cursor.getLong(column);
}
column = cursor.getColumnIndex("group_id");
if (column != -1) {
dto.groupId = cursor.getInt(column);
}
column = cursor.getColumnIndex("group_name");
if (column != -1) {
dto.groupName = cursor.getString(column);
}
return dto;
}
public void insert(TaskWorkerGroupDto dto) {
insert("insert into r_task_worker_group "
+ "(task_report_level, "
+ "operation_id, "
+ "group_id ) "
+ "values "
+ "(?,?,?)",
dto.getInsertValues());
}
/**
* 作業に紐づいた作業担当グループを削除
* @param operationId
*/
public void deleteByOperationId(Long operationId) {
delete("r_task_worker_group", "operation_id=?", new String[]{""+ operationId});
}
/**
* 作業IDに紐づいた作業担当グループを取得
* inner joing m_worker_group(作業名取得)
* @param operationId
* @return
*/
public List<TaskWorkerGroupDto> getTaskWorkerGroupByOperationId(Long operationId) {
StringBuffer sql = new StringBuffer();
sql.append(" SELECT rtwg.task_report_level, rtwg.operation_id, rtwg.group_id, mwg.group_name ");
sql.append(" FROM r_task_worker_group AS rtwg ");
sql.append(" INNER JOIN m_worker_group AS mwg ");
sql.append(" ON rtwg.group_id = mwg.group_id ");
sql.append(" WHERE rtwg.operation_id = ? ");
sql.append(" ORDER BY rtwg.task_report_level DESC ");
Logger.v(TAG, "sql=%s", sql);
return rawQueryGetDtoList(sql.toString(), new String[]{""+ operationId}, TaskWorkerGroupDto.class);
}
}
...@@ -59,13 +59,44 @@ public class WorkerGroupDao extends AbstractDao { ...@@ -59,13 +59,44 @@ public class WorkerGroupDao extends AbstractDao {
return count > 0; return count > 0;
} }
public boolean delete(WorkerGroupDto dto) { /**
long ret = delete("m_worker_group", "group_id=?", dto.getKeyValues()); * 作業グループ削除
return ret > 0; * @param dto
*/
public void delete(WorkerGroupDto dto) {
delete("r_task_worker_group", "group_id=?", dto.getKeyValues());
delete("m_worker_group", "group_id=?", dto.getKeyValues());
}
/**
* グループIDで削除
* @param groupId
* @return
*/
public void deleteById(Integer groupId) {
String[] keyValue = new String[]{""+ groupId};
delete("r_task_worker_group", "group_id=?", keyValue);
delete("m_worker_group", "group_id=?", keyValue);
} }
public void deleteAll() { public void deleteAll() {
delete("m_worker_group", null, null); delete("m_worker_group", null, null);
} }
/**
* グループIDで存在チェック
* @param groupId
* @return
*/
public boolean isExist(Integer groupId) {
return rawQueryGetInt("select COUNT(*) from m_worker_group where group_id=?", new String[]{"" + groupId }) > 0;
}
/**
* 全てのグループID取得
* @return
*/
public List<Integer> getAllWorkerGroupId() {
return rawQueryGetIntegerList("select group_id from m_worker_group order by group_id", null);
}
} }
\ No newline at end of file
...@@ -25,7 +25,7 @@ public class ROperationContent extends SQLiteTableScript { ...@@ -25,7 +25,7 @@ public class ROperationContent extends SQLiteTableScript {
sql.append(" , content_id BIGINT NOT NULL "); sql.append(" , content_id BIGINT NOT NULL ");
sql.append(" , operation_content_flg BOOLEAN NOT NULL DEFAULT 0 "); sql.append(" , operation_content_flg BOOLEAN NOT NULL DEFAULT 0 ");
sql.append(" , PRIMARY KEY (operation_id, content_id) "); sql.append(" , PRIMARY KEY (operation_id, content_id) ");
sql.append(" , FOREIGN KEY (operation_id) REFERENCES t_project (operation_id) "); sql.append(" , FOREIGN KEY (operation_id) REFERENCES t_operation (operation_id) ");
sql.append(" , FOREIGN KEY (content_id) REFERENCES t_content (content_id)"); sql.append(" , FOREIGN KEY (content_id) REFERENCES t_content (content_id)");
sql.append(" ) "); sql.append(" ) ");
......
...@@ -4,15 +4,14 @@ import java.util.ArrayList; ...@@ -4,15 +4,14 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase; import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
import jp.agentec.abook.abv.bl.data.DatabaseVersions;
/** /**
* Created by leej on 2018/08/31. * Created by leej on 2019/03/18.
*/ */
public class TTaskDirectionsItems extends SQLiteTableScript { public class RTaskWorkerGroup extends SQLiteTableScript {
public TTaskDirectionsItems() { public RTaskWorkerGroup() {
super(); super();
} }
...@@ -21,10 +20,13 @@ public class TTaskDirectionsItems extends SQLiteTableScript { ...@@ -21,10 +20,13 @@ public class TTaskDirectionsItems extends SQLiteTableScript {
List<String> ddl = new ArrayList<String>(); List<String> ddl = new ArrayList<String>();
StringBuffer sql = new StringBuffer(); StringBuffer sql = new StringBuffer();
sql.append(" CREATE TABLE t_task_directions_items ( "); sql.append(" CREATE TABLE r_task_worker_group ( ");
sql.append(" task_key TEXT NOT NULL "); sql.append(" task_report_level INTEGER default 0 ");
sql.append(" , item_key VARCHAR(64) "); sql.append(" , operation_id BIGINT NOT NULL ");
sql.append(" , input_value VARCHAR(64) "); sql.append(" , group_id INTEGER NOT NULL ");
sql.append(" , PRIMARY KEY (task_report_level, operation_id, group_id) ");
sql.append(" , FOREIGN KEY (operation_id) REFERENCES t_operation (operation_id) ");
sql.append(" , FOREIGN KEY (group_id) REFERENCES m_worker_group (group_id)");
sql.append(" ) "); sql.append(" ) ");
ddl.add(sql.toString()); ddl.add(sql.toString());
...@@ -41,4 +43,4 @@ public class TTaskDirectionsItems extends SQLiteTableScript { ...@@ -41,4 +43,4 @@ public class TTaskDirectionsItems extends SQLiteTableScript {
public List<String> getMigrationScript(SQLiteDatabase databaseConnection, int oldVersion, int newVersion, Object[] params) { public List<String> getMigrationScript(SQLiteDatabase databaseConnection, int oldVersion, int newVersion, Object[] params) {
return null; return null;
} }
} }
\ No newline at end of file
...@@ -21,7 +21,7 @@ public class TOperation extends SQLiteTableScript { ...@@ -21,7 +21,7 @@ public class TOperation extends SQLiteTableScript {
List<String> ddl = new ArrayList<String>(); List<String> ddl = new ArrayList<String>();
StringBuffer sql = new StringBuffer(); StringBuffer sql = new StringBuffer();
sql.append(" CREATE TABLE t_project ( "); sql.append(" CREATE TABLE t_operation ( ");
sql.append(" operation_id BIGINT NOT NULL "); sql.append(" operation_id BIGINT NOT NULL ");
sql.append(" , operation_name VARCHAR(128) "); sql.append(" , operation_name VARCHAR(128) ");
sql.append(" , operation_type INTEGER NOT NULL "); sql.append(" , operation_type INTEGER NOT NULL ");
...@@ -32,10 +32,11 @@ public class TOperation extends SQLiteTableScript { ...@@ -32,10 +32,11 @@ public class TOperation extends SQLiteTableScript {
sql.append(" , content_creating_flg INTEGER NOT NULL "); sql.append(" , content_creating_flg INTEGER NOT NULL ");
sql.append(" , edit_lock_flg BOOLEAN NOT NULL DEFAULT 0 "); sql.append(" , edit_lock_flg BOOLEAN NOT NULL DEFAULT 0 ");
sql.append(" , need_sync_flg BOOLEAN NOT NULL DEFAULT 0 "); sql.append(" , need_sync_flg BOOLEAN NOT NULL DEFAULT 0 ");
sql.append(" , report_update_type INTEGER NOT NULL DEFAULT 0 "); sql.append(" , report_type INTEGER NOT NULL DEFAULT 0 ");
sql.append(" , operation_report_type INTEGER NOT NULL DEFAULT 0 ");
sql.append(" , report_cycle INTEGER NOT NULL DEFAULT 0 "); sql.append(" , report_cycle INTEGER NOT NULL DEFAULT 0 ");
sql.append(" , enable_report_update INTEGER NOT NULL DEFAULT 0 "); sql.append(" , enable_report_update INTEGER NOT NULL DEFAULT 0 ");
sql.append(" , enable_report_history SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , enable_report_edit SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , PRIMARY KEY (operation_id) "); sql.append(" , PRIMARY KEY (operation_id) ");
sql.append(" ) "); sql.append(" ) ");
ddl.add(sql.toString()); ddl.add(sql.toString());
...@@ -52,13 +53,13 @@ public class TOperation extends SQLiteTableScript { ...@@ -52,13 +53,13 @@ public class TOperation extends SQLiteTableScript {
// } // }
// //
// if (oldVersion < DatabaseVersions.Plus_1_9_3_5) { // カラムの追加 // if (oldVersion < DatabaseVersions.Plus_1_9_3_5) { // カラムの追加
// ddl.add(" ALTER TABLE t_project ADD COLUMN report_update_type INTEGER NOT NULL DEFAULT 0 "); // ddl.add(" ALTER TABLE t_operation ADD COLUMN report_update_type INTEGER NOT NULL DEFAULT 0 ");
// } // }
// //
// if (oldVersion < DatabaseVersions.Plus_1_9_4) { // カラムの追加 // if (oldVersion < DatabaseVersions.Plus_1_9_4) { // カラムの追加
// ddl.add(" ALTER TABLE t_project ADD COLUMN project_report_type INTEGER NOT NULL DEFAULT 0 "); // ddl.add(" ALTER TABLE t_operation ADD COLUMN project_report_type INTEGER NOT NULL DEFAULT 0 ");
// ddl.add(" ALTER TABLE t_project ADD COLUMN report_cycle INTEGER NOT NULL DEFAULT 0 "); // ddl.add(" ALTER TABLE t_operation ADD COLUMN report_cycle INTEGER NOT NULL DEFAULT 0 ");
// ddl.add(" ALTER TABLE t_project ADD COLUMN enable_report_update INTEGER NOT NULL DEFAULT 0 "); // ddl.add(" ALTER TABLE t_operation ADD COLUMN enable_report_update INTEGER NOT NULL DEFAULT 0 ");
// } // }
// return ddl; // return ddl;
return null; return null;
......
...@@ -27,7 +27,7 @@ public class TPushMessage extends SQLiteTableScript { ...@@ -27,7 +27,7 @@ public class TPushMessage extends SQLiteTableScript {
sql.append(" , push_message TEXT "); sql.append(" , push_message TEXT ");
sql.append(" , reading_flg BOOLEAN NOT NULL DEFAULT 0 "); sql.append(" , reading_flg BOOLEAN NOT NULL DEFAULT 0 ");
sql.append(" , PRIMARY KEY (push_message_id) "); sql.append(" , PRIMARY KEY (push_message_id) ");
sql.append(" , FOREIGN KEY (operation_id) REFERENCES t_project (operation_id) "); sql.append(" , FOREIGN KEY (operation_id) REFERENCES t_operation (operation_id) ");
sql.append(" ) "); sql.append(" ) ");
ddl.add(sql.toString()); ddl.add(sql.toString());
......
package jp.agentec.abook.abv.bl.data.tables;
import java.util.ArrayList;
import java.util.List;
import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
import jp.agentec.abook.abv.bl.data.DatabaseVersions;
/**
* Created by seo-y on 2018/12/17.
*/
public class TRoutineTaskReport extends SQLiteTableScript {
public TRoutineTaskReport() {
super();
}
@Override
public List<String> getCreateScript(int version) {
List<String> ddl = new ArrayList<String>();
StringBuffer sql = new StringBuffer();
sql.append(" CREATE TABLE IF NOT EXISTS t_inspect_task_report ( ");
sql.append(" task_key TEXT NOT NULL ");
sql.append(" , task_report_id INTEGER NOT NULL DEFAULT 0 ");
sql.append(" , task_report_info_id INTEGER NOT NULL DEFAULT 0 ");
sql.append(" , report_start_date DATETIME NOT NULL ");
sql.append(" , report_end_date DATETIME ");
sql.append(" , attached_file_name TEXT ");
sql.append(" , local_attached_file_name TEXT ");
sql.append(" , json_data TEXT ");
sql.append(" , data_send_flag BOOLEAN DEFAULT 0 ");
sql.append(" , attached_file_send_flag BOOLEAN DEFAULT 0 ");
sql.append(" , reported_flag BOOLEAN DEFAULT 0 ");
sql.append(" ) ");
ddl.add(sql.toString());
return ddl;
}
@Override
public List<String> getUpgradeScript(int oldVersion, int newVersion) {
return null;
}
@Override
public List<String> getMigrationScript(SQLiteDatabase databaseConnection, int oldVersion, int newVersion, Object[] params) {
return null;
}
}
package jp.agentec.abook.abv.bl.data.tables;
import java.util.ArrayList;
import java.util.List;
import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
import jp.agentec.abook.abv.bl.data.DatabaseVersions;
/**
* Created by leej on 2018/08/31.
*/
public class TTaskDirections extends SQLiteTableScript {
public TTaskDirections() {
super();
}
@Override
public List<String> getCreateScript(int version) {
List<String> ddl = new ArrayList<String>();
StringBuffer sql = new StringBuffer();
sql.append(" CREATE TABLE t_task_directions ( ");
sql.append(" task_key TEXT NOT NULL ");
sql.append(" , json_data TEXT NOT NULL ");
sql.append(" , attached_file_name TEXT ");
sql.append(" , local_attached_file_name TEXT ");
sql.append(" , attached_file_send_flg BOOLEAN DEFAULT 0 ");
sql.append(" , data_send_flg BOOLEAN DEFAULT 0 ");
sql.append(" ) ");
ddl.add(sql.toString());
return ddl;
}
@Override
public List<String> getUpgradeScript(int oldVersion, int newVersion) {
return null;
}
@Override
public List<String> getMigrationScript(SQLiteDatabase databaseConnection, int oldVersion, int newVersion, Object[] params) {
return null;
}
}
...@@ -28,10 +28,13 @@ public class TTaskReport extends SQLiteTableScript { ...@@ -28,10 +28,13 @@ public class TTaskReport extends SQLiteTableScript {
sql.append(" , local_attached_file_name TEXT "); sql.append(" , local_attached_file_name TEXT ");
sql.append(" , attached_file_send_flg BOOLEAN DEFAULT 0 "); sql.append(" , attached_file_send_flg BOOLEAN DEFAULT 0 ");
sql.append(" , data_send_flg BOOLEAN DEFAULT 0 "); sql.append(" , data_send_flg BOOLEAN DEFAULT 0 ");
// #32782 指示者テーブル関連削除 start sql.append(" , report_start_date DATETIME ");
// TODO append sql.append(" , report_end_date DATETIME ");
// sql.append(" , reporter_flag BOOLEAN DEFAULT 0 "); sql.append(" , task_report_id INTEGER NOT NULL DEFAULT 0 ");
// #32782 指示者テーブル関連削除 end sql.append(" , task_report_info_id INTEGER NOT NULL DEFAULT 0 ");
sql.append(" , enable_report SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , task_report_level SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , reported_flg BOOLEAN DEFAULT 0 ");
sql.append(" ) "); sql.append(" ) ");
ddl.add(sql.toString()); ddl.add(sql.toString());
......
...@@ -23,6 +23,7 @@ public class TTaskReportItems extends SQLiteTableScript { ...@@ -23,6 +23,7 @@ public class TTaskReportItems extends SQLiteTableScript {
sql.append(" CREATE TABLE t_task_report_items ( "); sql.append(" CREATE TABLE t_task_report_items ( ");
sql.append(" task_key TEXT NOT NULL "); sql.append(" task_key TEXT NOT NULL ");
sql.append(" , task_report_level INTEGER default 0 ");
sql.append(" , item_key VARCHAR(64) "); sql.append(" , item_key VARCHAR(64) ");
sql.append(" , input_value VARCHAR(64) "); sql.append(" , input_value VARCHAR(64) ");
sql.append(" ) "); sql.append(" ) ");
......
...@@ -23,16 +23,16 @@ public class OperationDto extends AbstractDto { ...@@ -23,16 +23,16 @@ public class OperationDto extends AbstractDto {
public List<OperationContentDto> operationContentDtoList; public List<OperationContentDto> operationContentDtoList;
public List<TaskDto> taskDtoList; public List<TaskDto> taskDtoList;
public List<PushMessageDto> pushMessageList; public List<PushMessageDto> pushMessageList;
public int reportUpdateType; //0:履歴無し 1:新規追加 2:更新 public int reportType; //0:通常 1:定期点検
public int operationReportType; //0:通常 1:定期点検
public int reportCycle; //0:日次 1:月次 2:年次 public int reportCycle; //0:日次 1:月次 2:年次
public int enableReportUpdate; //0:不可 1:可 public int enableReportUpdate; //0:不可 1:可
public String reportPeriod; //定期点検、2018/12/20 08:10:00 ~ 2018/12/21 18:10:00 public String reportPeriod; //定期点検、2018/12/20 08:10:00 ~ 2018/12/21 18:10:00
public int reportCount; //定期点検、作業数 public int reportCount; //定期点検、作業数
public int enableReportHistory; // 0: 履歴無し, 1: 履歴可
public int enableReportEdit; // 作業編集可能区分
// #32926 作業報告画面改善 start // 作業担当グループリスト
public int reportType; // 作業報告タイプ 0:報告 1:定期点検 2:報告(回答) public List<TaskWorkerGroupDto> taskWorkerGroupDtoList;
// #32926 作業報告画面改善 end
public boolean equalsLastEdit(OperationDto dto) { public boolean equalsLastEdit(OperationDto dto) {
if (dto != null) { if (dto != null) {
...@@ -45,12 +45,12 @@ public class OperationDto extends AbstractDto { ...@@ -45,12 +45,12 @@ public class OperationDto extends AbstractDto {
@Override @Override
public Object[] getInsertValues() { public Object[] getInsertValues() {
return new Object[] { operationId, operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportUpdateType, operationReportType, reportCycle, enableReportUpdate }; return new Object[] { operationId, operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit };
} }
@Override @Override
public Object[] getUpdateValues() { public Object[] getUpdateValues() {
return new Object[] { operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportUpdateType, operationReportType, reportCycle, enableReportUpdate, operationId }; return new Object[] { operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, operationId };
} }
@Override @Override
......
package jp.agentec.abook.abv.bl.dto;
/**
* Created by leej on 2018/08/31.
*/
public class TaskDirectionsDto extends AbstractDto {
public String taskKey;
public String jsonData;
public String attachedFileName;
public String localAttachedFileName;
public boolean attachedFileSendFlg;
public boolean dataSendFlg;
public String taskHotSpotInfo;
public boolean delFlg;
@Override
public Object[] getInsertValues() {
return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg };
}
@Override
public Object[] getUpdateValues() {
return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskKey };
}
@Override
public String[] getKeyValues() {
return new String[] { "" + taskKey };
}
}
package jp.agentec.abook.abv.bl.dto;
/**
* Created by leej on 2018/09/03.
*/
public class TaskDirectionsItemsDto extends AbstractDto {
public String taskKey;
public String itemKey;
public String inputValue;
@Override
public String[] getKeyValues() {
return new String[] {""+taskKey};
}
@Override
public Object[] getInsertValues() {
return new Object[] {taskKey, itemKey, inputValue};
}
@Override
public Object[] getUpdateValues() {
return new Object[] { inputValue, itemKey, taskKey };
}
}
\ No newline at end of file
...@@ -14,22 +14,12 @@ public class TaskDto extends AbstractDto { ...@@ -14,22 +14,12 @@ public class TaskDto extends AbstractDto {
public String taskCode; public String taskCode;
public Integer taskStatus; public Integer taskStatus;
public String taskHotSpotInfo; public String taskHotSpotInfo;
public List<TaskReportDto> taskReportDtoList;
public boolean delFlg; public boolean delFlg;
// #32782 指示者テーブル関連削除 start
// TODO TaskDirectionDto から TaskReportDto に変更、taskDirectionsDto 名を変更必要
// public TaskReportDto taskDirectionsDto;
public TaskDirectionsDto taskDirectionsDto;
// #32782 指示者テーブル関連削除 end
public TaskReportDto taskReportDto;
public int taskReportId; public int taskReportId;
public List<RoutineTaskReportDto> RoutineTaskReportList;
// #32926 作業報告画面改善 start
public boolean taskHasAuthority; // タスク別の権限 public boolean taskHasAuthority; // タスク別の権限
public int taskReportLevel; // 作業報告階層
// #32926 作業報告画面改善 end
@Override @Override
public Object[] getInsertValues() { public Object[] getInsertValues() {
......
...@@ -10,41 +10,31 @@ public class TaskReportDto extends AbstractDto { ...@@ -10,41 +10,31 @@ public class TaskReportDto extends AbstractDto {
public String taskKey; public String taskKey;
public String jsonData; public String jsonData;
public String attachedFileName;
public String localAttachedFileName; public String localAttachedFileName;
public boolean attachedFileSendFlg; public boolean attachedFileSendFlg;
public boolean dataSendFlg; public boolean dataSendFlg;
public String taskHotSpotInfo; public String taskHotSpotInfo;
public boolean delFlg; public boolean delFlg;
// #32782 指示者テーブル関連削除 start //  作業報告詳細リスト
public boolean reporterFlag;
public int taskReportLevel; // 作業報告レベル public int taskReportLevel; // 作業報告レベル
public int taskHasAuthority; // 権限
public int taskReportId; // 作業報告ID public int taskReportId; // 作業報告ID
public int taskReportInfoId; // 作業報告情報ID public int taskReportInfoId; // 作業報告情報ID
public Date reportStartDate; // 作業開始日 public Date reportStartDate; // 作業開始日
public Date reportEndDate; // 作業終了日 public Date reportEndDate; // 作業終了日
public int enableReport; // 報告可能区分 public int enableReport; // 報告可能区分
public boolean reportedFlag; // public String attachedFileName;
// #32782 指示者テーブル関連削除 end public String taskReportInfo;
public boolean reportedFlag; // 定期点検用
@Override @Override
public Object[] getInsertValues() { public Object[] getInsertValues() {
// #32782 指示者テーブル関連削除 start return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskReportId, taskReportInfoId, reportStartDate, reportEndDate, reportedFlag};
// TODO change
// return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, reporterFlag };
return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg};
// #32782 指示者テーブル関連削除 end
} }
@Override @Override
public Object[] getUpdateValues() { public Object[] getUpdateValues() {
// #32782 指示者テーブル関連削除 start return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskReportId, taskReportInfoId, reportStartDate, reportEndDate, reportedFlag, taskKey };
// TODO change
// return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, reporterFlag, taskKey };
return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskKey };
// #32782 指示者テーブル関連削除 end
} }
@Override @Override
......
...@@ -7,6 +7,7 @@ package jp.agentec.abook.abv.bl.dto; ...@@ -7,6 +7,7 @@ package jp.agentec.abook.abv.bl.dto;
public class TaskReportItemsDto extends AbstractDto { public class TaskReportItemsDto extends AbstractDto {
public String taskKey; public String taskKey;
public int taskReportLevel;
public String itemKey; public String itemKey;
public String inputValue; public String inputValue;
...@@ -17,11 +18,11 @@ public class TaskReportItemsDto extends AbstractDto { ...@@ -17,11 +18,11 @@ public class TaskReportItemsDto extends AbstractDto {
@Override @Override
public Object[] getInsertValues() { public Object[] getInsertValues() {
return new Object[] {taskKey, itemKey, inputValue}; return new Object[] {taskKey, taskReportLevel, itemKey, inputValue};
} }
@Override @Override
public Object[] getUpdateValues() { public Object[] getUpdateValues() {
return new Object[] { inputValue, itemKey, taskKey }; return new Object[] { inputValue, taskReportLevel, itemKey, taskKey };
} }
} }
\ No newline at end of file
package jp.agentec.abook.abv.bl.dto;
import java.util.List;
/**
* Created by leej on 2019/03/19.
*/
public class TaskWorkerGroupDto extends AbstractDto {
public int taskReportLevel;
public long operationId;
public int groupId;
// inner join 用
public String groupName;
// OperationListJSONで取得用
public List<Integer> groupList;
@Override
public Object[] getInsertValues() {
return new Object[] { taskReportLevel, operationId, groupId};
}
@Override
public String[] getKeyValues() {
return new String[] { "" + operationId };
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_pressed="true"
android:drawable="@drawable/ic_filter_on"/>
<item
android:drawable="@drawable/ic_filter_off"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_pressed="true"
android:drawable="@drawable/ic_sort_on"/>
<item
android:drawable="@drawable/ic_sort_off"/>
</selector>
\ No newline at end of file
...@@ -15,4 +15,6 @@ ...@@ -15,4 +15,6 @@
<dimen name="text_size_large">22sp</dimen> <dimen name="text_size_large">22sp</dimen>
<dimen name="operation_scale_zoom_margin_dp">25dp</dimen> <dimen name="operation_scale_zoom_margin_dp">25dp</dimen>
<dimen name="operation_pin_icon_width">35dp</dimen>
<dimen name="operation_pin_icon_height">60dp</dimen>
</resources> </resources>
...@@ -15,4 +15,6 @@ ...@@ -15,4 +15,6 @@
<dimen name="weather_text_large_size">13sp</dimen> <dimen name="weather_text_large_size">13sp</dimen>
<dimen name="operation_scale_zoom_margin_dp">10dp</dimen> <dimen name="operation_scale_zoom_margin_dp">10dp</dimen>
<dimen name="operation_pin_icon_width">18dp</dimen>
<dimen name="operation_pin_icon_height">23dp</dimen>
</resources> </resources>
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:background="@drawable/icon_sort" /> android:background="@drawable/ic_display_list" />
<ImageButton <ImageButton
android:id="@+id/icon_filter" android:id="@+id/icon_filter"
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:background="@drawable/icon_sort" /> android:background="@drawable/ic_display_list" />
<ImageButton <ImageButton
android:id="@+id/icon_filter" android:id="@+id/icon_filter"
......
package jp.agentec.abook.abv.launcher.android; package jp.agentec.abook.abv.launcher.android;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Stack;
import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.Constant.OperationReportType; import jp.agentec.abook.abv.bl.common.Constant.OperationReportType;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.cl.util.PreferenceUtil; import jp.agentec.abook.abv.cl.util.PreferenceUtil;
...@@ -77,7 +75,8 @@ public class ABVUIDataCache { ...@@ -77,7 +75,8 @@ public class ABVUIDataCache {
} }
public int getViewMode() { public int getViewMode() {
return viewMode; return PreferenceUtil.getUserPref(context, UserPrefKey.VIEW_MODE, 0);
// return viewMode;
} }
public void setViewMode(int viewMode) { public void setViewMode(int viewMode) {
...@@ -141,9 +140,9 @@ public class ABVUIDataCache { ...@@ -141,9 +140,9 @@ public class ABVUIDataCache {
mOperationReportTypes = operationReportTypes; mOperationReportTypes = operationReportTypes;
} else { } else {
mOperationReportTypes = new ArrayList<Integer>(); mOperationReportTypes = new ArrayList<Integer>();
mOperationReportTypes.add(OperationReportType.DEFAULT);
mOperationReportTypes.add(OperationReportType.ROUTINE_TASK);
mOperationReportTypes.add(OperationReportType.REPORT_TYPE); mOperationReportTypes.add(OperationReportType.REPORT_TYPE);
mOperationReportTypes.add(OperationReportType.ROUTINE_TASK);
mOperationReportTypes.add(OperationReportType.REPORT_RESPONSE_TYPE);
} }
return mOperationReportTypes; return mOperationReportTypes;
......
...@@ -107,7 +107,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -107,7 +107,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
public Long mOperationId; public Long mOperationId;
protected int mXWalkOpenType = -1; protected int mXWalkOpenType = -1;
protected int mOperationType; protected int mOperationType;
protected int reportUpdateType; //0:履歴無し 1:新規追加 2:更新 protected int enableReportHistory; //0:履歴無し 1:履歴可
protected String mContentPath; protected String mContentPath;
protected int mStatusCode; protected int mStatusCode;
protected boolean isOperationPdf = false; protected boolean isOperationPdf = false;
...@@ -172,7 +172,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -172,7 +172,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
mStatusCode = 0; mStatusCode = 0;
} }
reportUpdateType = operationDto.reportUpdateType; enableReportHistory = operationDto.enableReportHistory;
linkUrl = intent.getStringExtra("LINKURL"); // LinkURL linkUrl = intent.getStringExtra("LINKURL"); // LinkURL
...@@ -787,7 +787,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -787,7 +787,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
helpViewType = Constant.HelpViewType.ListOperationDirector; helpViewType = Constant.HelpViewType.ListOperationDirector;
break; break;
case Constant.XWalkOpenType.TASK_REPORT: case Constant.XWalkOpenType.TASK_REPORT:
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) {
helpViewType = Constant.HelpViewType.RoutineTaskOperation; helpViewType = Constant.HelpViewType.RoutineTaskOperation;
} else { } else {
helpViewType = Constant.HelpViewType.ListOperationReporter; helpViewType = Constant.HelpViewType.ListOperationReporter;
...@@ -824,7 +824,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -824,7 +824,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) { if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) {
helpViewType = Constant.HelpViewType.DirectorTask; helpViewType = Constant.HelpViewType.DirectorTask;
} else if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) { } else if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) {
helpViewType = Constant.HelpViewType.RoutineTaskOperationReport; helpViewType = Constant.HelpViewType.RoutineTaskOperationReport;
} else { } else {
helpViewType = Constant.HelpViewType.ReportTask; helpViewType = Constant.HelpViewType.ReportTask;
...@@ -855,24 +855,20 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -855,24 +855,20 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
mCmd = abookCheckParam.get(ABookKeys.CMD); mCmd = abookCheckParam.get(ABookKeys.CMD);
mTaskKey = abookCheckParam.get(ABookKeys.TASK_KEY); mTaskKey = abookCheckParam.get(ABookKeys.TASK_KEY);
// #32926 作業報告画面改善 start
int taskReportLevel = 0; // 作業報告レベル(0:報告、1:報告(回答)、2:報告(回答)) int taskReportLevel = 0; // 作業報告レベル(0:報告、1:報告(回答)、2:報告(回答))
if (abookCheckParam.containsKey(ABookKeys.TASK_REPORT_LEVEL)) { if (abookCheckParam.containsKey(ABookKeys.TASK_REPORT_LEVEL)) {
taskReportLevel = Integer.parseInt(abookCheckParam.get(ABookKeys.TASK_REPORT_LEVEL)); // 作業報告レベル taskReportLevel = Integer.parseInt(abookCheckParam.get(ABookKeys.TASK_REPORT_LEVEL)); // 作業報告レベル
} }
// #32926 作業報告画面改善 end
int taskReportId = 0; int taskReportId = 0;
String reportStartDate = ""; String reportStartDate = "";
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK && abookCheckParam.get(ABookKeys.TASK_REPORT_ID) != null && abookCheckParam.get(ABookKeys.REPORT_START_DATE) != null) { if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK && 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);
} }
if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_INSERT_TASK_DIRECTIONS, ABookKeys.CMD_UPDATE_TASK_DIRECTIONS, ABookKeys.CMD_DELETE_TASK_DIRECTIONS, ABookKeys.CMD_CANCEL_TASK_DIRECTIONS, if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_MOVE_HOT_SPOT, ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT,
ABookKeys.CMD_MOVE_HOT_SPOT, ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT, ABookKeys.CMD_DELETE_TASK_REPORT, ABookKeys.CMD_CANCEL_TASK_REPORT, ABookKeys.CMD_DELETE_TASK_REPORT, ABookKeys.CMD_CANCEL_TASK_REPORT, ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT)) {
ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT)) {
boolean isError = false; boolean isError = false;
try { try {
...@@ -881,19 +877,15 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -881,19 +877,15 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
if (isOperationPdf && operationTaskDto != null && StringUtil.equalsAny(mCmd, if (isOperationPdf && operationTaskDto != null && StringUtil.equalsAny(mCmd,
ABookKeys.CMD_INSERT_TASK_DIRECTIONS,
ABookKeys.CMD_UPDATE_TASK_DIRECTIONS,
ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_INSERT_TASK_REPORT,
ABookKeys.CMD_UPDATE_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT,
ABookKeys.CMD_MOVE_HOT_SPOT, ABookKeys.CMD_MOVE_HOT_SPOT,
ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT)) { ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT)) {
String taskCode = ""; String taskCode = "";
// #32781 start if (abookCheckParam.get(ABookKeys.TASK_REPORT) != null) {
// TODO TASK_DIRECTIONSの削除され、TASK_REPORTに変更する JSONObject tastReportJson = new JSONObject(abookCheckParam.get(ABookKeys.TASK_REPORT));
if (abookCheckParam.get(ABookKeys.TASK_DIRECTIONS) != null) { JSONObject taskJson = tastReportJson.getJSONObject(ABookKeys.TASK);
JSONObject direction = new JSONObject(abookCheckParam.get(ABookKeys.TASK_DIRECTIONS));
JSONObject taskJson = direction.getJSONObject(ABookKeys.TASK);
Iterator taskKeys = taskJson.keys(); Iterator taskKeys = taskJson.keys();
while (taskKeys.hasNext()) { while (taskKeys.hasNext()) {
String itemKey = (String) taskKeys.next(); String itemKey = (String) taskKeys.next();
...@@ -902,7 +894,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -902,7 +894,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
} }
} }
// #32781 end
if (abookCheckParam.get(ABookKeys.HOT_SPOT) != null) { if (abookCheckParam.get(ABookKeys.HOT_SPOT) != null) {
JSONObject hotSpot = new JSONObject(abookCheckParam.get(ABookKeys.HOT_SPOT)); JSONObject hotSpot = new JSONObject(abookCheckParam.get(ABookKeys.HOT_SPOT));
...@@ -930,12 +921,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -930,12 +921,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
return null; return null;
} }
}; };
// #32926 作業報告画面改善 start
ABookCheckWebViewHelper.getInstance().doABookCheckParam(ABVContentViewActivity.this, ABookCheckWebViewHelper.getInstance().doABookCheckParam(ABVContentViewActivity.this,
mCmd, mTaskKey, reportUpdateType, abookCheckParam, mOperationId, mContentPath, getContentId(), mCmd, mTaskKey, enableReportHistory, abookCheckParam, mOperationId, mContentPath, getContentId(),
operationDto.reportType == Constant.ReportType.Routine, finishCallback, operationDto.reportType, finishCallback,
taskReportLevel); taskReportLevel);
// #32926 作業報告画面改善 end
} catch(Exception e) { } catch(Exception e) {
Logger.e(TAG, "doABookCheckParam error", e); Logger.e(TAG, "doABookCheckParam error", e);
} }
......
...@@ -34,9 +34,10 @@ public abstract class ABVLoginActivity extends ABVNoAuthenticatedActivity { ...@@ -34,9 +34,10 @@ public abstract class ABVLoginActivity extends ABVNoAuthenticatedActivity {
ABVToastUtil.showMakeText(ABVLoginActivity.this, R.string.fcm_not_supported, Toast.LENGTH_SHORT); ABVToastUtil.showMakeText(ABVLoginActivity.this, R.string.fcm_not_supported, Toast.LENGTH_SHORT);
} }
}); });
} else { // FCMトークンを取得できない場合、noneIdでセットしてログインする
serverLoginAndCheckChangeUser(fcmToken); fcmToken = "noneId";
} }
serverLoginAndCheckChangeUser(fcmToken);
} finally { } finally {
closeProgressPopup(); closeProgressPopup();
} }
......
...@@ -108,9 +108,10 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity { ...@@ -108,9 +108,10 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
String fcmToken = FcmManager.getFcmToken(mContext); String fcmToken = FcmManager.getFcmToken(mContext);
if (fcmToken == null) { if (fcmToken == null) {
ABVToastUtil.showMakeText(mContext, R.string.fcm_not_supported, Toast.LENGTH_SHORT); ABVToastUtil.showMakeText(mContext, R.string.fcm_not_supported, Toast.LENGTH_SHORT);
} else { // FCMトークンを取得できない場合、noneIdでセットしてログインする
noAuthenticatedShowMain(isGuestLogin, fcmToken, urlPath); fcmToken = "noneId";
} }
noAuthenticatedShowMain(isGuestLogin, fcmToken, urlPath);
} }
}); });
} }
......
...@@ -9,7 +9,6 @@ import android.database.Cursor; ...@@ -9,7 +9,6 @@ import android.database.Cursor;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.net.Uri; import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle; import android.os.Bundle;
import android.provider.MediaStore; import android.provider.MediaStore;
import android.util.SparseBooleanArray; import android.util.SparseBooleanArray;
...@@ -52,11 +51,9 @@ import java.util.Arrays; ...@@ -52,11 +51,9 @@ import java.util.Arrays;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.concurrent.CountDownLatch;
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.OperationDataJSON; import jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON;
import jp.agentec.abook.abv.bl.acms.client.json.RoutineTaskDataJSON;
import jp.agentec.abook.abv.bl.acms.client.parameters.GetOperationDataParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.GetOperationDataParameters;
import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType; import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType;
import jp.agentec.abook.abv.bl.acms.type.OperationAuthLevel; import jp.agentec.abook.abv.bl.acms.type.OperationAuthLevel;
...@@ -73,10 +70,8 @@ import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException; ...@@ -73,10 +70,8 @@ import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.ABVDataCache; import jp.agentec.abook.abv.bl.data.ABVDataCache;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao; import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.RoutineTaskReportDao;
import jp.agentec.abook.abv.bl.data.dao.OperationContentDao; import jp.agentec.abook.abv.bl.data.dao.OperationContentDao;
import jp.agentec.abook.abv.bl.data.dao.TaskDao; import jp.agentec.abook.abv.bl.data.dao.TaskDao;
import jp.agentec.abook.abv.bl.data.dao.TaskDirectionsDao;
import jp.agentec.abook.abv.bl.data.dao.TaskReportDao; import jp.agentec.abook.abv.bl.data.dao.TaskReportDao;
import jp.agentec.abook.abv.bl.download.ContentFileExtractor; import jp.agentec.abook.abv.bl.download.ContentFileExtractor;
import jp.agentec.abook.abv.bl.download.ContentZipDownloadNotification; import jp.agentec.abook.abv.bl.download.ContentZipDownloadNotification;
...@@ -152,12 +147,8 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -152,12 +147,8 @@ public class OperationListActivity extends ABVUIActivity {
private Dialog mPanoEntryDialog; private Dialog mPanoEntryDialog;
private OperationContentDao mOperationContentDao = AbstractDao.getDao(OperationContentDao.class); private OperationContentDao mOperationContentDao = AbstractDao.getDao(OperationContentDao.class);
// #32782 指示者テーブル関連削除 start
// TODO delete
private TaskDirectionsDao mTaskDirectionsDao = AbstractDao.getDao(TaskDirectionsDao.class);
// #32782 指示者テーブル関連削除 end
private TaskReportDao mTaskReportDao = AbstractDao.getDao(TaskReportDao.class); private TaskReportDao mTaskReportDao = AbstractDao.getDao(TaskReportDao.class);
private RoutineTaskReportDao mRoutineTaskReportDao = AbstractDao.getDao(RoutineTaskReportDao.class);
private OperationLogic mOperationLogic = AbstractLogic.getLogic(OperationLogic.class); private OperationLogic mOperationLogic = AbstractLogic.getLogic(OperationLogic.class);
private TaskDao mTaskDao = AbstractDao.getDao(TaskDao.class); private TaskDao mTaskDao = AbstractDao.getDao(TaskDao.class);
...@@ -204,9 +195,9 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -204,9 +195,9 @@ public class OperationListActivity extends ABVUIActivity {
vg.addView(child); vg.addView(child);
// ツールバーのビューモードイメージ変更 // ツールバーのビューモードイメージ変更
if (child instanceof PullToRefreshGridView) { if (child instanceof PullToRefreshGridView) {
mViewModeButton.setBackground(getRDrawable(R.drawable.icon_sort)); mViewModeButton.setBackground(getRDrawable(R.drawable.ic_display_list));
} else { } else {
mViewModeButton.setBackground(getRDrawable(R.drawable.btn_view_sub_menu)); mViewModeButton.setBackground(getRDrawable(R.drawable.ic_display_pannel));
} }
} }
} }
...@@ -409,7 +400,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -409,7 +400,7 @@ public class OperationListActivity extends ABVUIActivity {
Logger.d(TAG, "onResume Sync operationId : " + operationId); Logger.d(TAG, "onResume Sync operationId : " + operationId);
if (operationDto != null && operationDto.needSyncFlg) { if (operationDto != null && operationDto.needSyncFlg) {
// 同期処理後、直列処理で新着更新を行う。 // 同期処理後、直列処理で新着更新を行う。
syncOperation(operationId, operationDto.operationReportType); syncOperation(operationId, operationDto.reportType);
} else { } else {
closeProgressPopup(); closeProgressPopup();
} }
...@@ -605,31 +596,11 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -605,31 +596,11 @@ public class OperationListActivity extends ABVUIActivity {
contentPath = ABVEnvironment.getInstance().getPanoImageDirName(ContentFileExtractor.getInstance().getContentCacheDirWithExtract(operationDto.contentId)); contentPath = ABVEnvironment.getInstance().getPanoImageDirName(ContentFileExtractor.getInstance().getContentCacheDirWithExtract(operationDto.contentId));
} }
// 更新タイプが[新規追加]に変わった時の為:残っている作業報告内容削除
if (operationDto.reportUpdateType == Constant.OperationUpdateType.HISTORY_ADD && mOperationAuthLevel == OperationAuthLevel.WORKER) {
final List<TaskReportDto> listTaskReport = mTaskReportDao.selectAll();
if (listTaskReport != null && listTaskReport.size() > 0) {
long operationId = operationDto.operationId;
for (TaskReportDto taskReportDto : listTaskReport) {
// #32926 作業報告画面改善 start
if (taskReportDto.reporterFlag) {
FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskReportDto.taskKey, String.valueOf(taskReportDto.taskReportLevel)));
}
// #32926 作業報告画面改善 end
}
mTaskReportDao.deleteAll();
FileUtil.delete(ABVEnvironment.getInstance().getTempDirPath(operationDto.contentId));
}
}
// プロジェクトの指示/報告表示時、必要なJSONファイル作成 // プロジェクトの指示/報告表示時、必要なJSONファイル作成
mOperationLogic.createJsonForOpenABookCheckPano(operationDto.operationId, operationDto.contentId, contentPath); mOperationLogic.createJsonForOpenABookCheckPano(operationDto.operationId, operationDto.contentId, contentPath);
mOperationLogic.createJsonForOperationContent(operationDto.operationId, 0, contentPath, mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR ? true : false, operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK); mOperationLogic.createJsonForOperationContent(operationDto.operationId, contentPath, operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK);
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) {
mOperationLogic.createJsonForRoutineTaskReport(operationDto.reportCycle, operationDto.enableReportUpdate, mOperationLogic.getLastRoutineTaskReportData(operationDto.operationId).taskReportId, contentPath); mOperationLogic.createJsonForRoutineTaskReport(operationDto.reportCycle, operationDto.enableReportUpdate, mOperationLogic.getLastRoutineTaskReportData(operationDto.operationId).taskReportId, contentPath);
} }
...@@ -648,7 +619,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -648,7 +619,7 @@ public class OperationListActivity extends ABVUIActivity {
Intent intent = new Intent(); Intent intent = new Intent();
intent.putExtra(ABookKeys.CONTENT_ID, operationDto.contentId); intent.putExtra(ABookKeys.CONTENT_ID, operationDto.contentId);
intent.putExtra(ABookKeys.OPERATION_ID, operationDto.operationId); intent.putExtra(ABookKeys.OPERATION_ID, operationDto.operationId);
intent.putExtra(Constant.ABookCheck.XWALK_OPEN_TYPE, mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR ? Constant.XWalkOpenType.TASK_DERECTION : Constant.XWalkOpenType.TASK_REPORT); intent.putExtra(Constant.ABookCheck.XWALK_OPEN_TYPE, Constant.XWalkOpenType.TASK_REPORT);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
if(operationDto.operationType == OperationType.PDF) { if(operationDto.operationType == OperationType.PDF) {
...@@ -674,7 +645,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -674,7 +645,7 @@ public class OperationListActivity extends ABVUIActivity {
if (operationContentDto != null) { if (operationContentDto != null) {
if (notification.downloadStatus == DownloadStatusType.Succeeded) { if (notification.downloadStatus == DownloadStatusType.Succeeded) {
OperationDto operationDto = mOperationLogic.getOperation(operationContentDto.operationId); OperationDto operationDto = mOperationLogic.getOperation(operationContentDto.operationId);
syncOperation(operationContentDto.operationId, operationDto.operationReportType, true); syncOperation(operationContentDto.operationId, operationDto.reportType, true);
} else if (notification.downloadStatus == DownloadStatusType.Failed || notification.downloadStatus == DownloadStatusType.Canceled || notification.downloadStatus == DownloadStatusType.Paused) { } else if (notification.downloadStatus == DownloadStatusType.Failed || notification.downloadStatus == DownloadStatusType.Canceled || notification.downloadStatus == DownloadStatusType.Paused) {
Logger.i(TAG, "syncOperation update is failed downloadStatus : " + notification.downloadStatus); Logger.i(TAG, "syncOperation update is failed downloadStatus : " + notification.downloadStatus);
closeProgressPopup(); closeProgressPopup();
...@@ -694,10 +665,10 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -694,10 +665,10 @@ public class OperationListActivity extends ABVUIActivity {
/** /**
* プロジェクト同期処理 * プロジェクト同期処理
* @param operationId * @param operationId
* @param operationReportType * @param reportType
* @param buttonEventFlag * @param buttonEventFlag
*/ */
public void syncOperation(final long operationId, int operationReportType, boolean buttonEventFlag) { public void syncOperation(final long operationId, int reportType, boolean buttonEventFlag) {
Logger.i(TAG, "---sync start"); Logger.i(TAG, "---sync start");
// ネットワーク通信チェック // ネットワーク通信チェック
if (!ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) { if (!ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) {
...@@ -727,22 +698,18 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -727,22 +698,18 @@ public class OperationListActivity extends ABVUIActivity {
return null; return null;
} }
}; };
if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
mOperationLogic.sendTaskDirectionsData(operationId, null, progressCallback); // 報告送信
} else { if (mOperationLogic.sendTaskReportSendData(operationId, progressCallback)) {
// 作業報告 // 作業報告タイプが定期点検且つ、P005のエラーの場合、以下のエラーをトーストメッセージで表示
if (operationReportType == Constant.OperationReportType.ROUTINE_TASK) { handleErrorMessageToast(R.string.P005);
if (mOperationLogic.sendRoutineTaskReportSendData(operationId, null, progressCallback) > 0) {
handleErrorMessageToast(R.string.P005);
}
} else {
mOperationLogic.sendTaskReportSendData(operationId, null, progressCallback);
}
} }
progressDialogHorizontal.setProgress(60); progressDialogHorizontal.setProgress(60);
// 報告受信
mOperationLastEditDate = receptionTaskData(operationId, progressCallback, buttonEventFlag); mOperationLastEditDate = receptionTaskData(operationId, progressCallback, buttonEventFlag);
if (operationReportType == Constant.OperationReportType.ROUTINE_TASK) { if (reportType == Constant.OperationReportType.ROUTINE_TASK) {
if (buttonEventFlag) { if (buttonEventFlag) {
String dialogMsg = null; String dialogMsg = null;
// 定期点検プロジェクトの利用可能日付を取得 // 定期点検プロジェクトの利用可能日付を取得
...@@ -750,7 +717,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -750,7 +717,7 @@ public class OperationListActivity extends ABVUIActivity {
if (!StringUtil.isNullOrEmpty(avilableDateStr)) { if (!StringUtil.isNullOrEmpty(avilableDateStr)) {
// 利用可能メッセージ // 利用可能メッセージ
dialogMsg = String.format(getString(R.string.msg_routineTask_report_available_from), avilableDateStr); dialogMsg = String.format(getString(R.string.msg_routineTask_report_available_from), avilableDateStr);
} else if (!mRoutineTaskReportDao.existsToDoRoutineTaskReportData(operationId)) { } else if (!mTaskReportDao.existsToDoRoutineTaskReportData(operationId)) {
// 作業データが存在しないメッセージ // 作業データが存在しないメッセージ
dialogMsg = getString(R.string.msg_no_report_data); dialogMsg = getString(R.string.msg_no_report_data);
} }
...@@ -862,277 +829,164 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -862,277 +829,164 @@ public class OperationListActivity extends ABVUIActivity {
OperationDto operationDto = mOperationLogic.getOperation(operationId); OperationDto operationDto = mOperationLogic.getOperation(operationId);
OperationContentDto operationContentDto = mOperationContentDao.getOperationMainContent(operationId); OperationContentDto operationContentDto = mOperationContentDao.getOperationMainContent(operationId);
List<TaskDto> localTaskList = mTaskDao.selectAllTaskByOperationId(operationId); List<TaskDto> localTaskList = mTaskDao.selectAllTaskByOperationId(operationId);
List<RoutineTaskReportDto> localRoutineTaskReportList;
Date lastEditDate; Date lastEditDate;
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) { OperationDataJSON json = AcmsClient.getInstance(ABVDataCache.getInstance().getUrlPath(), ABVEnvironment.getInstance().networkAdapter).getOpereationData(param);
RoutineTaskDataJSON json = AcmsClient.getInstance(ABVDataCache.getInstance().getUrlPath(), ABVEnvironment.getInstance().networkAdapter).getRoutineTaskData(param);
//プログレスを40%進行させるための計算
int progress = 0;
if (json.taskDtoList.size() != 0) {
progress = 40 / json.taskDtoList.size();
}
for (TaskDto serverTaskDto : json.taskDtoList) {
if (isExistsTaskInList(localTaskList, serverTaskDto)) {
mTaskDao.update(serverTaskDto);
} else {
mTaskDao.insert(serverTaskDto);
}
localRoutineTaskReportList = mRoutineTaskReportDao.selectRoutineTaskReportByTaskKey(serverTaskDto.taskKey);
List<RoutineTaskReportDto> localRemove = new ArrayList();
// 先にローカルにしか存在しない事を削除 : DB, files
for (RoutineTaskReportDto routineTaskDto : localRoutineTaskReportList) {
if (!isExistsRoutineTaskReportInList(serverTaskDto.RoutineTaskReportList, routineTaskDto)) {
mOperationLogic.deleteRoutineTaskReport(operationDto.operationId, operationContentDto.contentId, routineTaskDto);
localRemove.add(routineTaskDto);
}
}
localRoutineTaskReportList.removeAll(localRemove);
// サーバーからの情報で更新
for (RoutineTaskReportDto routineTaskDto : serverTaskDto.RoutineTaskReportList) {
String reportAttachedFileName = routineTaskDto.attachedFileName;
routineTaskDto.taskKey = serverTaskDto.taskKey;
if (isExistsRoutineTaskReportInList(localRoutineTaskReportList, routineTaskDto)) { //プログレスを40%進行させるための計算
// 添付ファイルが存在する場合、取得して解凍する。 int progress = 0;
refreshRoutineTaskFile(operationId, operationContentDto.contentId, serverTaskDto.taskId, serverTaskDto.taskKey, routineTaskDto.taskReportId, routineTaskDto.taskReportInfoId, routineTaskDto.reportStartDate, reportAttachedFileName); if (json.taskDtoList.size() != 0) {
if (isSyncGetTaskFileError) { progress = 40 / json.taskDtoList.size();
return null; }
}
// 報告データが存在すると作業報告を更新する
if (routineTaskDto.jsonData != null) {
mOperationLogic.updateRoutineTaskReport(serverTaskDto.operationId, operationContentDto.contentId, routineTaskDto, false, false, false, false);
}
} else {
// 添付ファイルが存在する場合、取得して解凍する。
refreshRoutineTaskFile(operationId, operationContentDto.contentId, serverTaskDto.taskId, serverTaskDto.taskKey, routineTaskDto.taskReportId, routineTaskDto.taskReportInfoId, routineTaskDto.reportStartDate, reportAttachedFileName);
if (isSyncGetTaskFileError) {
return null;
}
if (routineTaskDto.jsonData != null) { JSONObject taskReportJson;
mOperationLogic.insertRoutineTaskReport(operationContentDto.operationId, operationContentDto.contentId, routineTaskDto, false, false); for (TaskDto serverTaskDto : json.taskDtoList) {
} if (operationDto.reportType == Constant.ReportType.Routine) {
} if (isExistsTaskInList(localTaskList, serverTaskDto)) {
} mTaskDao.update(serverTaskDto);
progressCallback.callback(new Integer(progress)); } else {
mTaskDao.insert(serverTaskDto);
} }
lastEditDate = json.lastEditDate;
} else {
// TODO
OperationDataJSON json = AcmsClient.getInstance(ABVDataCache.getInstance().getUrlPath(), ABVEnvironment.getInstance().networkAdapter).getOpereationData(param);
//プログレスを40%進行させるための計算 List<TaskReportDto> localTaskReportList = mTaskReportDao.getNotNullStartDateTaskReportByTaskKey(serverTaskDto.taskKey);
int progress = 0; List<TaskReportDto> localRemove = new ArrayList();
if (json.taskDtoList.size() != 0) { // 先にローカルにしか存在しない事を削除 : DB, files
progress = 40 / json.taskDtoList.size(); for (TaskReportDto localTaskReportDto : localTaskReportList) {
if (!isExistsRoutinTaskReportInList(serverTaskDto.taskReportDtoList, localTaskReportDto)) {
mOperationLogic.deleteRoutineTaskReport(operationId, operationContentDto.contentId, localTaskReportDto);
localRemove.add(localTaskReportDto);
}
} }
// #32782 指示者テーブル関連削除 start localTaskReportList.removeAll(localRemove);
// TODO change
/*
// JSONObject taskDirectionJson;
JSONObject taskReportJson;
for (TaskDto taskDto : json.taskDtoList) {
String directionsAttachedFileName = taskDto.taskDirectionsDto.attachedFileName;
String reportAttachedFileName = taskDto.taskReportDto.attachedFileName;
// 0305 start // サーバーからの情報で更新
taskReportJson = new JSONObject(taskDto.taskDirectionsDto.jsonData); for (TaskReportDto taskReportDto : serverTaskDto.taskReportDtoList) {
taskReportJson.put(ABookKeys.TASK_STATUS, taskDto.taskStatus); String reportAttachedFileName = taskReportDto.attachedFileName;
// 0305 end taskReportDto.taskKey = serverTaskDto.taskKey;
int localTaskIndex = localTaskList.indexOf(taskDto); // 添付ファイルが存在する場合、取得して解凍する。
if (localTaskIndex >= 0) { refreshRoutineTaskFile(operationId, operationContentDto.contentId, serverTaskDto.taskId, serverTaskDto.taskKey, taskReportDto.taskReportId, taskReportDto.taskReportInfoId, taskReportDto.reportStartDate, reportAttachedFileName);
if (isSyncGetTaskFileError) {
// 添付ファイルが存在する場合、取得して解凍する。 return null;
refreshTaskFile(operationId, operationContentDto.contentId, taskDto.taskId, taskDto.taskKey, directionsAttachedFileName, reportAttachedFileName); }
if (isSyncGetTaskFileError) { if (isExistsRoutinTaskReportInList(localTaskReportList, taskReportDto)) {
return null;
}
// #32782 指示者テーブル関連削除 start
// 作業更新
mOperationLogic.updateTaskReport(taskDto.taskKey, taskDto.operationId, operationContentDto.contentId,
taskReportJson, directionsAttachedFileName, false, false, taskDto.taskHotSpotInfo);
localTaskList.remove(taskDto);
// 報告データが存在すると作業報告を更新する // 報告データが存在すると作業報告を更新する
if (taskDto.taskReportDto.jsonData != null) { if (taskReportDto.jsonData != null) {
mOperationLogic.updateTaskReport(taskDto.taskKey, taskDto.operationId, operationContentDto.contentId, mOperationLogic.updateRoutineTaskReport(serverTaskDto.operationId, operationContentDto.contentId, taskReportDto, false, false, false, false);
taskReportJson, reportAttachedFileName, false, false, taskDto.taskHotSpotInfo);
} }
// #32782 指示者テーブル関連削除 end
} else { } else {
// 添付ファイルが存在する場合、取得して解凍する。 if (taskReportDto.jsonData != null) {
refreshTaskFile(operationId, operationContentDto.contentId, taskDto.taskId, taskDto.taskKey, directionsAttachedFileName, reportAttachedFileName); mOperationLogic.insertRoutineTaskReport(serverTaskDto.operationId, operationContentDto.contentId, taskReportDto, false, false);
if (isSyncGetTaskFileError) {
return null;
}
// #32782 指示者テーブル関連削除 start
// 作業登録
mOperationLogic.insertTaskReport(taskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId,
taskReportJson, directionsAttachedFileName, false, false, taskDto.taskHotSpotInfo);
if (taskDto.taskReportDto.jsonData != null) {
mOperationLogic.insertTaskReport(taskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId,
taskReportJson, reportAttachedFileName, false, false, taskDto.taskHotSpotInfo);
} }
// #32782 指示者テーブル関連削除 end
} }
progressCallback.callback(new Integer(progress));
} }
*/
JSONObject taskDirectionJson;
for (TaskDto taskDto : json.taskDtoList) {
String directionsAttachedFileName = taskDto.taskDirectionsDto.attachedFileName;
String reportAttachedFileName = taskDto.taskReportDto.attachedFileName;
taskDirectionJson = new JSONObject(taskDto.taskDirectionsDto.jsonData);
taskDirectionJson.put(ABookKeys.TASK_STATUS, taskDto.taskStatus);
// #32926 start
int taskReportLevel = taskDto.taskReportLevel;
// #32926 end
int localTaskIndex = localTaskList.indexOf(taskDto); } else {
if (localTaskIndex >= 0) { if (isExistsTaskInList(localTaskList, serverTaskDto)) {
// 更新
for (TaskReportDto taskReportDto : serverTaskDto.taskReportDtoList) {
String attachedFileName = taskReportDto.attachedFileName;
// 添付ファイルが存在する場合、取得して解凍する。 // 添付ファイルが存在する場合、取得して解凍する。
refreshTaskFile(operationId, operationContentDto.contentId, taskDto.taskId, taskDto.taskKey, directionsAttachedFileName, reportAttachedFileName, String.valueOf(taskReportLevel)); try {
if (isSyncGetTaskFileError) { refreshTaskFile(operationId, taskReportDto.taskReportLevel, operationContentDto.contentId, serverTaskDto.taskId, serverTaskDto.taskKey, taskReportDto.attachedFileName);
} catch (Exception e) {
return null; return null;
} }
// 作業更新 if (taskReportDto.taskReportLevel == Constant.TaskReportLevel.ReportType) {
mOperationLogic.updateTaskDirections(taskDto.taskKey, taskDto.operationId, operationContentDto.contentId, taskReportJson = new JSONObject(taskReportDto.jsonData);
taskDirectionJson, taskDto.taskHotSpotInfo, directionsAttachedFileName, false, false); taskReportJson.put(ABookKeys.TASK_STATUS, serverTaskDto.taskStatus);
localTaskList.remove(taskDto); // 作業報告を更新
// 報告データが存在すると作業報告を更新する // update
if (taskDto.taskReportDto.jsonData != null) { mOperationLogic.updateTaskReport(serverTaskDto.taskKey, serverTaskDto.operationId, operationContentDto.contentId,
mOperationLogic.updateTaskReport(taskDto.taskKey, taskDto.operationId, operationContentDto.contentId, taskReportJson, serverTaskDto.taskHotSpotInfo, attachedFileName, false, false);
new JSONObject(taskDto.taskReportDto.jsonData), reportAttachedFileName, false, false, taskReportLevel); } else {
// 作業報告(回答)
if (taskReportDto.jsonData != null) {
mOperationLogic.updateTaskReportReplyLevel(serverTaskDto.taskKey, serverTaskDto.operationId, operationContentDto.contentId,
new JSONObject(taskReportDto.jsonData), attachedFileName, false, false);
}
} }
} else { // 更新済みの場合、localTaskListから削除
localTaskList.remove(serverTaskDto);
}
} else {
// 登録
for (TaskReportDto taskReportDto : serverTaskDto.taskReportDtoList) {
String attachedFileName = taskReportDto.attachedFileName;
// 添付ファイルが存在する場合、取得して解凍する。 // 添付ファイルが存在する場合、取得して解凍する。
refreshTaskFile(operationId, operationContentDto.contentId, taskDto.taskId, taskDto.taskKey, directionsAttachedFileName, reportAttachedFileName, String.valueOf(taskReportLevel)); try {
if (isSyncGetTaskFileError) { refreshTaskFile(operationId, taskReportDto.taskReportLevel, operationContentDto.contentId, serverTaskDto.taskId, serverTaskDto.taskKey, taskReportDto.attachedFileName);
} catch (Exception e) {
return null; return null;
} }
// 作業登録 if (taskReportDto.taskReportLevel == Constant.TaskReportLevel.ReportType) {
mOperationLogic.insertTaskDirections(taskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId, taskReportJson = new JSONObject(taskReportDto.jsonData);
taskDirectionJson, taskDto.taskHotSpotInfo, directionsAttachedFileName, false, false); taskReportJson.put(ABookKeys.TASK_STATUS, serverTaskDto.taskStatus);
if (taskDto.taskReportDto.jsonData != null) {
mOperationLogic.insertTaskReport(taskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId, mOperationLogic.insertTaskReport(serverTaskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId,
new JSONObject(taskDto.taskReportDto.jsonData), reportAttachedFileName, false, false, taskReportLevel); taskReportJson, serverTaskDto.taskHotSpotInfo, attachedFileName, false, false);
} else {
if (taskReportDto.jsonData != null) {
mOperationLogic.insertTaskReportReply(serverTaskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId,
new JSONObject(taskReportDto.jsonData), attachedFileName, false, false);
}
} }
} }
progressCallback.callback(new Integer(progress));
} }
// #32782 指示者テーブル関連削除 end }
// サーバーから取得した作業情報がローカルに存在しないので削除する
for (TaskDto taskDto : localTaskList) {
mOperationLogic.deleteTaskFileData(operationId, operationContentDto.contentId, taskDto.taskKey);
mTaskDao.delete(taskDto);
}
lastEditDate = json.lastEditDate; progressCallback.callback(new Integer(progress));
} }
// サーバーから取得した作業情報がローカルに存在しないので削除する
for (TaskDto taskDto : localTaskList) {
mOperationLogic.deleteTaskFileData(operationId, operationContentDto.contentId, taskDto.taskKey);
mTaskDao.delete(taskDto);
}
lastEditDate = json.lastEditDate;
progressCallback.callback(new Integer(40)); progressCallback.callback(new Integer(40));
return lastEditDate; return lastEditDate;
} }
public void refreshTaskFile(final long operationId, final long contentId, final long taskId, final String taskKey, final String directionsAttachedFileName, final String reportAttachedFileName, final String taskReportLevel) throws ABVException, InterruptedException, ZipException, NoSuchAlgorithmException, IOException { /**
* 添付ファイルが存在する場合、取得して解凍する。
* @param operationId
* @param taskReportLevel
* @param contentId
* @param taskId
* @param taskKey
* @param attachedFileName
* @throws ABVException
* @throws InterruptedException
* @throws ZipException
* @throws NoSuchAlgorithmException
* @throws IOException
*/
public void refreshTaskFile(final long operationId, final int taskReportLevel, long contentId, final long taskId, final String taskKey, final String attachedFileName) throws Exception {
// 既存の添付ディレクトリ削除 // 既存の添付ディレクトリ削除
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey)); FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
// #32782 指示者テーブル関連削除 start
String directionsLocalAttachedFileName = mTaskReportDao.getTaskReportAttachedFileName(taskKey, taskReportLevel);
// #32782 指示者テーブル関連削除 end
// #32926 start
String reportLocalAttachedFileName = mTaskReportDao.getTaskReportAttachedFileName(taskKey, taskReportLevel); String reportLocalAttachedFileName = mTaskReportDao.getTaskReportAttachedFileName(taskKey, taskReportLevel);
// #32926 end if (attachedFileName != null && !attachedFileName.equals(reportLocalAttachedFileName)) {
int count = 0; try {
boolean getDirectionsFileFlg = directionsAttachedFileName != null && !directionsAttachedFileName.equals(directionsLocalAttachedFileName); Logger.i(TAG, "[Get Task Report Files] operationId=%s, taskKey=%s, taskId=%s, attachedFileName=%s", operationId, taskKey, taskId, attachedFileName);
boolean getReportFileFlg = reportAttachedFileName != null && !reportAttachedFileName.equals(reportLocalAttachedFileName); // #32926 start
if (getDirectionsFileFlg) { FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel));
count++; // #32926 end
} String outputFilePath = mOperationLogic.getTaskFile(operationId, taskKey, taskId, attachedFileName, taskReportLevel);
if (mOperationAuthLevel == OperationAuthLevel.WORKER && getReportFileFlg) { ContentFileExtractor.getInstance().extractZipFile(contentId, outputFilePath, ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel),null, true);
count++; } catch (Exception e) {
} Logger.e(TAG, e);
// 同期させるタスクの数をコンストラクタで渡す ABVToastUtil.showMakeText(getApplicationContext(), R.string.msg_error_task_report_receiving_failed, Toast.LENGTH_LONG);
final CountDownLatch latch = new CountDownLatch(count); throw e;
}
if (getDirectionsFileFlg) {
new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... params) {
try {
Logger.i(TAG, "[Get Task Directions Files] operationId=%s, taskKey=%s, taskId=%s, attachedFileName=%s", operationId, taskKey, taskId, directionsAttachedFileName);
FileUtil.delete(ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, taskReportLevel));
String outputFilePath = mOperationLogic.getTaskFile(operationId, taskKey, taskId, directionsAttachedFileName, 0);
ContentFileExtractor.getInstance().extractZipFile(contentId, outputFilePath,
ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, taskReportLevel), null, true);
} catch (Exception e) {
Logger.e(TAG, e);
ABVToastUtil.showMakeText(getApplicationContext(), R.string.msg_error_task_receiving_failed, Toast.LENGTH_LONG);
isSyncGetTaskFileError = true;
}
return null;
}
@Override
protected void onPostExecute(Void v) {
super.onPostExecute(v);
latch.countDown();
}
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
if (mOperationAuthLevel == OperationAuthLevel.WORKER && getReportFileFlg) {
new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... params) {
try {
Logger.i(TAG, "[Get Task Report Files] operationId=%s, taskKey=%s, taskId=%s, attachedFileName=%s", operationId, taskKey, taskId, reportAttachedFileName);
// #32926 start
FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel));
// #32926 end
String outputFilePath = mOperationLogic.getTaskFile(operationId, taskKey, taskId, reportAttachedFileName, 1);
ContentFileExtractor.getInstance().extractZipFile(contentId, outputFilePath,
// #32926 start
ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel),
// #32926 end
null, true);
} catch (Exception e) {
Logger.e(TAG, e);
ABVToastUtil.showMakeText(getApplicationContext(), R.string.msg_error_task_report_receiving_failed, Toast.LENGTH_LONG);
isSyncGetTaskFileError = true;
}
return null;
}
@Override
protected void onPostExecute(Void v) {
super.onPostExecute(v);
latch.countDown();
}
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} }
// 上記の非同期の処理が終了するまで、待つ
latch.await();
} }
/** /**
...@@ -1156,48 +1010,27 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1156,48 +1010,27 @@ public class OperationListActivity extends ABVUIActivity {
// 既存の添付ディレクトリ削除 // 既存の添付ディレクトリ削除
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey)); FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
String reportLocalAttachedFileName = mRoutineTaskReportDao.getRoutineTaskReportAttachedFileName(taskKey, taskReportId, reportStartDateHypn); String reportLocalAttachedFileName = mTaskReportDao.getRoutineTaskReportAttachedFileName(taskKey, taskReportId, reportStartDateHypn);
int count = 0;
boolean getReportFileFlg = !StringUtil.isNullOrEmpty(reportAttachedFileName) && !reportAttachedFileName.equals(reportLocalAttachedFileName); boolean getReportFileFlg = !StringUtil.isNullOrEmpty(reportAttachedFileName) && !reportAttachedFileName.equals(reportLocalAttachedFileName);
if (mOperationAuthLevel == OperationAuthLevel.WORKER && getReportFileFlg) { if (getReportFileFlg) {
count++; try {
} Logger.i(TAG, "[Get Task Report Files] operationId=%s, taskKey=%s, taskId=%s, attachedFileName=%s", operationId, taskKey, taskId, reportAttachedFileName);
// 同期させるタスクの数をコンストラクタで渡す // #32926 start
final CountDownLatch latch = new CountDownLatch(count); int taskReportLevel = 0;
FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, reportStartDateNone));
if (mOperationAuthLevel == OperationAuthLevel.WORKER && getReportFileFlg) { // #32926 end
new AsyncTask<Void, Void, Void>() { String outputFilePath = mOperationLogic.getRoutineTaskReportFile(operationId, taskKey, taskId, taskReportId, taskReportInfoId, reportStartDateNone, reportAttachedFileName);
@Override // #32926 start
protected Void doInBackground(Void... params) { ContentFileExtractor.getInstance().extractZipFile(contentId, outputFilePath,
try { ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, reportStartDateNone), null, true);
Logger.i(TAG, "[Get Task Report Files] operationId=%s, taskKey=%s, taskId=%s, attachedFileName=%s", operationId, taskKey, taskId, reportAttachedFileName); // #32926 end
// #32926 start } catch (Exception e) {
int taskReportLevel = 0; Logger.e(TAG, e);
FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, reportStartDateNone, taskReportLevel)); ABVToastUtil.showMakeText(getApplicationContext(), R.string.msg_error_task_report_receiving_failed, Toast.LENGTH_LONG);
// #32926 end isSyncGetTaskFileError = true;
String outputFilePath = mOperationLogic.getRoutineTaskReportFile(operationId, taskKey, taskId, taskReportId, taskReportInfoId, reportStartDateNone, reportAttachedFileName); }
// #32926 start
ContentFileExtractor.getInstance().extractZipFile(contentId, outputFilePath,
ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, reportStartDateNone, taskReportLevel), null, true);
// #32926 end
} catch (Exception e) {
Logger.e(TAG, e);
ABVToastUtil.showMakeText(getApplicationContext(), R.string.msg_error_task_report_receiving_failed, Toast.LENGTH_LONG);
isSyncGetTaskFileError = true;
}
return null;
}
@Override
protected void onPostExecute(Void v) {
super.onPostExecute(v);
latch.countDown();
}
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} }
// 上記の非同期の処理が終了するまで、待つ
latch.await();
} }
/** /**
...@@ -1704,8 +1537,14 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1704,8 +1537,14 @@ public class OperationListActivity extends ABVUIActivity {
} }
} }
/**
* listDtoの中に第2引数のdtoが存在するかチェックメソッド
* @param listDto リストDto
* @param dto ターゲットDto
* @return
*/
private boolean isExistsTaskInList(List<TaskDto> listDto, TaskDto dto) { private boolean isExistsTaskInList(List<TaskDto> listDto, TaskDto dto) {
for(TaskDto lDto:listDto) { for (TaskDto lDto : listDto) {
if (lDto.taskKey.equals(dto.taskKey)) { if (lDto.taskKey.equals(dto.taskKey)) {
return true; return true;
} }
...@@ -1713,8 +1552,14 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1713,8 +1552,14 @@ public class OperationListActivity extends ABVUIActivity {
return false; return false;
} }
private boolean isExistsRoutineTaskReportInList(List<RoutineTaskReportDto> listDto, RoutineTaskReportDto rDto) { /**
for(RoutineTaskReportDto lDto:listDto) { * 定期点検の報告存在チェック
* @param listDto
* @param rDto
* @return
*/
private boolean isExistsRoutinTaskReportInList(List<TaskReportDto> listDto, TaskReportDto rDto) {
for (TaskReportDto lDto : listDto) {
if (lDto.taskKey.equals(rDto.taskKey) && if (lDto.taskKey.equals(rDto.taskKey) &&
lDto.taskReportId == rDto.taskReportId && lDto.taskReportId == rDto.taskReportId &&
lDto.reportStartDate.equals(rDto.reportStartDate)) { lDto.reportStartDate.equals(rDto.reportStartDate)) {
...@@ -1758,7 +1603,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1758,7 +1603,7 @@ public class OperationListActivity extends ABVUIActivity {
if (contentDto == null || !contentDto.downloadedFlg || contentDto.updatedFlg) { if (contentDto == null || !contentDto.downloadedFlg || contentDto.updatedFlg) {
contentDownload(operationDto.contentId, false); contentDownload(operationDto.contentId, false);
} else { } else {
syncOperation(operationDto.operationId, operationDto.operationReportType, true); syncOperation(operationDto.operationId, operationDto.reportType, true);
} }
} }
}); });
...@@ -1922,9 +1767,9 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1922,9 +1767,9 @@ public class OperationListActivity extends ABVUIActivity {
private ArrayList<Integer> getOperationReportTypeList(boolean isAll) { private ArrayList<Integer> getOperationReportTypeList(boolean isAll) {
ArrayList<Integer> operationReportTypes = new ArrayList<>(); ArrayList<Integer> operationReportTypes = new ArrayList<>();
if (isAll) { if (isAll) {
operationReportTypes.add(OperationReportType.DEFAULT);
operationReportTypes.add(OperationReportType.ROUTINE_TASK);
operationReportTypes.add(OperationReportType.REPORT_TYPE); operationReportTypes.add(OperationReportType.REPORT_TYPE);
operationReportTypes.add(OperationReportType.ROUTINE_TASK);
operationReportTypes.add(OperationReportType.REPORT_RESPONSE_TYPE);
} else { } else {
operationReportTypes = getABVUIDataCache().getOperationReportTypes(); operationReportTypes = getABVUIDataCache().getOperationReportTypes();
} }
......
...@@ -191,7 +191,7 @@ public class OperationRelatedContentActivity extends ABVUIActivity { ...@@ -191,7 +191,7 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
public void showOperationRelatedContentList() { public void showOperationRelatedContentList() {
mOperationContentList = mOperationLogic.getOperationRelatedContent(operationId); mOperationContentList = mOperationLogic.getOperationRelatedContent();
Logger.i(TAG, "count of content=" + mOperationContentList.size()); Logger.i(TAG, "count of content=" + mOperationContentList.size());
// Gridビュー // Gridビュー
......
...@@ -87,9 +87,9 @@ public class OperationListAdapter extends AbstractOperationAdapter { ...@@ -87,9 +87,9 @@ public class OperationListAdapter extends AbstractOperationAdapter {
final OperationDto operationDto = getItem(position); final OperationDto operationDto = getItem(position);
if (operationDto != null) { if (operationDto != null) {
boolean noRoutineTaskAll = (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK && operationDto.reportCount == 0); boolean noRoutineTaskAll = (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK && operationDto.reportCount == 0);
holder.tvOperationName.setText(operationDto.operationName); holder.tvOperationName.setText(operationDto.operationName);
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) {
if (StringUtil.isNullOrEmpty(operationDto.reportPeriod)) { if (StringUtil.isNullOrEmpty(operationDto.reportPeriod)) {
holder.tvDate.setText(mContext.getString(R.string.date_label_routineTask) + " : " + mContext.getString(R.string.msg_no_report_data)); holder.tvDate.setText(mContext.getString(R.string.date_label_routineTask) + " : " + mContext.getString(R.string.msg_no_report_data));
} else { } else {
...@@ -106,7 +106,7 @@ public class OperationListAdapter extends AbstractOperationAdapter { ...@@ -106,7 +106,7 @@ public class OperationListAdapter extends AbstractOperationAdapter {
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, true); setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, true);
} else { } else {
// needSyncFlgがfalseの場合 // needSyncFlgがfalseの場合
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) {
// 定期点検プロジェクトの場合のみ、以下の処理を行う // 定期点検プロジェクトの場合のみ、以下の処理を行う
String syncedDate = getUserPref(mContext, String.format(AppDefType.UserPrefKey.SYNCED_OPERATION_ID, operationDto.operationId), ""); String syncedDate = getUserPref(mContext, String.format(AppDefType.UserPrefKey.SYNCED_OPERATION_ID, operationDto.operationId), "");
if (StringUtil.isNullOrEmpty(operationDto.reportPeriod) && !syncedDate.equals(DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMdd_none))) { if (StringUtil.isNullOrEmpty(operationDto.reportPeriod) && !syncedDate.equals(DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMdd_none))) {
...@@ -143,7 +143,7 @@ public class OperationListAdapter extends AbstractOperationAdapter { ...@@ -143,7 +143,7 @@ public class OperationListAdapter extends AbstractOperationAdapter {
holder.lyPanoEditLayout.setVisibility(View.INVISIBLE); holder.lyPanoEditLayout.setVisibility(View.INVISIBLE);
} }
if(mOperationAuthLevel == OperationAuthLevel.WORKER) { if(operationDto.enableReportEdit == Constant.EnableReportEdit.NO) {
holder.lyPanoEditLayout.setVisibility(View.GONE); holder.lyPanoEditLayout.setVisibility(View.GONE);
} }
......
...@@ -119,9 +119,9 @@ public class OperationPanelAdapter extends AbstractOperationAdapter { ...@@ -119,9 +119,9 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
final OperationDto operationDto = getItem(position); final OperationDto operationDto = getItem(position);
if (operationDto != null) { if (operationDto != null) {
boolean noRoutineTaskAll = (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK && operationDto.reportCount == 0); boolean noRoutineTaskAll = (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK && operationDto.reportCount == 0);
holder.tvOperationName.setText(operationDto.operationName); holder.tvOperationName.setText(operationDto.operationName);
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) {
if (StringUtil.isNullOrEmpty(operationDto.reportPeriod)) { if (StringUtil.isNullOrEmpty(operationDto.reportPeriod)) {
holder.tvDate.setText(mContext.getString(R.string.date_label_routineTask) + " : " + mContext.getString(R.string.msg_no_report_data)); holder.tvDate.setText(mContext.getString(R.string.date_label_routineTask) + " : " + mContext.getString(R.string.msg_no_report_data));
} else { } else {
...@@ -137,7 +137,7 @@ public class OperationPanelAdapter extends AbstractOperationAdapter { ...@@ -137,7 +137,7 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, true); setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, true);
} else { } else {
// needSyncFlgがfalseの場合 // needSyncFlgがfalseの場合
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) {
// 定期点検プロジェクトの場合のみ、以下の処理を行う // 定期点検プロジェクトの場合のみ、以下の処理を行う
String syncedDate = getUserPref(mContext, String.format(AppDefType.UserPrefKey.SYNCED_OPERATION_ID, operationDto.operationId), ""); String syncedDate = getUserPref(mContext, String.format(AppDefType.UserPrefKey.SYNCED_OPERATION_ID, operationDto.operationId), "");
if (StringUtil.isNullOrEmpty(operationDto.reportPeriod) && !syncedDate.equals(DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMdd_none))) { if (StringUtil.isNullOrEmpty(operationDto.reportPeriod) && !syncedDate.equals(DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMdd_none))) {
...@@ -174,9 +174,9 @@ public class OperationPanelAdapter extends AbstractOperationAdapter { ...@@ -174,9 +174,9 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
holder.lyPanoEditLayout.setVisibility(View.INVISIBLE); holder.lyPanoEditLayout.setVisibility(View.INVISIBLE);
} }
if(mOperationAuthLevel == OperationAuthLevel.WORKER) { // if(mOperationAuthLevel.equals(OperationAuthLevel.WORKER)) {
holder.lyPanoEditLayout.setVisibility(View.GONE); holder.lyPanoEditLayout.setVisibility(View.GONE);
} // }
holder.ivPanoEdit.setOnClickListener(new View.OnClickListener() { holder.ivPanoEdit.setOnClickListener(new View.OnClickListener() {
@Override @Override
......
...@@ -18,7 +18,6 @@ import java.util.Date; ...@@ -18,7 +18,6 @@ import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import jp.agentec.abook.abv.bl.acms.type.OperationAuthLevel;
import jp.agentec.abook.abv.bl.common.ABVEnvironment; import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.Callback; import jp.agentec.abook.abv.bl.common.Callback;
import jp.agentec.abook.abv.bl.common.CommonExecutor; import jp.agentec.abook.abv.bl.common.CommonExecutor;
...@@ -26,8 +25,6 @@ import jp.agentec.abook.abv.bl.common.Constant; ...@@ -26,8 +25,6 @@ import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys; import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.ABVException; import jp.agentec.abook.abv.bl.common.exception.ABVException;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.ABVDataCache;
import jp.agentec.abook.abv.bl.dto.RoutineTaskReportDto;
import jp.agentec.abook.abv.bl.dto.OperationDto; import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.OperationTaskDto; import jp.agentec.abook.abv.bl.dto.OperationTaskDto;
import jp.agentec.abook.abv.bl.dto.TaskDto; import jp.agentec.abook.abv.bl.dto.TaskDto;
...@@ -65,254 +62,81 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -65,254 +62,81 @@ public class ABookCheckWebViewHelper extends ABookHelper {
* @param context ABVContentViewActivity * @param context ABVContentViewActivity
* @param cmd * @param cmd
* @param taskKey タスクキー * @param taskKey タスクキー
* @param reportUpdateType * @param enableReportHistory
* @param param * @param param
* @param operationId プロジェクトID * @param operationId プロジェクトID
* @param contentPath * @param contentPath
* @param routineTaskReportFlg * @param reportType
* @param finishCallback * @param finishCallback
* @param taskReportLevel * @param taskReportLevel
*/ */
public void doABookCheckParam(ABVContentViewActivity context, String cmd, String taskKey, int reportUpdateType, Map<String, String> param, long operationId, String contentPath, long contentId, boolean routineTaskReportFlg, Callback finishCallback, int taskReportLevel) throws IOException { 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 {
int taskReportSendId = 0; int taskReportSendId = 0;
mFinishCallback = finishCallback; mFinishCallback = finishCallback;
// #32782 指示者テーブル関連削除 start
// TODO append
// int mOperationAuthLevel = ABVDataCache.getInstance().getMemberInfo().operationAuthLevel;
// #32782 指示者テーブル関連削除 end
// #32782 指示者テーブル関連削除 start
// TODO change
/*
switch (cmd) { switch (cmd) {
case ABookKeys.CMD_INSERT_TASK_DIRECTIONS:
// #32782 指示者テーブル関連削除 start
// TODO TASK_DIRECTIONS の削除
case ABookKeys.CMD_INSERT_TASK_REPORT: case ABookKeys.CMD_INSERT_TASK_REPORT:
insertOrUpdateTaskReport(taskKey, reportUpdateType, operationId, contentId, param, contentPath, true, routineTaskReportFlg); insertOrUpdateTaskReport(taskKey, enableReportHistory, operationId, contentId, param, contentPath, true, reportType, taskReportLevel);
if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) { copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel);
copyTaskAttachedMovie(operationId, contentId, taskKey, String.valueOf(taskReportLevel)); sendTaskData(context, operationId, taskKey, taskReportLevel);
sendTaskReportData(context, operationId, taskKey, -1, true);
} else {
sendTaskReportData(context, operationId, taskKey, reportUpdateType, false);
}
// #32782 指示者テーブル関連削除 end
break; break;
// TODO TASK_DIRECTIONS の削除
case ABookKeys.CMD_UPDATE_TASK_DIRECTIONS:
case ABookKeys.CMD_UPDATE_TASK_REPORT: case ABookKeys.CMD_UPDATE_TASK_REPORT:
insertOrUpdateTaskReport(taskKey, reportUpdateType, operationId, contentId, param, contentPath, false, routineTaskReportFlg); insertOrUpdateTaskReport(taskKey, enableReportHistory, operationId, contentId, param, contentPath, false, reportType, taskReportLevel);
copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel);
if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) { sendTaskData(context, operationId, taskKey, taskReportLevel);
copyTaskAttachedMovie(operationId, contentId, taskKey, String.valueOf(taskReportLevel));
sendTaskReportData(context, operationId, taskKey, -1, true);
} else {
sendTaskReportData(context, operationId, taskKey, reportUpdateType, false);
}
break; break;
// #32782 指示者テーブル関連削除 start
case ABookKeys.CMD_DELETE_TASK_DIRECTIONS:
// TODO TASK_DIRECTIONS の削除
case ABookKeys.CMD_DELETE_TASK_REPORT: case ABookKeys.CMD_DELETE_TASK_REPORT:
int taskReportId = 0; int taskReportId = 0;
String reportStartDate = ""; String reportStartDate = "";
boolean sendTaskReportDataFlg = false; boolean sendTaskReportDataFlg = false;
if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) { // TODO検討
mOperationLogic.deleteTaskReport(operationId, contentId, taskKey); // copyTaskAttachedMovie(operationId, contentId, taskKey, String.valueOf(taskReportLevel));
mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, false); if (reportType == Constant.ReportType.Routine) {
copyTaskAttachedMovie(operationId, contentId, taskKey, String.valueOf(taskReportLevel));
sendTaskReportData(context, operationId, taskKey, -1, true);
} else {
if (routineTaskReportFlg) {
taskReportId = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_ID)); taskReportId = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_ID));
reportStartDate = param.get(ABookKeys.REPORT_START_DATE); reportStartDate = param.get(ABookKeys.REPORT_START_DATE).replace("T", " ");
reportStartDate = reportStartDate.replace("T", " ");
mOperationLogic.deleteRoutineTaskReport(operationId, contentId, taskKey, taskReportId, reportStartDate); mOperationLogic.deleteRoutineTaskReport(operationId, contentId, taskKey, taskReportId, reportStartDate);
mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, false); mOperationLogic.createJsonForOperationContent(operationId, contentPath, false);
copyRoutineTaskReportAttachedMovie(operationId, contentId, taskKey, taskReportId, reportStartDate); copyRoutineTaskReportAttachedMovie(operationId, contentId, taskKey, taskReportId, reportStartDate);
RoutineTaskReportDto routineTaskTaskReportDto = mOperationLogic.getRoutineTaskReportUtc(taskKey, taskReportId, reportStartDate);
if (routineTaskTaskReportDto != null && reportUpdateType != Constant.OperationUpdateType.HISTORY_ADD) {
sendTaskReportDataFlg = true;
}
} else {
mOperationLogic.deleteTaskReport(operationId, contentId, taskKey);
mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, false);
copyTaskAttachedMovie(operationId, contentId, taskKey, String.valueOf(taskReportLevel));
TaskReportDto taskReportDto = mOperationLogic.getTaskReport(taskKey);
if (taskReportDto != null && reportUpdateType != Constant.OperationUpdateType.HISTORY_ADD) {
sendTaskReportDataFlg = true;
}
}
if (sendTaskReportDataFlg) {
if (reportUpdateType == Constant.OperationUpdateType.HISTORY_NO) {
taskReportSendId = mOperationLogic.getLastTaskReportSendId(taskKey);
mOperationLogic.updateTaskReportSend(taskKey, taskReportId, reportStartDate, null, true);
deleteReportTaskSendFiles(operationId, taskKey, taskReportSendId);
} else if (reportUpdateType == Constant.OperationUpdateType.HISTORY_UPDATE) {
mOperationLogic.insertTaskReportSend(taskKey, taskReportId, reportStartDate, null, true);
}
sendTaskReportData(context, operationId, taskKey, reportUpdateType, false);
} else { } else {
mFinishCallback.callback(false); mOperationLogic.deleteTaskReportReply(operationId, contentId, taskKey);
} mOperationLogic.createJsonForOperationContent(operationId, contentPath, false);
} copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel);
break;
// #32782 指示者テーブル関連削除 end
case ABookKeys.CMD_MOVE_HOT_SPOT:
mOperationLogic.updateTaskHotspot(taskKey, param);
mOperationLogic.createHopSpotJson(operationId, contentPath);
break;
case ABookKeys.CMD_CANCEL_TASK_DIRECTIONS:
case ABookKeys.CMD_CANCEL_TASK_REPORT:
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
mFinishCallback.callback(false);
break;
}
*/
switch (cmd) {
case ABookKeys.CMD_INSERT_TASK_DIRECTIONS:
insertOrUpdateTaskDirections(taskKey, operationId, contentId, param, contentPath, true);
copyTaskAttachedMovie(operationId, contentId, taskKey, String.valueOf(taskReportLevel));
sendTaskDirectionsData(context, operationId, taskKey);
break;
case ABookKeys.CMD_UPDATE_TASK_DIRECTIONS:
insertOrUpdateTaskDirections(taskKey, operationId, contentId, param, contentPath, false);
copyTaskAttachedMovie(operationId, contentId, taskKey, String.valueOf(taskReportLevel));
sendTaskDirectionsData(context, operationId, taskKey);
break;
case ABookKeys.CMD_DELETE_TASK_DIRECTIONS:
mOperationLogic.deleteTaskDirections(operationId, contentId, taskKey);
mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, true);
copyTaskAttachedMovie(operationId, contentId, taskKey, String.valueOf(taskReportLevel));
sendTaskDirectionsData(context, operationId, taskKey);
break;
case ABookKeys.CMD_MOVE_HOT_SPOT:
// #32926 作業報告画面改善 start
mOperationLogic.updateTaskHotspot(taskKey, param, taskReportLevel);
// #32926 作業報告画面改善 end
mOperationLogic.createHopSpotJson(operationId, contentPath);
break;
case ABookKeys.CMD_INSERT_TASK_REPORT:
insertOrUpdateTaskReport(taskKey, reportUpdateType, operationId, contentId, param, contentPath, true, routineTaskReportFlg, taskReportLevel);
sendTaskReportData(context, operationId, taskKey, reportUpdateType);
break;
case ABookKeys.CMD_UPDATE_TASK_REPORT:
insertOrUpdateTaskReport(taskKey, reportUpdateType, operationId, contentId, param, contentPath, false, routineTaskReportFlg, taskReportLevel);
sendTaskReportData(context, operationId, taskKey, reportUpdateType);
break;
// #32861 作業情報追加 start
// 一時保存処理
case ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT:
insertOrUpdateTaskReport(taskKey, reportUpdateType, operationId, contentId, param, contentPath, false, routineTaskReportFlg, taskReportLevel);
context.handleErrorMessageToast(R.string.msg_temp_save_result);
break;
// #32861 作業情報追加 end
case ABookKeys.CMD_DELETE_TASK_REPORT:
int taskReportId = 0;
String reportStartDate = "";
boolean sendTaskReportDataFlg = false;
if (routineTaskReportFlg) {
taskReportId = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_ID));
reportStartDate = param.get(ABookKeys.REPORT_START_DATE);
reportStartDate = reportStartDate.replace("T", " ");
mOperationLogic.deleteRoutineTaskReport(operationId, contentId, taskKey, taskReportId, reportStartDate);
mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, false);
copyRoutineTaskReportAttachedMovie(operationId, contentId, taskKey, taskReportId, reportStartDate, taskReportLevel);
RoutineTaskReportDto routineTaskTaskReportDto = mOperationLogic.getRoutineTaskReportUtc(taskKey, taskReportId, reportStartDate);
if (routineTaskTaskReportDto != null && reportUpdateType != Constant.OperationUpdateType.HISTORY_ADD) {
sendTaskReportDataFlg = true;
} }
} else {
mOperationLogic.deleteTaskReport(operationId, contentId, taskKey, taskReportLevel);
mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, false);
copyTaskAttachedMovie(operationId, contentId, taskKey, String.valueOf(taskReportLevel));
TaskReportDto taskReportDto = mOperationLogic.getTaskReport(taskKey); if (enableReportHistory == Constant.EnableReportHistory.Invalid) {
if (taskReportDto != null && reportUpdateType != Constant.OperationUpdateType.HISTORY_ADD) {
sendTaskReportDataFlg = true;
}
}
if (sendTaskReportDataFlg) {
if (reportUpdateType == Constant.OperationUpdateType.HISTORY_NO) {
taskReportSendId = mOperationLogic.getLastTaskReportSendId(taskKey); taskReportSendId = mOperationLogic.getLastTaskReportSendId(taskKey);
mOperationLogic.updateTaskReportSend(taskKey, taskReportId, reportStartDate, null, true); mOperationLogic.updateTaskReportSend(taskKey, taskReportId, reportStartDate, null, true);
deleteReportTaskSendFiles(operationId, taskKey, taskReportSendId, taskReportLevel); deleteReportTaskSendFiles(operationId, taskKey, taskReportSendId, taskReportLevel);
} else if (reportUpdateType == Constant.OperationUpdateType.HISTORY_UPDATE) { } else if (enableReportHistory == Constant.EnableReportHistory.Enable) {
mOperationLogic.insertTaskReportSend(taskKey, taskReportId, reportStartDate, null, true); mOperationLogic.insertTaskReportSend(taskKey, taskReportId, reportStartDate, null, true);
} }
sendTaskReportData(context, operationId, taskKey, reportUpdateType); sendTaskData(context, operationId, taskKey, taskReportLevel);
} else {
mFinishCallback.callback(false); break;
} // #32782 指示者テーブル関連削除 end
case ABookKeys.CMD_MOVE_HOT_SPOT:
mOperationLogic.updateTaskHotspot(taskKey, param);
mOperationLogic.createHopSpotJson(operationId, contentPath);
break; break;
case ABookKeys.CMD_CANCEL_TASK_DIRECTIONS: // case ABookKeys.CMD_CANCEL_TASK_DIRECTIONS:
case ABookKeys.CMD_CANCEL_TASK_REPORT: case ABookKeys.CMD_CANCEL_TASK_REPORT:
// #32926 作業報告画面改善 start
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey)); FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
// #32926 作業報告画面改善 end
mFinishCallback.callback(false); mFinishCallback.callback(false);
break; break;
} }
// #32782 指示者テーブル関連削除 end
}
/**
* 作業指示データ送信処理
*
* @param context ABVContentViewActivity
* @param operationId プロジェクトID
* @param taskKey タスクキー
*/
private void sendTaskDirectionsData(final ABVContentViewActivity context, final long operationId, final String taskKey) {
// #32782 指示者テーブル関連削除 start
// TODO Delete mothod
Logger.d(TAG, "[sendTaskDirectionsData] operationId=%s, taskKey=%s", operationId, taskKey);
//作業指示送信時には「reportUpdateType」値が必要ではないので、「-1」に設定
sendTaskData(context, operationId, taskKey, -1, true);
// #32782 指示者テーブル関連削除 end
} }
/** /**
* 作業報告データ送信処理
* @param context ABVContentViewActivity
* @param operationId プロジェクトID
* @param taskKey タスクキー
* @param reportUpdateType 作業履歴タイプ
*/
// #32782 指示者テーブル関連削除 start
// TODO change
/*
private void sendTaskReportData(final ABVContentViewActivity context, final long operationId, final String taskKey, final int reportUpdateType, final boolean isDirection) {
Logger.d(TAG, "[sendTaskReportData] operationId=%s, taskKey=%s", operationId, taskKey);
sendTaskData(context, operationId, taskKey, reportUpdateType, isDirection);
}
*/
private void sendTaskReportData(final ABVContentViewActivity context, final long operationId, final String taskKey, final int reportUpdateType) {
Logger.d(TAG, "[sendTaskReportData] operationId=%s, taskKey=%s", operationId, taskKey);
sendTaskData(context, operationId, taskKey, reportUpdateType, false);
}
// #32782 指示者テーブル関連削除 end
/**
* 作業報告・指示データ送信処理(共通) * 作業報告・指示データ送信処理(共通)
* @param context ABVContentViewActivity * @param context ABVContentViewActivity
* @param operationId プロジェクトID * @param operationId プロジェクトID
* @param taskKey タスクキー * @param taskKey タスクキー
* @param reportUpdateType 作業履歴タイプ
* @param isDirections 作業指示:true, 作業報告:false
*/ */
private void sendTaskData(final ABVContentViewActivity context, final long operationId, final String taskKey, final int reportUpdateType, final boolean isDirections) { private void sendTaskData(final ABVContentViewActivity context, final long operationId, final String taskKey, final int taskReportLevel) {
// TODO 以下の処理見直し
// ネットワーク通信チェック // ネットワーク通信チェック
if (!ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) { if (!ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) {
mFinishCallback.callback(false); mFinishCallback.callback(false);
...@@ -337,42 +161,30 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -337,42 +161,30 @@ public class ABookCheckWebViewHelper extends ABookHelper {
CommonExecutor.execute(new Runnable() { CommonExecutor.execute(new Runnable() {
@Override @Override
public void run() { public void run() {
OperationDto operationDto = mOperationLogic.getOperation(operationId);
boolean isError = false; boolean isError = false;
try { try {
if (isDirections) { if (mOperationLogic.sendTaskReportSendData(operationId, taskKey, taskReportLevel, progressCallback)) {
// #32782 指示者テーブル関連削除 start context.handleErrorMessageToast(R.string.P005);
// TODO change
// mOperationLogic.sendTaskReportSendData(operationId, taskKey, progressCallback);
mOperationLogic.sendTaskDirectionsData(operationId, taskKey, progressCallback);
// #32782 指示者テーブル関連削除 end
mOperationLogic.updateSyncOperation(operationId, true);
} else {
OperationDto operationDto = mOperationLogic.getOperation(operationId);
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) {
if (mOperationLogic.sendRoutineTaskReportSendData(operationId, taskKey, progressCallback) > 0){
context.handleErrorMessageToast(R.string.P005);
}
} else {
mOperationLogic.sendTaskReportSendData(operationId, taskKey, progressCallback);
}
if (reportUpdateType != Constant.OperationUpdateType.HISTORY_ADD) {
mOperationLogic.updateSyncOperation(operationId, true);
}
} }
mOperationLogic.updateSyncOperation(operationId, true);
} catch (ABVException ex) { } catch (ABVException ex) {
Logger.e(TAG, "sendTaskData", ex); Logger.e(TAG, "sendTaskData", ex);
if (isDirections) { // if (isDirections) {
context.showSimpleAlertDialog(R.string.app_name, R.string.msg_send_error_task_directions_data); // context.showSimpleAlertDialog(R.string.app_name, R.string.msg_send_error_task_directions_data);
} else { // } else {
context.showSimpleAlertDialog(R.string.app_name, R.string.msg_send_error_task_report_data); context.showSimpleAlertDialog(R.string.app_name, R.string.msg_send_error_task_report_data);
} // }
isError = true;
} catch (Exception e) { } catch (Exception e) {
Logger.e(TAG, e); Logger.e(TAG, e);
if (isDirections) { // if (isDirections) {
context.showSimpleAlertDialog(R.string.app_name, R.string.msg_send_error_task_directions_data); // context.showSimpleAlertDialog(R.string.app_name, R.string.msg_send_error_task_directions_data);
} else { // } else {
context.showSimpleAlertDialog(R.string.app_name, R.string.msg_send_error_task_report_data); context.showSimpleAlertDialog(R.string.app_name, R.string.msg_send_error_task_report_data);
} // }
isError = true; isError = true;
} finally { } finally {
mFinishCallback.callback(isError); mFinishCallback.callback(isError);
...@@ -384,7 +196,7 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -384,7 +196,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
public void doABookCheckParamPdf(long operationId, OperationTaskDto operationTaskDto, String contentPath) { public void doABookCheckParamPdf(long operationId, OperationTaskDto operationTaskDto, String contentPath) {
try { try {
mOperationLogic.updateTaskHotspot(operationTaskDto.taskKey, operationTaskDto.pdfX, operationTaskDto.pdfY); mOperationLogic.updateTaskHotspot(operationTaskDto.taskKey, operationTaskDto.pdfX, operationTaskDto.pdfY, Constant.TaskReportLevel.ReportType);
mOperationLogic.createHopSpotJson(operationId, contentPath); mOperationLogic.createHopSpotJson(operationId, contentPath);
} catch(IOException e){ } catch(IOException e){
e.printStackTrace(); e.printStackTrace();
...@@ -453,202 +265,80 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -453,202 +265,80 @@ public class ABookCheckWebViewHelper extends ABookHelper {
} }
/** /**
* 作業指示の登録・更新
* *
* @param taskKey * @param taskKey
* @param enableReportHistory
* @param operationId * @param operationId
* @param contentId * @param contentId
* @param param * @param param
* @param contentPath * @param contentPath
* @param insertFlg * @param insertFlg
* @param reportType
* @param taskReportLevel
* @throws IOException * @throws IOException
*/ */
private void insertOrUpdateTaskDirections(String taskKey, long operationId, long contentId, Map<String, String> param, String contentPath, boolean insertFlg) throws IOException { private void insertOrUpdateTaskReport(String taskKey, int enableReportHistory, long operationId, long contentId, Map<String, String> param, String contentPath, boolean insertFlg, int reportType, int taskReportLevel) throws IOException {
// #32782 指示者テーブル関連削除 start
// TODO Delete method
boolean attachedChangeFlag = param.get(ABookKeys.ATTACHED_CHANGE_FLAG).equals("1") ? true : false;
String taskDirections = param.get(ABookKeys.TASK_DIRECTIONS);
JSONObject taskDirectionsJson = new JSONObject(taskDirections);
String taskHotSpotInfo = param.get(ABookKeys.HOT_SPOT);
if (insertFlg) {
mOperationLogic.insertTaskDirections(taskKey, operationId, contentId, taskDirectionsJson, taskHotSpotInfo, null, attachedChangeFlag, true);
mOperationLogic.createJsonForOperationContent(operationId, 0, contentPath, true);
} else {
mOperationLogic.updateTaskDirections(taskKey, operationId, contentId, taskDirectionsJson, taskHotSpotInfo, null, attachedChangeFlag, true);
mOperationLogic.createJsonForOperationContent(operationId, 0, contentPath, true);
}
// #32782 指示者テーブル関連削除 end
}
// #32782 指示者テーブル関連削除 start
// TODO change
/*
private void insertOrUpdateTaskReport(String taskKey, int reportUpdateType, long operationId, long contentId, Map<String, String> param, String contentPath, boolean insertFlg, boolean routineTaskReportFlg) throws IOException {
int taskReportSendId = 0; int taskReportSendId = 0;
// #32782 指示者テーブル関連削除 start
// 指示者か報告者か判断
int mOperationAuthLevel = ABVDataCache.getInstance().getMemberInfo().operationAuthLevel;
boolean attachedChangeFlag = param.get(ABookKeys.ATTACHED_CHANGE_FLAG).equals("1") ? true : false; boolean attachedChangeFlag = param.get(ABookKeys.ATTACHED_CHANGE_FLAG).equals("1") ? true : false;
String taskReport = param.get(ABookKeys.TASK_REPORT); String taskReport = param.get(ABookKeys.TASK_REPORT);
// TODO この処理後、削除
if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
taskReport = param.get(ABookKeys.TASK_DIRECTIONS);
}
JSONObject taskReportJson = new JSONObject(taskReport); JSONObject taskReportJson = new JSONObject(taskReport);
String taskHotSpotInfo = null;
if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
taskHotSpotInfo = param.get(ABookKeys.HOT_SPOT);
}
// #32782 指示者テーブル関連削除 end
int taskReportId = 0; int taskReportId = 0;
String reportStartDate = ""; String reportStartDate = "";
// 指示者の場合下記の処理を行わない if (reportType == Constant.ReportType.Routine) {
if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
if (insertFlg) {
mOperationLogic.insertTaskReport(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true, taskHotSpotInfo);
mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, false);
} else {
mOperationLogic.updateTaskReport(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true, taskHotSpotInfo);
mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, false);
}
} else {
if (routineTaskReportFlg) {
taskReportId = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_ID));
reportStartDate = param.get(ABookKeys.REPORT_START_DATE);
reportStartDate = reportStartDate.replace("T", " ");
//reportStartDate = DateTimeUtil.toString(DateTimeUtil.toDate(reportStartDate, "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen), DateTimeFormat.yyyyMMddHHmmss_hyphen);
RoutineTaskReportDto routineTaskTaskReportDto = mOperationLogic.getRoutineTaskReportUtc(taskKey, taskReportId, reportStartDate);
routineTaskTaskReportDto.jsonData = taskReport;
mOperationLogic.updateRoutineTaskReport(operationId, contentId, routineTaskTaskReportDto, attachedChangeFlag, true, insertFlg, true);
} else {
if (insertFlg) {
mOperationLogic.insertTaskReport(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true, taskHotSpotInfo);
} else {
mOperationLogic.updateTaskReport(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true, taskHotSpotInfo);
}
}
if (routineTaskReportFlg) {
mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, false);
copyRoutineTaskReportAttachedMovie(operationId, contentId, taskKey, taskReportId, reportStartDate);
} else {
mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, false);
copyTaskAttachedMovie(operationId, contentId, taskKey, String.valueOf(taskReportLevel));
}
if (reportUpdateType == Constant.OperationUpdateType.HISTORY_NO) {
//データ無い場合は中でinsertされる
taskReportSendId = mOperationLogic.updateTaskReportSend(taskKey, taskReportId, reportStartDate, taskReportJson, false);
} else {
taskReportSendId = mOperationLogic.insertTaskReportSend(taskKey, taskReportId, reportStartDate, taskReportJson, false);
}
if (reportUpdateType == Constant.OperationUpdateType.HISTORY_ADD) {
if (routineTaskReportFlg) {
mOperationLogic.initialRoutineTaskReport(operationId, contentId, taskKey, taskReportId, reportStartDate);
mOperationLogic.createRoutineTaskReportJson(operationId, contentPath);
} else {
mOperationLogic.initialTaskReport(operationId, contentId, taskKey);
mOperationLogic.createTaskReportJson(operationId, contentPath);
}
}
copyReportTaskSendFiles(operationId, taskKey, taskReportSendId, routineTaskReportFlg, taskReportId, reportStartDate);
if (reportUpdateType == Constant.OperationUpdateType.HISTORY_ADD) {
// 作業報告のディレクトリ削除
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
FileUtil.delete(ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, false));
}
}
}
*/
private void insertOrUpdateTaskReport(String taskKey, int reportUpdateType, long operationId, long contentId, Map<String, String> param, String contentPath, boolean insertFlg, boolean routineTaskReportFlg, int taskReportLevel) throws IOException {
int taskReportSendId = 0;
boolean attachedChangeFlag = param.get(ABookKeys.ATTACHED_CHANGE_FLAG).equals("1") ? true : false;
String taskReport = param.get(ABookKeys.TASK_REPORT);
JSONObject taskReportJson = new JSONObject(taskReport);
int taskReportId = 0;
String reportStartDate = "";
if (routineTaskReportFlg) {
taskReportId = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_ID)); taskReportId = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_ID));
reportStartDate = param.get(ABookKeys.REPORT_START_DATE); reportStartDate = param.get(ABookKeys.REPORT_START_DATE);
reportStartDate = reportStartDate.replace("T", " "); reportStartDate = reportStartDate.replace("T", " ");
//reportStartDate = DateTimeUtil.toString(DateTimeUtil.toDate(reportStartDate, "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen), DateTimeFormat.yyyyMMddHHmmss_hyphen);
RoutineTaskReportDto routineTaskTaskReportDto = mOperationLogic.getRoutineTaskReportUtc(taskKey, taskReportId, reportStartDate); TaskReportDto taskReportDto = mOperationLogic.getRoutineTaskReportUtc(taskKey, taskReportId, reportStartDate);
routineTaskTaskReportDto.jsonData = taskReport; taskReportDto.jsonData = taskReport;
mOperationLogic.updateRoutineTaskReport(operationId, contentId, routineTaskTaskReportDto, attachedChangeFlag, true, insertFlg, true); mOperationLogic.updateRoutineTaskReport(operationId, contentId, taskReportDto, attachedChangeFlag, true, insertFlg, true);
mOperationLogic.createJsonForOperationContent(operationId, contentPath, true);
copyRoutineTaskReportAttachedMovie(operationId, contentId, taskKey, taskReportId, reportStartDate);
} else { } else {
if (insertFlg) { if (taskReportLevel == Constant.TaskReportLevel.ReportType) {
// #32926 作業報告画面改善 start String hotSpotInfo = param.get(ABookKeys.HOT_SPOT);
mOperationLogic.insertTaskReport(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true, taskReportLevel); if (insertFlg) {
// #32926 作業報告画面改善 end mOperationLogic.insertTaskReport(taskKey, operationId, contentId, taskReportJson, hotSpotInfo, null, attachedChangeFlag, true);
} else { } else {
mOperationLogic.updateTaskReport(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true, taskReportLevel); mOperationLogic.updateTaskReport(taskKey, operationId, contentId, taskReportJson, hotSpotInfo, null, attachedChangeFlag, true);
} }
} } else {
if (insertFlg) {
if (routineTaskReportFlg) { mOperationLogic.insertTaskReportReply(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true);
mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, false); } else {
copyRoutineTaskReportAttachedMovie(operationId, contentId, taskKey, taskReportId, reportStartDate, taskReportLevel); mOperationLogic.updateTaskReportReplyLevel(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true);
} else { }
mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, false); }
copyTaskAttachedMovie(operationId, contentId, taskKey, String.valueOf(taskReportLevel)); mOperationLogic.createJsonForOperationContent(operationId, contentPath, false);
copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel);
} }
if (reportUpdateType == Constant.OperationUpdateType.HISTORY_NO) { if (enableReportHistory == Constant.EnableReportHistory.Invalid) {
//データ無い場合は中でinsertされる //データ無い場合は中でinsertされる
taskReportSendId = mOperationLogic.updateTaskReportSend(taskKey, taskReportId, reportStartDate, taskReportJson, false); taskReportSendId = mOperationLogic.updateTaskReportSend(taskKey, taskReportId, reportStartDate, taskReportJson, false);
}else { } else {
taskReportSendId = mOperationLogic.insertTaskReportSend(taskKey, taskReportId, reportStartDate, taskReportJson, false); taskReportSendId = mOperationLogic.insertTaskReportSend(taskKey, taskReportId, reportStartDate, taskReportJson, false);
} }
if (reportUpdateType == Constant.OperationUpdateType.HISTORY_ADD) {
if (routineTaskReportFlg) {
mOperationLogic.initialRoutineTaskReport(operationId, contentId, taskKey, taskReportId, reportStartDate);
mOperationLogic.createRoutineTaskReportJson(operationId, contentPath);
} else {
mOperationLogic.initialTaskReport(operationId, contentId, taskKey);
mOperationLogic.createTaskReportJson(operationId, contentPath);
}
}
// #32926 作業報告画面改善 start // #32926 作業報告画面改善 start
copyReportTaskSendFiles(operationId, taskKey, taskReportSendId, routineTaskReportFlg, taskReportId, reportStartDate, taskReportLevel); copyReportTaskSendFiles(operationId, taskKey, taskReportSendId, reportType == Constant.ReportType.Routine, taskReportId, reportStartDate, taskReportLevel);
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
if (reportUpdateType == Constant.OperationUpdateType.HISTORY_ADD) {
// 作業報告のディレクトリ削除
// #32926 作業報告画面改善 start
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, String.valueOf(taskReportLevel)));
// #32926 作業報告画面改善 end
}
} }
// #32782 指示者テーブル関連削除 end
// xwalkで動画ファイルにアクセスするため、../files/..の以下のパスのディレクトりを../cache/..以下のパスに変更 // xwalkで動画ファイルにアクセスするため、../files/..の以下のパスのディレクトりを../cache/..以下のパスに変更
public void allCopyTaskAttachedMovieFileToCache(long operationId, long contentId, OperationDto operationDto) { public void allCopyTaskAttachedMovieFileToCache(long operationId, long contentId, OperationDto operationDto) {
try { try {
List<TaskDto> taskDtoList = mOperationLogic.getOperationTask(operationId); List<TaskDto> taskDtoList = mOperationLogic.getOperationTask(operationId);
for (TaskDto taskDto : taskDtoList) { for (TaskDto taskDto : taskDtoList) {
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) { List<TaskReportDto> taskReportDtoList = mOperationLogic.getTaskReportByTaskKey(taskDto.taskKey);
List<RoutineTaskReportDto> listRoutineTaskReport = mOperationLogic.getRoutineTaskReportByTaskKey(taskDto.taskKey); for (TaskReportDto taskReportDto : taskReportDtoList) {
for (RoutineTaskReportDto routineTaskDto : listRoutineTaskReport) { if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) {
copyRoutineTaskReportAttachedMovie(operationId, contentId, routineTaskDto.taskKey, routineTaskDto.taskReportId, routineTaskDto.reportStartDate, 0); copyRoutineTaskReportAttachedMovie(operationId, contentId, taskReportDto.taskKey, taskReportDto.taskReportId, taskReportDto.reportStartDate);
} else {
copyTaskAttachedMovie(operationId, contentId, taskDto.taskKey, taskReportDto.taskReportLevel);
} }
} else {
// #32926 作業報告画面改善 start
copyTaskAttachedMovie(operationId, contentId, taskDto.taskKey, String.valueOf(taskDto.taskReportLevel));
// #32926 作業報告画面改善 end
} }
} }
} catch (IOException e) { } catch (IOException e) {
...@@ -667,7 +357,7 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -667,7 +357,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
* @param objReportStartDate * @param objReportStartDate
* @throws IOException * @throws IOException
*/ */
public void copyRoutineTaskReportAttachedMovie(long operationId, long contentId, String taskKey, int taskReportId, Object objReportStartDate, int taskReportLevel) throws IOException { public void copyRoutineTaskReportAttachedMovie(long operationId, long contentId, String taskKey, int taskReportId, Object objReportStartDate) throws IOException {
String reportStartDate; String reportStartDate;
if (objReportStartDate instanceof String) { if (objReportStartDate instanceof String) {
reportStartDate = DateTimeUtil.toString_yyyyMMddHHmmss_none(DateTimeUtil.toDate((String)objReportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen)); reportStartDate = DateTimeUtil.toString_yyyyMMddHHmmss_none(DateTimeUtil.toDate((String)objReportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen));
...@@ -677,7 +367,7 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -677,7 +367,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
return; return;
} }
String taskKeyPath = ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, reportStartDate, taskReportLevel); String taskKeyPath = ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, reportStartDate);
File taskKeyFile = new File(taskKeyPath); File taskKeyFile = new File(taskKeyPath);
// 作業報告書の添付ファイル(mp4,mov拡張子のみ)コピー // 作業報告書の添付ファイル(mp4,mov拡張子のみ)コピー
...@@ -694,17 +384,15 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -694,17 +384,15 @@ public class ABookCheckWebViewHelper extends ABookHelper {
} }
/** /**
* /.../files/ABook/project/{projectId}/{taskKey}/{taskType}/*.(mov,mp4)を * /.../files/ABook/project/{projectId}/{taskKey}/{taskType}/{taskReportLevel}/*.(mov,mp4)を
* /.../cache/{contentId}/attachedMovie/{taskKey}/{taskType}/*.(mov,mp4)にコピー * /.../cache/{contentId}/attachedMovie/{taskKey}/{taskType}/{taskReportLevel}/*.(mov,mp4)にコピー
* *
* @param operationId * @param operationId
* @param contentId * @param contentId
*/ */
// #32926 作業報告画面改善 start public void copyTaskAttachedMovie(long operationId, long contentId, String taskKey, int taskReportLevel) throws IOException {
public void copyTaskAttachedMovie(long operationId, long contentId, String taskKey, String taskReportLevel) throws IOException {
// 作業指示書の添付ファイル(mp4,mov拡張子のみ)コピー // 作業指示書の添付ファイル(mp4,mov拡張子のみ)コピー
String taskKeyPath = ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel); String taskKeyPath = ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel);
// #32926 作業報告画面改善 end
File taskKeyFile = new File(taskKeyPath); File taskKeyFile = new File(taskKeyPath);
if (taskKeyFile.exists()) { if (taskKeyFile.exists()) {
String attachedMoviesFilePath = ABVEnvironment.getInstance().getAttachedDirectionOrReportDirPath(contentId, taskKey, taskReportLevel); String attachedMoviesFilePath = ABVEnvironment.getInstance().getAttachedDirectionOrReportDirPath(contentId, taskKey, taskReportLevel);
...@@ -718,21 +406,6 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -718,21 +406,6 @@ public class ABookCheckWebViewHelper extends ABookHelper {
} }
} }
} }
// 作業報告書の添付ファイル(mp4,mov拡張子のみ)コピー
if (ABVDataCache.getInstance().getMemberInfo().operationAuthLevel == OperationAuthLevel.WORKER) {
taskKeyPath = ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, taskReportLevel);
taskKeyFile = new File(taskKeyPath);
if (taskKeyFile.exists()) {
String attachedMoviesFilePath = ABVEnvironment.getInstance().getAttachedDirectionOrReportDirPath(contentId, taskKey, taskReportLevel);
FileUtil.delete(attachedMoviesFilePath);
FileUtil.createNewDirectory(attachedMoviesFilePath);
for (String taskAttachedFile : taskKeyFile.list()) {
if (StringUtil.endsWithAny(taskAttachedFile.toLowerCase(), "mov", "mp4")) {
FileUtil.copy(taskKeyPath + "/" + taskAttachedFile, attachedMoviesFilePath + "/" + taskAttachedFile, true);
}
}
}
}
} }
/** /**
...@@ -753,10 +426,10 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -753,10 +426,10 @@ public class ABookCheckWebViewHelper extends ABookHelper {
if (routineTaskReportFlg) { if (routineTaskReportFlg) {
dReportStartDate = DateTimeUtil.toDate(reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen); dReportStartDate = DateTimeUtil.toDate(reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen);
sReportStartDate = DateTimeUtil.toString_yyyyMMddHHmmss_none(dReportStartDate); sReportStartDate = DateTimeUtil.toString_yyyyMMddHHmmss_none(dReportStartDate);
taskAttachedPath = ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, sReportStartDate, taskReportLevel); taskAttachedPath = ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, sReportStartDate);
} else { } else {
// #32926 作業報告画面改善 start // #32926 作業報告画面改善 start
taskAttachedPath = ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, String.valueOf(taskReportLevel)); taskAttachedPath = ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel);
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
} }
File taskAttachedFiles = new File(taskAttachedPath); File taskAttachedFiles = new File(taskAttachedPath);
...@@ -764,15 +437,17 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -764,15 +437,17 @@ public class ABookCheckWebViewHelper extends ABookHelper {
if (taskAttachedFiles.exists()) { if (taskAttachedFiles.exists()) {
String taskReportSendPath; String taskReportSendPath;
if (routineTaskReportFlg) { if (routineTaskReportFlg) {
taskReportSendPath = ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, taskKey, taskReportId, sReportStartDate, taskReportSendId, taskReportLevel); taskReportSendPath = ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, taskKey, taskReportId, sReportStartDate, taskReportSendId);
} else { } else {
taskReportSendPath = ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskKey, taskReportSendId, taskReportLevel); taskReportSendPath = ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskKey, taskReportLevel, taskReportSendId);
} }
FileUtil.delete(taskReportSendPath); FileUtil.delete(taskReportSendPath);
FileUtil.createNewDirectory(taskReportSendPath); FileUtil.createNewDirectory(taskReportSendPath);
for (String taskAttachedFile : taskAttachedFiles.list()) { for (String taskAttachedFile : taskAttachedFiles.list()) {
FileUtil.copy(taskAttachedPath + "/" + taskAttachedFile, taskReportSendPath + "/" + taskAttachedFile, true); if (!taskAttachedFile.equals(ABVEnvironment.getInstance().REPORT_SEND)) {
FileUtil.copy(taskAttachedPath + "/" + taskAttachedFile, taskReportSendPath + "/" + taskAttachedFile, true);
}
} }
} }
} }
...@@ -789,7 +464,7 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -789,7 +464,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
@Override @Override
protected Void doInBackground(Void... params) { protected Void doInBackground(Void... params) {
try { try {
String taskReportSendPath = ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskKey, taskReportSendId, taskReportLevel); String taskReportSendPath = ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskKey, taskReportLevel, taskReportSendId);
FileUtil.delete(taskReportSendPath); FileUtil.delete(taskReportSendPath);
} catch (Exception ex) { } catch (Exception ex) {
Logger.e(String.format("%s.deleteReportTaskSendFiles(%d, %s)", TAG, operationId, taskKey), ex); Logger.e(String.format("%s.deleteReportTaskSendFiles(%d, %s)", TAG, operationId, taskKey), ex);
......
...@@ -63,8 +63,8 @@ public class OperationListHelper { ...@@ -63,8 +63,8 @@ public class OperationListHelper {
private List<OperationDto> filterOperationList() { private List<OperationDto> filterOperationList() {
try { try {
String operationReportTypeStr = PreferenceUtil.getUserPref(mAppActivity, AppDefType.UserPrefKey.OPERATION_REPORT_TYPES, null); String reportTypeStr = PreferenceUtil.getUserPref(mAppActivity, AppDefType.UserPrefKey.OPERATION_REPORT_TYPES, null);
operationDtoList = mOperationLogic.getRefreshOperation(mAppActivity.mSearchWord, mAppActivity.mStartDateStr, mAppActivity.mEndDateStr, operationReportTypeStr); operationDtoList = mOperationLogic.getRefreshOperation(mAppActivity.mSearchWord, mAppActivity.mStartDateStr, mAppActivity.mEndDateStr, reportTypeStr);
} catch (Exception e) { } catch (Exception e) {
Logger.e(TAG, "findOperationList", e); Logger.e(TAG, "findOperationList", e);
ErrorMessage.showErrorMessageToast(mAppActivity.getApplicationContext(), ErrorCode.E107); ErrorMessage.showErrorMessageToast(mAppActivity.getApplicationContext(), ErrorCode.E107);
......
...@@ -4954,14 +4954,10 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -4954,14 +4954,10 @@ public class ContentViewActivity extends ABVContentViewActivity {
String cmd = checkParam.get(ABookKeys.CMD); String cmd = checkParam.get(ABookKeys.CMD);
switch (cmd) { switch (cmd) {
case ABookKeys.CMD_INSERT_TASK_DIRECTIONS: // 作業指示の登録
case ABookKeys.CMD_UPDATE_TASK_DIRECTIONS: // 作業指示の更新
case ABookKeys.CMD_DELETE_TASK_DIRECTIONS: // 作業指示の削除
case ABookKeys.CMD_INSERT_TASK_REPORT: // 作業報告の登録 case ABookKeys.CMD_INSERT_TASK_REPORT: // 作業報告の登録
case ABookKeys.CMD_UPDATE_TASK_REPORT: // 作業報告の更新 case ABookKeys.CMD_UPDATE_TASK_REPORT: // 作業報告の更新
case ABookKeys.CMD_DELETE_TASK_REPORT: // 作業報告の削除 case ABookKeys.CMD_DELETE_TASK_REPORT: // 作業報告の削除
getTaskHotspotJSON(); getTaskHotspotJSON();
case ABookKeys.CMD_CANCEL_TASK_DIRECTIONS: // 作業指示のキャンセル
case ABookKeys.CMD_CANCEL_TASK_REPORT: // 作業報告のキャンセル case ABookKeys.CMD_CANCEL_TASK_REPORT: // 作業報告のキャンセル
if(operationTaskDto != null) { if(operationTaskDto != null) {
updateOperationTaskPosition(operationTaskDto.pdfX, operationTaskDto.pdfY); updateOperationTaskPosition(operationTaskDto.pdfX, operationTaskDto.pdfY);
...@@ -5165,7 +5161,6 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5165,7 +5161,6 @@ public class ContentViewActivity extends ABVContentViewActivity {
} }
public void showOperationTaskLayout(ZoomRelativeLayout layout, OperationTaskDto operationTaskDto, float clickX) { public void showOperationTaskLayout(ZoomRelativeLayout layout, OperationTaskDto operationTaskDto, float clickX) {
//setCurrentOperationTask(layout, currentTaskDto);
operationTaskLayout.showTaskForm(layout, mXWalkOpenType, operationTaskDto, isNormalSize(), clickX); operationTaskLayout.showTaskForm(layout, mXWalkOpenType, operationTaskDto, isNormalSize(), clickX);
// 拡大・縮小・切替ボタンの非表示 // 拡大・縮小・切替ボタンの非表示
mScaleZoomLayout.setVisibility(View.INVISIBLE); mScaleZoomLayout.setVisibility(View.INVISIBLE);
...@@ -5176,6 +5171,9 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5176,6 +5171,9 @@ public class ContentViewActivity extends ABVContentViewActivity {
String taskKey = checkParam.get(ABookKeys.TASK_KEY); String taskKey = checkParam.get(ABookKeys.TASK_KEY);
String taskCode = ""; String taskCode = "";
// 作業報告レベル
int taskReportLevel = Integer.parseInt(checkParam.get(ABookKeys.TASK_REPORT_LEVEL));
// フォームが閉じられたと見做すので、以下の処理を行う // フォームが閉じられたと見做すので、以下の処理を行う
isOpenedOperationTask = false; isOpenedOperationTask = false;
// 拡大・縮小・切替ボタンの表示 // 拡大・縮小・切替ボタンの表示
...@@ -5183,13 +5181,11 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5183,13 +5181,11 @@ public class ContentViewActivity extends ABVContentViewActivity {
if (operationTaskLayout.currentLayout != null && !StringUtil.isNullOrEmpty(taskKey)) { if (operationTaskLayout.currentLayout != null && !StringUtil.isNullOrEmpty(taskKey)) {
switch(cmd){ switch(cmd){
case ABookKeys.CMD_INSERT_TASK_DIRECTIONS:
case ABookKeys.CMD_UPDATE_TASK_DIRECTIONS:
// #32782 指示者テーブル関連削除 start // #32782 指示者テーブル関連削除 start
case ABookKeys.CMD_INSERT_TASK_REPORT: case ABookKeys.CMD_INSERT_TASK_REPORT:
case ABookKeys.CMD_UPDATE_TASK_REPORT: case ABookKeys.CMD_UPDATE_TASK_REPORT:
case ABookKeys.CMD_DELETE_TASK_REPORT:
if (ABVDataCache.getInstance().getMemberInfo().operationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) { if (taskReportLevel == Constant.TaskReportLevel.ReportType) {
JSONObject hotspot = new JSONObject(checkParam.get(ABookKeys.HOT_SPOT)); JSONObject hotspot = new JSONObject(checkParam.get(ABookKeys.HOT_SPOT));
taskCode = hotspot.getString(ABookKeys.TASK_CODE); taskCode = hotspot.getString(ABookKeys.TASK_CODE);
...@@ -5202,17 +5198,19 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5202,17 +5198,19 @@ public class ContentViewActivity extends ABVContentViewActivity {
} else { } else {
operationTaskLayout.setIconStatus(taskKey, false); operationTaskLayout.setIconStatus(taskKey, false);
} }
// #32782 指示者テーブル関連削除 end
break;
case ABookKeys.CMD_DELETE_TASK_DIRECTIONS:
operationTaskLayout.setIconStatus(taskKey, true);
//hideOperationTaskLayout();
break;
break;
case ABookKeys.CMD_DELETE_TASK_REPORT:
if (taskReportLevel == Constant.TaskReportLevel.ReportType) {
operationTaskLayout.setIconStatus(taskKey, true);
} else {
operationTaskLayout.setIconStatus(taskKey, false);
}
break;
default: default:
operationTaskLayout.setIconStatus(taskKey, false); operationTaskLayout.setIconStatus(taskKey, false);
break; break;
} }
operationTaskLayout.currentTaskDto = null; operationTaskLayout.currentTaskDto = null;
} }
} }
...@@ -5245,7 +5243,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5245,7 +5243,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
} }
public int getOperationReportUpdateType() { public int getOperationReportUpdateType() {
return reportUpdateType; return enableReportHistory;
} }
/** /**
......
...@@ -50,13 +50,6 @@ public class OperationTaskLayout extends RelativeLayout { ...@@ -50,13 +50,6 @@ public class OperationTaskLayout extends RelativeLayout {
private static final int ICON_WIDTH = 32; private static final int ICON_WIDTH = 32;
private static final int ICON_HEIGHT = 32; private static final int ICON_HEIGHT = 32;
// 仮)ピンのイメージアイコンのサイズ
private static final int PIN_ICON_WIDTH = 20;
private static final int PIN_ICON_HEIGHT = 40;
// 仮)終了のピンのイメージアイコンのサイズ
private static final int PIN_FINISHED_ICON_WIDTH = 20;
private static final int PIN_FINISHED_ICON_HEIGHT = 40;
private static final int CODE_WIDTH = 46; private static final int CODE_WIDTH = 46;
private static final int CODE_HEIGHT = 26; private static final int CODE_HEIGHT = 26;
...@@ -194,13 +187,10 @@ public class OperationTaskLayout extends RelativeLayout { ...@@ -194,13 +187,10 @@ public class OperationTaskLayout extends RelativeLayout {
// ピンで表示 // ピンで表示
final ActionOperationTaskPin taskPin = new ActionOperationTaskPin(mContext, dto); final ActionOperationTaskPin taskPin = new ActionOperationTaskPin(mContext, dto);
taskPin.taskKey = dto.taskKey; taskPin.taskKey = dto.taskKey;
if (dto.isFinished) {
width = (int) (PIN_FINISHED_ICON_WIDTH * density); // ピンのイメージアイコンのサイズセット
height = (int) (PIN_FINISHED_ICON_HEIGHT * density); width = (int) mContext.getResources().getDimensionPixelSize(R.dimen.operation_pin_icon_width);
} else { height = (int) mContext.getResources().getDimensionPixelSize(R.dimen.operation_pin_icon_height);
width = (int) (PIN_ICON_WIDTH * density);
height = (int) (PIN_ICON_HEIGHT * density);
}
params = new RelativeLayout.LayoutParams(width, height); params = new RelativeLayout.LayoutParams(width, height);
taskPin.setVisibility(View.INVISIBLE); taskPin.setVisibility(View.INVISIBLE);
...@@ -282,11 +272,7 @@ public class OperationTaskLayout extends RelativeLayout { ...@@ -282,11 +272,7 @@ public class OperationTaskLayout extends RelativeLayout {
} }
private boolean isTaskFinished(String taskKey) { private boolean isTaskFinished(String taskKey) {
if(mContext.getOperationReportUpdateType() == Constant.OperationUpdateType.HISTORY_ADD) { return mTaskDao.getTaskByTaskKey(taskKey).taskStatus == FINISHED_STATUS;
return false;
} else {
return mTaskDao.getTaskByTaskKey(taskKey).taskStatus == FINISHED_STATUS;
}
} }
public void showTaskList(int pageNum, boolean isNormalSize) { public void showTaskList(int pageNum, boolean isNormalSize) {
......
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