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;
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.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.ServiceOptionsJSON;
import jp.agentec.abook.abv.bl.acms.client.json.FixPushMessageJSON;
......@@ -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.RequirePasswordChangeCode;
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.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.ABVException;
......@@ -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.MemberInfoDto;
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.HttpFileDownloader;
import jp.agentec.adf.net.http.HttpMultipart;
import jp.agentec.adf.net.http.HttpParameterObject;
import jp.agentec.adf.net.http.HttpRequestSender;
import jp.agentec.adf.net.http.HttpResponse;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.StringUtil;
......@@ -505,29 +505,27 @@ public class AcmsClient implements AcmsClientResponseListener {
}
//作業者グループ取得
public WorkerGroupJSON getWorkerGroupList(AcmsParameters param) throws NetworkDisconnectedException, AcmsException {
HttpResponse response = send(AcmsApis.ApiWorkerGroupList, param);
public WorkerGroupJSON getWorkingGroupList(AcmsParameters param) throws NetworkDisconnectedException, AcmsException {
HttpResponse response = send(AcmsApis.ApiWorkingGroupList, param);
WorkerGroupJSON json = new WorkerGroupJSON(response.httpResponseBody);
return json;
}
/**
* 作業データ送信
* 作業報告データ送信
* @param sid
* @param operationId
* @param taskKey
* @param delFlag
* @param taskType
* @param taskHotspotInfo
* @param taskReportInfo
* @param taskReportDto
* @param formFile
* @param taskReportSendSaveDate
* @param reportType
* @return
* @throws AcmsException
* @throws ABVException
* @throws NetworkDisconnectedException
* @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のチェック
throw new NetworkDisconnectedException();
}
......@@ -535,39 +533,48 @@ public class AcmsClient implements AcmsClientResponseListener {
String apiUrl = AcmsApis.getApiUrl(env.acmsAddress, urlPath, AcmsApis.ApiSendTaskData);
List<HttpMultipart> HttpMultipartList = new ArrayList<HttpMultipart>();
HttpMultipartList.add(new HttpMultipart(ABookKeys.SID, sid));
HttpMultipartList.add(new HttpMultipart(ABookKeys.OPERATION_ID, operationId));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_KEY, taskKey));
HttpMultipartList.add(new HttpMultipart(ABookKeys.DEL_FLAG, delFlag));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_TYPE, taskType));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_HOT_SPOT_INFO, taskHotspotInfo));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_INFO, taskReportInfo));
HttpMultipartList.add(new HttpMultipart(ABookKeys.ATTACHED_CHANGE_FLAG, attachedFileSendFlg ? "1" : "0"));
HttpMultipartList.add(new HttpMultipart(ABookKeys.OPERATION_ID, StringUtil.toString(operationId)));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_KEY, taskReportDto.taskKey));
HttpMultipartList.add(new HttpMultipart(ABookKeys.DEL_FLAG, taskReportDto.delFlg ? "1" : "0"));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_LEVEL, StringUtil.toString(taskReportDto.taskReportLevel)));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_HOT_SPOT_INFO, taskReportDto.taskHotSpotInfo));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_INFO, taskReportDto.jsonData));
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) {
HttpMultipartList.add(new HttpMultipart(ABookKeys.FORM_FILE, formFile));
}
if (taskReportSendSaveDate != null) {
String sendDate = DateTimeUtil.toStringInTimeZone(taskReportSendSaveDate, DateTimeFormat.yyyyMMddHHmmss_hyphen, "GMT") + ",GMT";
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_SAVE_DATE, sendDate));
}
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_SAVE_DATE, DateTimeUtil.toStringForCmsGMT(taskReportSendSaveDate)));
}
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);
Logger.d(TAG, "sendTaskData res: %s", json);
if (json.errorMessage != null) {
if (json.errorMessage[0].equals("P003")) {
throw new ABVException(ABVExceptionCode.P_E_ACMS_P003);
} else if (json.errorMessage[0].equals("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) {
throw new AcmsException(ABVExceptionCode.S_E_ACMS_0001, json);
}
return json;
}
......@@ -645,19 +652,6 @@ public class AcmsClient implements AcmsClientResponseListener {
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
......@@ -836,7 +830,7 @@ public class AcmsClient implements AcmsClientResponseListener {
HttpTaskWorker<HttpParameterObject> httpTaskThread = new HttpTaskWorker<HttpParameterObject>(methodName, apiUrl, param);
try{
try {
httpTaskThread.start();
httpTaskThread.join(HttpRequestSender.DefaultConnectionTimeout);
} catch (Exception e) {
......
......@@ -7,9 +7,7 @@ import java.util.ArrayList;
import java.util.Date;
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.dto.TaskDirectionsDto;
import jp.agentec.abook.abv.bl.dto.TaskDto;
import jp.agentec.abook.abv.bl.dto.TaskReportDto;
import jp.agentec.adf.util.DateTimeFormat;
......@@ -20,35 +18,30 @@ import jp.agentec.adf.util.DateTimeUtil;
*/
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 OperationId = "projectId";
public static final String OperationId = "operationId";
public static final String TaskId = "taskId";
public static final String TaskKey = "taskKey";
public static final String TaskCode = "taskCode";
public static final String TaskStatus = "taskStatus";
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";
// 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 Date lastEditDate;
// #32926 作業報告画面改善 start
public static final String TaskReportLevel = "taskReportLevel";
// #32926 作業報告画面改善 end
public OperationDataJSON(String jsonString) throws AcmsException {
super(jsonString);
}
......@@ -62,12 +55,6 @@ public class OperationDataJSON extends AcmsCommonJSON {
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);
......@@ -76,25 +63,43 @@ public class OperationDataJSON extends AcmsCommonJSON {
dto.taskStatus = taskJson.getInt(TaskStatus);
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);
if (object instanceof String) {
dto.taskReportDto.jsonData = null;
} else {
dto.taskReportDto.jsonData = taskJson.getJSONObject(TaskReportInfo).toString();
// 作業報告詳細リスト
JSONArray taskReportList = taskJson.getJSONArray(TaskReportList);
dto.taskReportDtoList = new ArrayList<TaskReportDto>();
for (int j = 0; j < taskReportList.length(); j++) {
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);
}
}
......
......@@ -6,11 +6,11 @@ import org.json.adf.JSONObject;
import java.util.ArrayList;
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.dto.OperationContentDto;
import jp.agentec.abook.abv.bl.dto.OperationDto;
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.DateTimeUtil;
......@@ -20,33 +20,39 @@ import jp.agentec.adf.util.DateTimeUtil;
public class OperationListJSON extends AcmsCommonJSON {
// TODO
// サーバ作業後、対応必要「project」→「operation」
public static final String OperationList = "projectList";
public static final String OperationId = "projectId";
public static final String OperationName = "projectName";
public static final String OperationDescriptions = "projectDescriptions";
public static final String OperationStartDate = "projectStartDate";
public static final String OperationEndDate = "projectEndDate";
public static final String OperationType = "projectType";
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 OperationList = "operationList";
public static final String OperationId = "operationId";
public static final String OperationType = "operationType";
public static final String ReportType = "reportType";
public static final String OperationName = "operationName";
public static final String OperationDescriptions = "operationDescriptions";
public static final String OperationStartDate = "operationStartDate";
public static final String OperationEndDate = "operationEndDate";
public static final String OperationLastEditDate = "operationLastEditDate";
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 PushMessageList = "pushMessageList";
public static final String PushMessageId = "pushMessageId";
public static final String PushSendLoginId = "pushSendLoginId";
public static final String PushSendDate = "pushSendDate";
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 static final String PushMessage = "pushMessage";
public List<OperationDto> operationList;
......@@ -64,21 +70,22 @@ public class OperationListJSON extends AcmsCommonJSON {
JSONObject operationJson = operations.getJSONObject(i);
OperationDto dto = new OperationDto();
dto.operationContentDtoList = new ArrayList<OperationContentDto>();
dto.taskWorkerGroupDtoList = new ArrayList<TaskWorkerGroupDto>();
dto.operationId = operationJson.getLong(OperationId);
dto.operationType = operationJson.getInt(OperationType);
dto.operationName = operationJson.getString(OperationName);
dto.operationDescriptions = operationJson.getString(OperationDescriptions);
dto.operationStartDate = DateTimeUtil.toDate(operationJson.getString(OperationStartDate), "UTC", DateTimeFormat.yyyyMMdd_hyphen);
dto.operationEndDate = DateTimeUtil.toDate(operationJson.getString(OperationEndDate), "UTC", DateTimeFormat.yyyyMMdd_hyphen);
dto.operationType = operationJson.getInt(OperationType);
dto.reportUpdateType = operationJson.has(ReportUpdateType) ? operationJson.getInt(ReportUpdateType) : 0;
dto.reportType = operationJson.getInt(ReportType); // 作業報告タイプ
dto.enableReportHistory = operationJson.getInt(EnableReportHistory); // 報告履歴管理
dto.enableReportEdit = operationJson.has(EnableReportEdit) ? operationJson.getInt(EnableReportEdit) : 0; // 作業編集区分
// 作業終了更新日
if (operationJson.has(OperationLastEditDate)) {
dto.lastEditDate = DateTimeUtil.toDate(operationJson.getString(OperationLastEditDate), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
}
if (operationJson.has(OperationReportType)) {
dto.operationReportType = operationJson.getInt(OperationReportType);
}
if (operationJson.has(ReportCycle)) {
dto.reportCycle = operationJson.getInt(ReportCycle);
}
......@@ -124,6 +131,26 @@ public class OperationListJSON extends AcmsCommonJSON {
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);
}
}
......
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 {
this.operationId = operationId;
}
// TODO
// サーバ作業後、対応必要「project」→「operation」
public long getProjectId() {
public long getOperationId() {
return operationId;
}
......
......@@ -133,13 +133,13 @@ public class AcmsApis {
// デバイストークン更新
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 ApiGetOperationData = "getProjectData";
public static final String ApiGetOperationData = "getOperationData";
// 定期点検データ取得
public static final String ApiGetRoutineTaskData = "getProjectInspectData";
// 作業ファイル取得
......@@ -196,7 +196,7 @@ public class AcmsApis {
if (methodName.equals(ApiUrlNewAppStoreLogin) || methodName.equals(ApiUrlAppStoreNewLogin) || methodName.equals(ApiUrlServerTime) || methodName.equals(ApiUrlServerTimeZone)) {
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(ApiSendPushMessage) || methodName.equals(ApiGetPushMessages) || methodName.equals(ApiGetRoutineTaskData) || methodName.equals(ApiSendRoutineTaskData)) {
apiValue = Constant.ApiValue.checkapi;
......
......@@ -140,9 +140,9 @@ public class ABVEnvironment {
public static final String SavedOzFileFormat = OperationDirectionOrReportDirFormat + TaskReportLevelDir + "/%s";
public static final String RoutineTaskSavedOzFileFormat = OperationDirectionOrReportDirFormat + TaskReportLevelDir + "/%d/%s/%s";
public static final String OperationTaskKeyReportSendDirFormat = OperationTaskKeyDirFormat + TaskReportLevelDir + "/reportSend/%d";
public static final String OperationTaskKeyRoutineTaskReportSendDirFormat = OperationTaskKeyDirFormat + TaskReportLevelDir + "/reportSend/%d/%s/%d";
public static final String OperationTaskKeyRoutineTaskReportSendDirFormatForDelete = OperationTaskKeyDirFormat + TaskReportLevelDir + "/reportSend/%d/%s";
public static final String OperationTaskKeyRoutineTaskReportDirFormat = OperationTaskKeyDirFormat + TaskReportLevelDir + "/report/%d/%s";
public static final String OperationTaskKeyRoutineTaskReportSendDirFormat = OperationTaskKeyDirFormat + "/reportSend/%d/%s/%d";
public static final String OperationTaskKeyRoutineTaskReportSendDirFormatForDelete = OperationTaskKeyDirFormat + "/reportSend/%d/%s";
public static final String OperationTaskKeyRoutineTaskReportDirFormat = OperationTaskKeyDirFormat + "/report/%d/%s";
// #32926 作業報告画面改善 end
/**
......@@ -678,32 +678,43 @@ public class ABVEnvironment {
return String.format(OperationTaskKeyDirFormat, rootDirectory, operationId, taskKey);
}
// #32926 作業報告画面改善 start
// taskReportLevelの値によってディレクトリを構成
public String getOperationTaskReportSendDirFilePath(long operationId, String taskKey, int taskReportSendId, int taskReportLevel) {
return String.format(OperationTaskKeyReportSendDirFormat, rootDirectory, operationId, taskKey, String.valueOf(taskReportLevel), taskReportSendId);
public String getOperationTaskReportSendDirFilePath(long operationId, String taskKey, int taskReportLevel, int taskReportSendId) {
return String.format(OperationTaskKeyReportSendDirFormat, rootDirectory, operationId, taskKey, taskReportLevel, taskReportSendId);
}
public String getRoutineTaskReportSendDirFilePath(long operationId, String taskKey, int taskReportId, String reportStartDate, int taskReportLevel) {
return String.format(OperationTaskKeyRoutineTaskReportSendDirFormatForDelete, rootDirectory, operationId, taskKey, String.valueOf(taskReportLevel), taskReportId, getReportDate(reportStartDate));
public String getRoutineTaskReportSendDirFilePath(long operationId, String taskKey, int taskReportId, String 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) {
return String.format(OperationTaskKeyRoutineTaskReportSendDirFormat, rootDirectory, operationId, taskKey, String.valueOf(taskReportLevel), taskReportId, getReportDate(reportStartDate), taskReportSendId);
public String getRoutineTaskReportSendDirFilePath(long operationId, String taskKey, int taskReportId, String reportStartDate, int 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) {
return String.format(OperationTaskKeyRoutineTaskReportDirFormat, rootDirectory, operationId, taskKey, String.valueOf(taskReportLevel), taskReportId, getReportDate(reportStartDate));
public String getRoutineTaskReportDirFilePath(long operationId, String taskKey, int taskReportId, String reportStartDate) {
return String.format(OperationTaskKeyRoutineTaskReportDirFormat, rootDirectory, operationId, taskKey, taskReportId, getReportDate(reportStartDate));
}
public String getOperationDirectionOrReportDirPath(long operationId, String taskKey, String taskReportLevel) {
return String.format(OperationDirectionOrReportDirFormat, rootDirectory, operationId, taskKey, taskReportLevel);
public String getOperationDirectionOrReportDirPath(long operationId, String taskKey, int 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) {
return String.format(OperationDirectionOrReportDirFormat, rootDirectory, operationId, taskKey, REPORT_SEND);
......@@ -716,8 +727,8 @@ public class ABVEnvironment {
// #32926 作業報告画面改善 start
// taskReportLevelの値によってディレクトリを構成
public String getAttachedDirectionOrReportDirPath(long contentId, String taskKey, String taskReportLevel) {
return String.format(AttachedMoviesTaskTypeDir, cacheDirectory, contentId, taskKey, taskReportLevel);
public String getAttachedDirectionOrReportDirPath(long contentId, String taskKey, int taskReportLevel) {
return String.format(AttachedMoviesTaskTypeDir, cacheDirectory, contentId, taskKey, String.valueOf(taskReportLevel));
}
// #32926 作業報告画面改善 end
......
......@@ -88,17 +88,10 @@ public class Constant {
String REPORT_GPS = "reportGps";
}
public interface OperationUpdateType {
int HISTORY_NO = 0;
int HISTORY_ADD = 1;
int HISTORY_UPDATE = 2;
}
public interface OperationReportType {
// TODO 変数名は仮実装、変更必要
int DEFAULT = 0;
int REPORT_TYPE = 0;
int ROUTINE_TASK = 1;
int REPORT_TYPE = 2;
int REPORT_RESPONSE_TYPE = 2;
}
public interface PushMessageSendType {
......@@ -141,11 +134,26 @@ public class Constant {
int Audio =3;
}
// #32926 作業報告画面改善 start
public interface TaskReportLevel {
int ReportType = 0; // 報告タイプ
int ReportReplyType = 1; // 報告(回答)タイプ
}
public interface ReportType {
int Report = 0; // 報告
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 {
public static final String CONTENT_ID = "contentId";
public static final String CONTENT_NAME = "contentName";
public static final String CONTENT_TYPE = "contentType";
public static final String OPERATION_ID = "projectId";
public static final String OPERATION_NAME = "projectName";
public static final String OPERATION_ID = "operationId";
public static final String OPERATION_NAME = "operationName";
// ABOOKCHECK SCHEME
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_SHOW_DIRECTION_OZD = "showDirectionOzd";
public static final String CMD_PREVIEW_DIRECTION_OZD = "previewDirectionOzd";
......@@ -50,6 +43,7 @@ public class ABookKeys {
public static final String READ_ONLY_FLG = "readOnlyFlg";
public static final String DIRECTION_FLG = "directionFlg";
public static final String ATTACHED_CHANGE_FLAG = "attachedChangeFlag";
public static final String ROUTINE_TASK_FLAG = "routineTaskFlag";
// #32782 指示者テーブル関連削除 start
// TODO change TASK_DIRECTIONS 削除が必要
// public static final String TASK_DIRECTIONS = "taskReport";
......@@ -77,7 +71,7 @@ public class ABookKeys {
public static final String SID = "sid";
public static final String FORM_FILE = "formFile";
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_REPORT_INFO = "taskReportInfo";
public static final String TASK_REPORT_SAVE_DATE = "saveDate";
......@@ -123,7 +117,6 @@ public class ABookKeys {
public static final String CMD_LOCAL_SAVE_TASK_REPORT = "localSaveTaskReport"; // 一時保存
// #32861 作業情報追加 end
// #32926 作業報告画面改善 start
public static final String TASK_REPORT_LEVEL = "taskReportLevel"; // 作業報告レベル(0:報告、1:報告(回答)、2:報告(回答))
public static final String TASK_HAS_AUTHORITY = "taskHasAuthority";
public static final String HAS_AUTHORITY = "hasAuthority";
// #32926 作業報告画面改善 end
}
......@@ -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.RContentCategory;
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.TContent;
import jp.agentec.abook.abv.bl.data.tables.TContentBookmark;
......@@ -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.TContentTag;
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.TOperation;
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.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.TTaskReportItems;
import jp.agentec.abook.abv.bl.data.tables.TTaskReportSend;
......@@ -89,18 +87,13 @@ public class ABVDataOpenHelper {
iTableScripts.add(new MWorkerGroup());
iTableScripts.add(new TOperation());
iTableScripts.add(new RTaskWorkerGroup());
iTableScripts.add(new ROperationContent());
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 TTaskReportSend());
iTableScripts.add(new TTaskReportItems());
iTableScripts.add(new TPushMessage());
iTableScripts.add(new TRoutineTaskReport());
return iTableScripts;
}
......
......@@ -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型リストで返します。
......
......@@ -94,10 +94,10 @@ public class PushMessageDao extends AbstractDao {
public List<PushMessageDto> selectAll() {
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(" INNER JOIN t_project AS tp ");
sql.append(" ON tpm.operation_id = tp.operation_id ");
sql.append(" INNER JOIN t_operation AS top ");
sql.append(" ON tpm.operation_id = top.operation_id ");
sql.append(" ORDER BY tpm.push_message_id DESC ");
Logger.v(TAG, "sql=%s", sql);
return rawQueryGetDtoList(sql.toString(), null, PushMessageDto.class);
......@@ -106,10 +106,10 @@ public class PushMessageDao extends AbstractDao {
public PushMessageDto select(long pushMessageId) {
String[] args = new String[] { "" + pushMessageId };
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(" INNER JOIN t_project AS tp ");
sql.append(" ON tpm.operation_id = tp.operation_id ");
sql.append(" INNER JOIN t_operation AS top ");
sql.append(" ON tpm.operation_id = top.operation_id ");
sql.append(" WHERE tpm.push_message_id = ? ");
Logger.v(TAG, "sql=%s", sql);
return rawQueryGetDto(sql.toString(), args, PushMessageDto.class);
......
......@@ -99,24 +99,12 @@ public class TaskDao extends AbstractDao {
/**
* 作業削除
* @param taskKey
* @param directionFlg
*/
public void deleteTaskData(String taskKey, boolean directionFlg) {
public void deleteTaskData(String taskKey) {
String[] keyValues = new String[]{""+ taskKey};
if (directionFlg) {
delete("t_task", "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);
}
delete("t_task", "task_key=?", keyValues);
delete("t_task_report", "task_key=?", keyValues);
delete("t_task_report_items", "task_key=?", keyValues);
}
/**
......@@ -125,11 +113,6 @@ public class TaskDao extends AbstractDao {
*/
public void delete(TaskDto dto) {
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_items", "task_key=?", dto.getKeyValues());
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
......@@ -22,6 +22,12 @@ public class TaskReportItemsDao extends AbstractDao {
if (column != -1) {
dto.taskKey = cursor.getString(column);
}
column = cursor.getColumnIndex("task_report_level");
if (column != -1) {
dto.taskReportLevel = cursor.getInt(column);
}
column = cursor.getColumnIndex("item_key");
if (column != -1) {
dto.itemKey = cursor.getString(column);
......@@ -35,11 +41,11 @@ public class TaskReportItemsDao extends AbstractDao {
}
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) {
return rawQueryGetDtoList("select * from t_task_report_items where task_key=?", new String[]{"" + taskKey}, TaskReportItemsDto.class);
public List<TaskReportItemsDto> getTaskReportItemByTaskKey(String taskKey, int taskReportLevel) {
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) {
......@@ -55,7 +61,7 @@ public class TaskReportItemsDao extends AbstractDao {
}
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);
}
}
\ 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 {
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() {
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 {
sql.append(" , content_id BIGINT NOT NULL ");
sql.append(" , operation_content_flg BOOLEAN NOT NULL DEFAULT 0 ");
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(" ) ");
......
......@@ -4,15 +4,14 @@ 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.
* Created by leej on 2019/03/18.
*/
public class TTaskDirectionsItems extends SQLiteTableScript {
public class RTaskWorkerGroup extends SQLiteTableScript {
public TTaskDirectionsItems() {
public RTaskWorkerGroup() {
super();
}
......@@ -21,10 +20,13 @@ public class TTaskDirectionsItems extends SQLiteTableScript {
List<String> ddl = new ArrayList<String>();
StringBuffer sql = new StringBuffer();
sql.append(" CREATE TABLE t_task_directions_items ( ");
sql.append(" task_key TEXT NOT NULL ");
sql.append(" , item_key VARCHAR(64) ");
sql.append(" , input_value VARCHAR(64) ");
sql.append(" CREATE TABLE r_task_worker_group ( ");
sql.append(" task_report_level INTEGER default 0 ");
sql.append(" , operation_id BIGINT NOT NULL ");
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(" ) ");
ddl.add(sql.toString());
......@@ -41,4 +43,4 @@ public class TTaskDirectionsItems extends SQLiteTableScript {
public List<String> getMigrationScript(SQLiteDatabase databaseConnection, int oldVersion, int newVersion, Object[] params) {
return null;
}
}
}
\ No newline at end of file
......@@ -21,7 +21,7 @@ public class TOperation extends SQLiteTableScript {
List<String> ddl = new ArrayList<String>();
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_name VARCHAR(128) ");
sql.append(" , operation_type INTEGER NOT NULL ");
......@@ -32,10 +32,11 @@ public class TOperation extends SQLiteTableScript {
sql.append(" , content_creating_flg INTEGER NOT NULL ");
sql.append(" , edit_lock_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(" , operation_report_type INTEGER NOT NULL DEFAULT 0 ");
sql.append(" , report_type 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_history SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , enable_report_edit SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , PRIMARY KEY (operation_id) ");
sql.append(" ) ");
ddl.add(sql.toString());
......@@ -52,13 +53,13 @@ public class TOperation extends SQLiteTableScript {
// }
//
// 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) { // カラムの追加
// ddl.add(" ALTER TABLE t_project 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_project ADD COLUMN enable_report_update 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_operation ADD COLUMN report_cycle INTEGER NOT NULL DEFAULT 0 ");
// ddl.add(" ALTER TABLE t_operation ADD COLUMN enable_report_update INTEGER NOT NULL DEFAULT 0 ");
// }
// return ddl;
return null;
......
......@@ -27,7 +27,7 @@ public class TPushMessage extends SQLiteTableScript {
sql.append(" , push_message TEXT ");
sql.append(" , reading_flg BOOLEAN NOT NULL DEFAULT 0 ");
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(" ) ");
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 {
sql.append(" , local_attached_file_name TEXT ");
sql.append(" , attached_file_send_flg BOOLEAN DEFAULT 0 ");
sql.append(" , data_send_flg BOOLEAN DEFAULT 0 ");
// #32782 指示者テーブル関連削除 start
// TODO append
// sql.append(" , reporter_flag BOOLEAN DEFAULT 0 ");
// #32782 指示者テーブル関連削除 end
sql.append(" , report_start_date DATETIME ");
sql.append(" , report_end_date DATETIME ");
sql.append(" , task_report_id INTEGER NOT NULL DEFAULT 0 ");
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(" ) ");
ddl.add(sql.toString());
......
......@@ -23,6 +23,7 @@ public class TTaskReportItems extends SQLiteTableScript {
sql.append(" CREATE TABLE t_task_report_items ( ");
sql.append(" task_key TEXT NOT NULL ");
sql.append(" , task_report_level INTEGER default 0 ");
sql.append(" , item_key VARCHAR(64) ");
sql.append(" , input_value VARCHAR(64) ");
sql.append(" ) ");
......
......@@ -23,16 +23,16 @@ public class OperationDto extends AbstractDto {
public List<OperationContentDto> operationContentDtoList;
public List<TaskDto> taskDtoList;
public List<PushMessageDto> pushMessageList;
public int reportUpdateType; //0:履歴無し 1:新規追加 2:更新
public int operationReportType; //0:通常 1:定期点検
public int reportType; //0:通常 1:定期点検
public int reportCycle; //0:日次 1:月次 2:年次
public int enableReportUpdate; //0:不可 1:可
public String reportPeriod; //定期点検、2018/12/20 08:10:00 ~ 2018/12/21 18:10:00
public int reportCount; //定期点検、作業数
public int enableReportHistory; // 0: 履歴無し, 1: 履歴可
public int enableReportEdit; // 作業編集可能区分
// #32926 作業報告画面改善 start
public int reportType; // 作業報告タイプ 0:報告 1:定期点検 2:報告(回答)
// #32926 作業報告画面改善 end
// 作業担当グループリスト
public List<TaskWorkerGroupDto> taskWorkerGroupDtoList;
public boolean equalsLastEdit(OperationDto dto) {
if (dto != null) {
......@@ -45,12 +45,12 @@ public class OperationDto extends AbstractDto {
@Override
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
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
......
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 {
public String taskCode;
public Integer taskStatus;
public String taskHotSpotInfo;
public List<TaskReportDto> taskReportDtoList;
public boolean delFlg;
// #32782 指示者テーブル関連削除 start
// TODO TaskDirectionDto から TaskReportDto に変更、taskDirectionsDto 名を変更必要
// public TaskReportDto taskDirectionsDto;
public TaskDirectionsDto taskDirectionsDto;
// #32782 指示者テーブル関連削除 end
public TaskReportDto taskReportDto;
public int taskReportId;
public List<RoutineTaskReportDto> RoutineTaskReportList;
// #32926 作業報告画面改善 start
public boolean taskHasAuthority; // タスク別の権限
public int taskReportLevel; // 作業報告階層
// #32926 作業報告画面改善 end
@Override
public Object[] getInsertValues() {
......
......@@ -10,41 +10,31 @@ public class TaskReportDto 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;
// #32782 指示者テーブル関連削除 start
public boolean reporterFlag;
//  作業報告詳細リスト
public int taskReportLevel; // 作業報告レベル
public int taskHasAuthority; // 権限
public int taskReportId; // 作業報告ID
public int taskReportInfoId; // 作業報告情報ID
public Date reportStartDate; // 作業開始日
public Date reportEndDate; // 作業終了日
public int enableReport; // 報告可能区分
public boolean reportedFlag; //
// #32782 指示者テーブル関連削除 end
public String attachedFileName;
public String taskReportInfo;
public boolean reportedFlag; // 定期点検用
@Override
public Object[] getInsertValues() {
// #32782 指示者テーブル関連削除 start
// TODO change
// return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, reporterFlag };
return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg};
// #32782 指示者テーブル関連削除 end
return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskReportId, taskReportInfoId, reportStartDate, reportEndDate, reportedFlag};
}
@Override
public Object[] getUpdateValues() {
// #32782 指示者テーブル関連削除 start
// TODO change
// return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, reporterFlag, taskKey };
return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskKey };
// #32782 指示者テーブル関連削除 end
return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskReportId, taskReportInfoId, reportStartDate, reportEndDate, reportedFlag, taskKey };
}
@Override
......
......@@ -7,6 +7,7 @@ package jp.agentec.abook.abv.bl.dto;
public class TaskReportItemsDto extends AbstractDto {
public String taskKey;
public int taskReportLevel;
public String itemKey;
public String inputValue;
......@@ -17,11 +18,11 @@ public class TaskReportItemsDto extends AbstractDto {
@Override
public Object[] getInsertValues() {
return new Object[] {taskKey, itemKey, inputValue};
return new Object[] {taskKey, taskReportLevel, itemKey, inputValue};
}
@Override
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 };
}
}
<?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 @@
<dimen name="text_size_large">22sp</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>
......@@ -15,4 +15,6 @@
<dimen name="weather_text_large_size">13sp</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>
......@@ -20,7 +20,7 @@
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:background="@drawable/icon_sort" />
android:background="@drawable/ic_display_list" />
<ImageButton
android:id="@+id/icon_filter"
......
......@@ -20,7 +20,7 @@
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:background="@drawable/icon_sort" />
android:background="@drawable/ic_display_list" />
<ImageButton
android:id="@+id/icon_filter"
......
package jp.agentec.abook.abv.launcher.android;
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.log.Logger;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
......@@ -77,7 +75,8 @@ public class ABVUIDataCache {
}
public int getViewMode() {
return viewMode;
return PreferenceUtil.getUserPref(context, UserPrefKey.VIEW_MODE, 0);
// return viewMode;
}
public void setViewMode(int viewMode) {
......@@ -141,9 +140,9 @@ public class ABVUIDataCache {
mOperationReportTypes = operationReportTypes;
} else {
mOperationReportTypes = new ArrayList<Integer>();
mOperationReportTypes.add(OperationReportType.DEFAULT);
mOperationReportTypes.add(OperationReportType.ROUTINE_TASK);
mOperationReportTypes.add(OperationReportType.REPORT_TYPE);
mOperationReportTypes.add(OperationReportType.ROUTINE_TASK);
mOperationReportTypes.add(OperationReportType.REPORT_RESPONSE_TYPE);
}
return mOperationReportTypes;
......
......@@ -107,7 +107,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
public Long mOperationId;
protected int mXWalkOpenType = -1;
protected int mOperationType;
protected int reportUpdateType; //0:履歴無し 1:新規追加 2:更新
protected int enableReportHistory; //0:履歴無し 1:履歴可
protected String mContentPath;
protected int mStatusCode;
protected boolean isOperationPdf = false;
......@@ -172,7 +172,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
mStatusCode = 0;
}
reportUpdateType = operationDto.reportUpdateType;
enableReportHistory = operationDto.enableReportHistory;
linkUrl = intent.getStringExtra("LINKURL"); // LinkURL
......@@ -787,7 +787,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
helpViewType = Constant.HelpViewType.ListOperationDirector;
break;
case Constant.XWalkOpenType.TASK_REPORT:
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) {
if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) {
helpViewType = Constant.HelpViewType.RoutineTaskOperation;
} else {
helpViewType = Constant.HelpViewType.ListOperationReporter;
......@@ -824,7 +824,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) {
helpViewType = Constant.HelpViewType.DirectorTask;
} 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;
} else {
helpViewType = Constant.HelpViewType.ReportTask;
......@@ -855,24 +855,20 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
mCmd = abookCheckParam.get(ABookKeys.CMD);
mTaskKey = abookCheckParam.get(ABookKeys.TASK_KEY);
// #32926 作業報告画面改善 start
int taskReportLevel = 0; // 作業報告レベル(0:報告、1:報告(回答)、2:報告(回答))
if (abookCheckParam.containsKey(ABookKeys.TASK_REPORT_LEVEL)) {
taskReportLevel = Integer.parseInt(abookCheckParam.get(ABookKeys.TASK_REPORT_LEVEL)); // 作業報告レベル
}
// #32926 作業報告画面改善 end
int taskReportId = 0;
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));
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,
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_LOCAL_SAVE_TASK_REPORT)) {
if (StringUtil.equalsAny(mCmd, 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_LOCAL_SAVE_TASK_REPORT)) {
boolean isError = false;
try {
......@@ -881,19 +877,15 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
if (isOperationPdf && operationTaskDto != null && StringUtil.equalsAny(mCmd,
ABookKeys.CMD_INSERT_TASK_DIRECTIONS,
ABookKeys.CMD_UPDATE_TASK_DIRECTIONS,
ABookKeys.CMD_INSERT_TASK_REPORT,
ABookKeys.CMD_UPDATE_TASK_REPORT,
ABookKeys.CMD_MOVE_HOT_SPOT,
ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT)) {
String taskCode = "";
// #32781 start
// TODO TASK_DIRECTIONSの削除され、TASK_REPORTに変更する
if (abookCheckParam.get(ABookKeys.TASK_DIRECTIONS) != null) {
JSONObject direction = new JSONObject(abookCheckParam.get(ABookKeys.TASK_DIRECTIONS));
JSONObject taskJson = direction.getJSONObject(ABookKeys.TASK);
if (abookCheckParam.get(ABookKeys.TASK_REPORT) != null) {
JSONObject tastReportJson = new JSONObject(abookCheckParam.get(ABookKeys.TASK_REPORT));
JSONObject taskJson = tastReportJson.getJSONObject(ABookKeys.TASK);
Iterator taskKeys = taskJson.keys();
while (taskKeys.hasNext()) {
String itemKey = (String) taskKeys.next();
......@@ -902,7 +894,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
}
}
// #32781 end
if (abookCheckParam.get(ABookKeys.HOT_SPOT) != null) {
JSONObject hotSpot = new JSONObject(abookCheckParam.get(ABookKeys.HOT_SPOT));
......@@ -930,12 +921,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
return null;
}
};
// #32926 作業報告画面改善 start
ABookCheckWebViewHelper.getInstance().doABookCheckParam(ABVContentViewActivity.this,
mCmd, mTaskKey, reportUpdateType, abookCheckParam, mOperationId, mContentPath, getContentId(),
operationDto.reportType == Constant.ReportType.Routine, finishCallback,
mCmd, mTaskKey, enableReportHistory, abookCheckParam, mOperationId, mContentPath, getContentId(),
operationDto.reportType, finishCallback,
taskReportLevel);
// #32926 作業報告画面改善 end
} catch(Exception e) {
Logger.e(TAG, "doABookCheckParam error", e);
}
......
......@@ -34,9 +34,10 @@ public abstract class ABVLoginActivity extends ABVNoAuthenticatedActivity {
ABVToastUtil.showMakeText(ABVLoginActivity.this, R.string.fcm_not_supported, Toast.LENGTH_SHORT);
}
});
} else {
serverLoginAndCheckChangeUser(fcmToken);
// FCMトークンを取得できない場合、noneIdでセットしてログインする
fcmToken = "noneId";
}
serverLoginAndCheckChangeUser(fcmToken);
} finally {
closeProgressPopup();
}
......
......@@ -108,9 +108,10 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
String fcmToken = FcmManager.getFcmToken(mContext);
if (fcmToken == null) {
ABVToastUtil.showMakeText(mContext, R.string.fcm_not_supported, Toast.LENGTH_SHORT);
} else {
noAuthenticatedShowMain(isGuestLogin, fcmToken, urlPath);
// FCMトークンを取得できない場合、noneIdでセットしてログインする
fcmToken = "noneId";
}
noAuthenticatedShowMain(isGuestLogin, fcmToken, urlPath);
}
});
}
......
......@@ -191,7 +191,7 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
public void showOperationRelatedContentList() {
mOperationContentList = mOperationLogic.getOperationRelatedContent(operationId);
mOperationContentList = mOperationLogic.getOperationRelatedContent();
Logger.i(TAG, "count of content=" + mOperationContentList.size());
// Gridビュー
......
......@@ -87,9 +87,9 @@ public class OperationListAdapter extends AbstractOperationAdapter {
final OperationDto operationDto = getItem(position);
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);
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) {
if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) {
if (StringUtil.isNullOrEmpty(operationDto.reportPeriod)) {
holder.tvDate.setText(mContext.getString(R.string.date_label_routineTask) + " : " + mContext.getString(R.string.msg_no_report_data));
} else {
......@@ -106,7 +106,7 @@ public class OperationListAdapter extends AbstractOperationAdapter {
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, true);
} else {
// 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), "");
if (StringUtil.isNullOrEmpty(operationDto.reportPeriod) && !syncedDate.equals(DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMdd_none))) {
......@@ -143,7 +143,7 @@ public class OperationListAdapter extends AbstractOperationAdapter {
holder.lyPanoEditLayout.setVisibility(View.INVISIBLE);
}
if(mOperationAuthLevel == OperationAuthLevel.WORKER) {
if(operationDto.enableReportEdit == Constant.EnableReportEdit.NO) {
holder.lyPanoEditLayout.setVisibility(View.GONE);
}
......
......@@ -119,9 +119,9 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
final OperationDto operationDto = getItem(position);
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);
if (operationDto.operationReportType == Constant.OperationReportType.ROUTINE_TASK) {
if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) {
if (StringUtil.isNullOrEmpty(operationDto.reportPeriod)) {
holder.tvDate.setText(mContext.getString(R.string.date_label_routineTask) + " : " + mContext.getString(R.string.msg_no_report_data));
} else {
......@@ -137,7 +137,7 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, true);
} else {
// 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), "");
if (StringUtil.isNullOrEmpty(operationDto.reportPeriod) && !syncedDate.equals(DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMdd_none))) {
......@@ -174,9 +174,9 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
holder.lyPanoEditLayout.setVisibility(View.INVISIBLE);
}
if(mOperationAuthLevel == OperationAuthLevel.WORKER) {
// if(mOperationAuthLevel.equals(OperationAuthLevel.WORKER)) {
holder.lyPanoEditLayout.setVisibility(View.GONE);
}
// }
holder.ivPanoEdit.setOnClickListener(new View.OnClickListener() {
@Override
......
......@@ -63,8 +63,8 @@ public class OperationListHelper {
private List<OperationDto> filterOperationList() {
try {
String operationReportTypeStr = PreferenceUtil.getUserPref(mAppActivity, AppDefType.UserPrefKey.OPERATION_REPORT_TYPES, null);
operationDtoList = mOperationLogic.getRefreshOperation(mAppActivity.mSearchWord, mAppActivity.mStartDateStr, mAppActivity.mEndDateStr, operationReportTypeStr);
String reportTypeStr = PreferenceUtil.getUserPref(mAppActivity, AppDefType.UserPrefKey.OPERATION_REPORT_TYPES, null);
operationDtoList = mOperationLogic.getRefreshOperation(mAppActivity.mSearchWord, mAppActivity.mStartDateStr, mAppActivity.mEndDateStr, reportTypeStr);
} catch (Exception e) {
Logger.e(TAG, "findOperationList", e);
ErrorMessage.showErrorMessageToast(mAppActivity.getApplicationContext(), ErrorCode.E107);
......
......@@ -4954,14 +4954,10 @@ public class ContentViewActivity extends ABVContentViewActivity {
String cmd = checkParam.get(ABookKeys.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_UPDATE_TASK_REPORT: // 作業報告の更新
case ABookKeys.CMD_DELETE_TASK_REPORT: // 作業報告の削除
getTaskHotspotJSON();
case ABookKeys.CMD_CANCEL_TASK_DIRECTIONS: // 作業指示のキャンセル
case ABookKeys.CMD_CANCEL_TASK_REPORT: // 作業報告のキャンセル
if(operationTaskDto != null) {
updateOperationTaskPosition(operationTaskDto.pdfX, operationTaskDto.pdfY);
......@@ -5165,7 +5161,6 @@ public class ContentViewActivity extends ABVContentViewActivity {
}
public void showOperationTaskLayout(ZoomRelativeLayout layout, OperationTaskDto operationTaskDto, float clickX) {
//setCurrentOperationTask(layout, currentTaskDto);
operationTaskLayout.showTaskForm(layout, mXWalkOpenType, operationTaskDto, isNormalSize(), clickX);
// 拡大・縮小・切替ボタンの非表示
mScaleZoomLayout.setVisibility(View.INVISIBLE);
......@@ -5176,6 +5171,9 @@ public class ContentViewActivity extends ABVContentViewActivity {
String taskKey = checkParam.get(ABookKeys.TASK_KEY);
String taskCode = "";
// 作業報告レベル
int taskReportLevel = Integer.parseInt(checkParam.get(ABookKeys.TASK_REPORT_LEVEL));
// フォームが閉じられたと見做すので、以下の処理を行う
isOpenedOperationTask = false;
// 拡大・縮小・切替ボタンの表示
......@@ -5183,13 +5181,11 @@ public class ContentViewActivity extends ABVContentViewActivity {
if (operationTaskLayout.currentLayout != null && !StringUtil.isNullOrEmpty(taskKey)) {
switch(cmd){
case ABookKeys.CMD_INSERT_TASK_DIRECTIONS:
case ABookKeys.CMD_UPDATE_TASK_DIRECTIONS:
// #32782 指示者テーブル関連削除 start
case ABookKeys.CMD_INSERT_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));
taskCode = hotspot.getString(ABookKeys.TASK_CODE);
......@@ -5202,17 +5198,19 @@ public class ContentViewActivity extends ABVContentViewActivity {
} else {
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:
operationTaskLayout.setIconStatus(taskKey, false);
break;
}
}
operationTaskLayout.currentTaskDto = null;
}
}
......@@ -5245,7 +5243,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
}
public int getOperationReportUpdateType() {
return reportUpdateType;
return enableReportHistory;
}
/**
......
......@@ -50,13 +50,6 @@ public class OperationTaskLayout extends RelativeLayout {
private static final int ICON_WIDTH = 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_HEIGHT = 26;
......@@ -194,13 +187,10 @@ public class OperationTaskLayout extends RelativeLayout {
// ピンで表示
final ActionOperationTaskPin taskPin = new ActionOperationTaskPin(mContext, dto);
taskPin.taskKey = dto.taskKey;
if (dto.isFinished) {
width = (int) (PIN_FINISHED_ICON_WIDTH * density);
height = (int) (PIN_FINISHED_ICON_HEIGHT * density);
} else {
width = (int) (PIN_ICON_WIDTH * density);
height = (int) (PIN_ICON_HEIGHT * density);
}
// ピンのイメージアイコンのサイズセット
width = (int) mContext.getResources().getDimensionPixelSize(R.dimen.operation_pin_icon_width);
height = (int) mContext.getResources().getDimensionPixelSize(R.dimen.operation_pin_icon_height);
params = new RelativeLayout.LayoutParams(width, height);
taskPin.setVisibility(View.INVISIBLE);
......@@ -282,11 +272,7 @@ public class OperationTaskLayout extends RelativeLayout {
}
private boolean isTaskFinished(String taskKey) {
if(mContext.getOperationReportUpdateType() == Constant.OperationUpdateType.HISTORY_ADD) {
return false;
} else {
return mTaskDao.getTaskByTaskKey(taskKey).taskStatus == FINISHED_STATUS;
}
return mTaskDao.getTaskByTaskKey(taskKey).taskStatus == FINISHED_STATUS;
}
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