Commit fa601572 by Lee Jaebin

#32825 作業一覧画面改善

parent 05b337ce
...@@ -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;
...@@ -80,7 +80,6 @@ import jp.agentec.adf.net.http.HttpMultipart; ...@@ -80,7 +80,6 @@ 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;
...@@ -520,13 +519,13 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -520,13 +519,13 @@ public class AcmsClient implements AcmsClientResponseListener {
* @param taskReportDto * @param taskReportDto
* @param formFile * @param formFile
* @param taskReportSendSaveDate * @param taskReportSendSaveDate
* @param isRoutinTask * @param reportType
* @return * @return
* @throws ABVException * @throws ABVException
* @throws NetworkDisconnectedException * @throws NetworkDisconnectedException
* @throws IOException * @throws IOException
*/ */
public AcmsMessageJSON testSendTaskData(String sid, Long operationId, TaskReportDto taskReportDto, File formFile, Date taskReportSendSaveDate, boolean isRoutinTask) 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();
} }
...@@ -539,11 +538,12 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -539,11 +538,12 @@ public class AcmsClient implements AcmsClientResponseListener {
HttpMultipartList.add(new HttpMultipart(ABookKeys.DEL_FLAG, taskReportDto.delFlg ? "1" : "0")); 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_REPORT_LEVEL, StringUtil.toString(taskReportDto.taskReportLevel)));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_HOT_SPOT_INFO, taskReportDto.taskHotSpotInfo)); HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_HOT_SPOT_INFO, taskReportDto.taskHotSpotInfo));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_INFO, taskReportDto.taskReportInfo)); 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.ATTACHED_CHANGE_FLAG, taskReportDto.attachedFileSendFlg ? "1" : "0"));
HttpMultipartList.add(new HttpMultipart(ABookKeys.ROUTINE_TASK_FLAG, reportType == Constant.ReportType.Routine ? "1" : "0"));
// 定期点検用 // 定期点検用
if (isRoutinTask) { if (reportType == Constant.ReportType.Routine) {
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_ID, StringUtil.toString(taskReportDto.taskReportId))); 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.TASK_REPORT_INFO_ID, StringUtil.toString(taskReportDto.taskReportInfoId)));
HttpMultipartList.add(new HttpMultipart(ABookKeys.REPORT_START_DATE, DateTimeUtil.toStringForCmsGMT(taskReportDto.reportStartDate))); HttpMultipartList.add(new HttpMultipart(ABookKeys.REPORT_START_DATE, DateTimeUtil.toStringForCmsGMT(taskReportDto.reportStartDate)));
...@@ -652,19 +652,6 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -652,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
......
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.TaskDto;
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);
}
}
}
}
...@@ -135,9 +135,9 @@ public class ABVEnvironment { ...@@ -135,9 +135,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
/** /**
...@@ -673,32 +673,43 @@ public class ABVEnvironment { ...@@ -673,32 +673,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, int taskReportLevel) { public String getOperationDirectionOrReportDirPath(long operationId, String taskKey, int taskReportLevel) {
return String.format(OperationDirectionOrReportDirFormat, rootDirectory, operationId, taskKey, String.valueOf(taskReportLevel)); return String.format(OperationDirectionOrReportDirFormat, rootDirectory, operationId, taskKey, String.valueOf(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) { public String getOperationTaskReportLevelDirPath(long operationId, String taskKey, int taskReportLevel) {
return String.format(OperationDirectionOrReportDirFormat, rootDirectory, operationId, taskKey, String.valueOf(taskReportLevel)); return String.format(OperationDirectionOrReportDirFormat, rootDirectory, operationId, taskKey, String.valueOf(taskReportLevel));
} }
// #32926 作業報告画面改善 end
public String getOperationTaskReportDirPath(long operationId, String taskKey) {
return String.format(OperationDirectionOrReportDirFormat, rootDirectory, operationId, taskKey);
}
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);
......
...@@ -43,6 +43,7 @@ public class ABookKeys { ...@@ -43,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";
......
...@@ -32,7 +32,6 @@ import jp.agentec.abook.abv.bl.data.tables.TContentResource; ...@@ -32,7 +32,6 @@ 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;
...@@ -95,7 +94,6 @@ public class ABVDataOpenHelper { ...@@ -95,7 +94,6 @@ public class ABVDataOpenHelper {
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;
} }
......
...@@ -90,6 +90,16 @@ public class OperationDao extends AbstractDao { ...@@ -90,6 +90,16 @@ 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;
} }
...@@ -280,10 +290,10 @@ public class OperationDao extends AbstractDao { ...@@ -280,10 +290,10 @@ public class OperationDao extends AbstractDao {
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;
......
...@@ -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 });
......
...@@ -73,7 +73,7 @@ public class TaskWorkerGroupDao extends AbstractDao { ...@@ -73,7 +73,7 @@ public class TaskWorkerGroupDao extends AbstractDao {
sql.append(" INNER JOIN m_worker_group AS mwg "); sql.append(" INNER JOIN m_worker_group AS mwg ");
sql.append(" ON rtwg.group_id = mwg.group_id "); sql.append(" ON rtwg.group_id = mwg.group_id ");
sql.append(" WHERE rtwg.operation_id = ? "); sql.append(" WHERE rtwg.operation_id = ? ");
sql.append(" ORDER BY rtwg.group_id DESC "); sql.append(" ORDER BY rtwg.task_report_level DESC ");
Logger.v(TAG, "sql=%s", sql); Logger.v(TAG, "sql=%s", sql);
return rawQueryGetDtoList(sql.toString(), new String[]{""+ operationId}, TaskWorkerGroupDto.class); return rawQueryGetDtoList(sql.toString(), new String[]{""+ operationId}, TaskWorkerGroupDto.class);
} }
......
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;
}
}
...@@ -28,11 +28,6 @@ public class TTaskReport extends SQLiteTableScript { ...@@ -28,11 +28,6 @@ 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
// TODO append
// sql.append(" , reporter_flag BOOLEAN DEFAULT 0 ");
// #32782 指示者テーブル関連削除 end
sql.append(" , report_start_date DATETIME "); sql.append(" , report_start_date DATETIME ");
sql.append(" , report_end_date DATETIME "); sql.append(" , report_end_date DATETIME ");
sql.append(" , task_report_id INTEGER NOT NULL DEFAULT 0 "); sql.append(" , task_report_id INTEGER NOT NULL DEFAULT 0 ");
......
...@@ -28,8 +28,8 @@ public class OperationDto extends AbstractDto { ...@@ -28,8 +28,8 @@ public class OperationDto extends AbstractDto {
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 enableReportEdit; // 作業編集可能区分
public int enableReportHistory; // 0: 履歴無し, 1: 履歴可 public int enableReportHistory; // 0: 履歴無し, 1: 履歴可
public int enableReportEdit; // 作業編集可能区分
// 作業担当グループリスト // 作業担当グループリスト
public List<TaskWorkerGroupDto> taskWorkerGroupDtoList; public List<TaskWorkerGroupDto> taskWorkerGroupDtoList;
......
...@@ -18,12 +18,8 @@ public class TaskDto extends AbstractDto { ...@@ -18,12 +18,8 @@ public class TaskDto extends AbstractDto {
public boolean delFlg; public boolean delFlg;
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() {
......
<?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
...@@ -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"
......
...@@ -75,7 +75,8 @@ public class ABVUIDataCache { ...@@ -75,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) {
......
...@@ -70,7 +70,6 @@ import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException; ...@@ -70,7 +70,6 @@ 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.TaskReportDao; import jp.agentec.abook.abv.bl.data.dao.TaskReportDao;
...@@ -150,7 +149,6 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -150,7 +149,6 @@ public class OperationListActivity extends ABVUIActivity {
private OperationContentDao mOperationContentDao = AbstractDao.getDao(OperationContentDao.class); private OperationContentDao mOperationContentDao = AbstractDao.getDao(OperationContentDao.class);
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);
...@@ -197,9 +195,9 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -197,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));
} }
} }
} }
...@@ -698,7 +696,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -698,7 +696,7 @@ public class OperationListActivity extends ABVUIActivity {
}; };
// 報告送信 // 報告送信
if (mOperationLogic.sendTaskReportSendData(operationId, null, reportType == OperationReportType.ROUTINE_TASK, progressCallback)) { if (mOperationLogic.sendTaskReportSendData(operationId, progressCallback)) {
// 作業報告タイプが定期点検且つ、P005のエラーの場合、以下のエラーをトーストメッセージで表示 // 作業報告タイプが定期点検且つ、P005のエラーの場合、以下のエラーをトーストメッセージで表示
handleErrorMessageToast(R.string.P005); handleErrorMessageToast(R.string.P005);
} }
...@@ -827,7 +825,6 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -827,7 +825,6 @@ 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;
OperationDataJSON json = AcmsClient.getInstance(ABVDataCache.getInstance().getUrlPath(), ABVEnvironment.getInstance().networkAdapter).getOpereationData(param); OperationDataJSON json = AcmsClient.getInstance(ABVDataCache.getInstance().getUrlPath(), ABVEnvironment.getInstance().networkAdapter).getOpereationData(param);
...@@ -852,7 +849,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -852,7 +849,7 @@ public class OperationListActivity extends ABVUIActivity {
// 先にローカルにしか存在しない事を削除 : DB, files // 先にローカルにしか存在しない事を削除 : DB, files
for (TaskReportDto localTaskReportDto : localTaskReportList) { for (TaskReportDto localTaskReportDto : localTaskReportList) {
if (!isExistsRoutinTaskReportInList(serverTaskDto.taskReportDtoList, localTaskReportDto)) { if (!isExistsRoutinTaskReportInList(serverTaskDto.taskReportDtoList, localTaskReportDto)) {
mOperationLogic.deleteTaskReport(operationId, operationContentDto.contentId, localTaskReportDto); mOperationLogic.deleteRoutineTaskReport(operationId, operationContentDto.contentId, localTaskReportDto);
localRemove.add(localTaskReportDto); localRemove.add(localTaskReportDto);
} }
} }
...@@ -978,7 +975,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -978,7 +975,7 @@ public class OperationListActivity extends ABVUIActivity {
// #32926 start // #32926 start
FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel)); FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel));
// #32926 end // #32926 end
String outputFilePath = mOperationLogic.getTaskFile(operationId, taskKey, taskId, attachedFileName, 1); String outputFilePath = mOperationLogic.getTaskFile(operationId, taskKey, taskId, attachedFileName, taskReportLevel);
ContentFileExtractor.getInstance().extractZipFile(contentId, outputFilePath, ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel),null, true); ContentFileExtractor.getInstance().extractZipFile(contentId, outputFilePath, ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel),null, true);
} catch (Exception e) { } catch (Exception e) {
Logger.e(TAG, e); Logger.e(TAG, e);
...@@ -1017,12 +1014,12 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1017,12 +1014,12 @@ public class OperationListActivity extends ABVUIActivity {
Logger.i(TAG, "[Get Task Report Files] operationId=%s, taskKey=%s, taskId=%s, attachedFileName=%s", operationId, taskKey, taskId, reportAttachedFileName); Logger.i(TAG, "[Get Task Report Files] operationId=%s, taskKey=%s, taskId=%s, attachedFileName=%s", operationId, taskKey, taskId, reportAttachedFileName);
// #32926 start // #32926 start
int taskReportLevel = 0; int taskReportLevel = 0;
FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, reportStartDateNone, taskReportLevel)); FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, reportStartDateNone));
// #32926 end // #32926 end
String outputFilePath = mOperationLogic.getRoutineTaskReportFile(operationId, taskKey, taskId, taskReportId, taskReportInfoId, reportStartDateNone, reportAttachedFileName); String outputFilePath = mOperationLogic.getRoutineTaskReportFile(operationId, taskKey, taskId, taskReportId, taskReportInfoId, reportStartDateNone, reportAttachedFileName);
// #32926 start // #32926 start
ContentFileExtractor.getInstance().extractZipFile(contentId, outputFilePath, ContentFileExtractor.getInstance().extractZipFile(contentId, outputFilePath,
ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, reportStartDateNone, taskReportLevel), null, true); ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, reportStartDateNone), null, true);
// #32926 end // #32926 end
} catch (Exception e) { } catch (Exception e) {
Logger.e(TAG, e); Logger.e(TAG, e);
......
...@@ -5161,7 +5161,6 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5161,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);
...@@ -5172,6 +5171,9 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5172,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;
// 拡大・縮小・切替ボタンの表示 // 拡大・縮小・切替ボタンの表示
...@@ -5182,8 +5184,8 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5182,8 +5184,8 @@ public class ContentViewActivity extends ABVContentViewActivity {
// #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);
...@@ -5196,17 +5198,19 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5196,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;
} }
} }
......
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