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;
......
package jp.agentec.abook.abv.bl.data.dao;
import java.util.List;
import jp.agentec.abook.abv.bl.common.db.Cursor;
import jp.agentec.abook.abv.bl.dto.RoutineTaskReportDto;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
/**
* Created by seo-y on 2018/12/17.
*/
public class RoutineTaskReportDao extends AbstractDao {
private static final String TAG = "InspectTaskReportDao";
@Override
public RoutineTaskReportDto convert(Cursor cursor) {
RoutineTaskReportDto dto = new RoutineTaskReportDto();
int column = cursor.getColumnIndex("task_key");
if (column != -1) {
dto.taskKey = cursor.getString(column);
}
column = cursor.getColumnIndex("task_report_id");
if (column != -1) {
dto.taskReportId = cursor.getInt(column);
}
column = cursor.getColumnIndex("task_report_info_id");
if (column != -1) {
dto.taskReportInfoId = cursor.getInt(column);
}
column = cursor.getColumnIndex("report_start_date");
if (column != -1) {
dto.reportStartDate = DateTimeUtil.toDate(cursor.getString(column), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
}
column = cursor.getColumnIndex("report_end_date");
if (column != -1) {
dto.reportEndDate = DateTimeUtil.toDate(cursor.getString(column), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
}
column = cursor.getColumnIndex("attached_file_name");
if (column != -1) {
dto.attachedFileName = cursor.getString(column);
}
column = cursor.getColumnIndex("local_attached_file_name");
if (column != -1) {
dto.localAttachedFileName = cursor.getString(column);
}
column = cursor.getColumnIndex("json_data");
if (column != -1) {
dto.jsonData = cursor.getString(column);
}
column = cursor.getColumnIndex("data_send_flag");
if (column != -1) {
dto.dataSendFlag = toBool(cursor.getInt(column));
}
column = cursor.getColumnIndex("attached_file_send_flag");
if (column != -1) {
dto.attachedFileSendFlag = toBool(cursor.getInt(column));
}
column = cursor.getColumnIndex("reported_flag");
if (column != -1) {
dto.reportedFlag = toBool(cursor.getInt(column));
}
return dto;
}
public void insert(RoutineTaskReportDto dto) {
insert("insert into t_inspect_task_report "
+ "(task_key, "
+ "task_report_id, "
+ "task_report_info_id, "
+ "report_start_date, "
+ "report_end_date, "
+ "attached_file_name, "
+ "local_attached_file_name, "
+ "json_data, "
+ "data_send_flag, "
+ "attached_file_send_flag, "
+ "reported_flag) "
+ "values (?,?,?,?,?,?,?,?,?,?,?)",
dto.getInsertValues());
}
public boolean update(RoutineTaskReportDto dto, boolean reportedFlg) {
long count;
if (reportedFlg) {
dto.reportedFlag = true;
count = update("update t_inspect_task_report "
+ "set "
+ "report_end_date=?, "
+ "attached_file_name=?, "
+ "local_attached_file_name=?, "
+ "json_data=?, "
+ "data_send_flag=?, "
+ "attached_file_send_flag=?, "
+ "reported_flag=? "
+ "where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?)",
dto.getUpdateValues());
} else {
count = update("update t_inspect_task_report "
+ "set "
+ "report_end_date=?, "
+ "attached_file_name=?, "
+ "local_attached_file_name=?, "
+ "json_data=?, "
+ "data_send_flag=?, "
+ "attached_file_send_flag=? "
+ "where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?)",
new Object[] { dto.reportEndDate, dto.attachedFileName, dto.localAttachedFileName, dto.jsonData, dto.dataSendFlag, dto.attachedFileSendFlag, dto.taskKey, dto.taskReportId, dto.reportStartDate });
}
return count > 0;
}
public void delete(RoutineTaskReportDto dto) {
delete("t_inspect_task_report", "task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?, 'utc')", new String[] { dto.taskKey, "" + dto.taskReportId, DateTimeUtil.toString(dto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen) });
}
public RoutineTaskReportDto getLastRoutineTaskReportData(long operationId) {
StringBuilder sb = new StringBuilder();
sb.append(" select tr.* ");
sb.append(" from t_inspect_task_report tr ");
sb.append(" inner join ");
sb.append(" t_task tt ");
sb.append(" ON tr.task_key == tt.task_key");
sb.append(" WHERE tt.operation_id = ? ORDER BY tr.report_start_date DESC LIMIT 1");
List<RoutineTaskReportDto> dtoList = rawQueryGetDtoList(sb.toString(), new String[]{ "" + operationId }, RoutineTaskReportDto.class);
if (dtoList != null && dtoList.size() > 0) {
return dtoList.get(0);
} else {
RoutineTaskReportDto dto = new RoutineTaskReportDto();
dto.taskReportId = 0;
return dto;
}
}
public RoutineTaskReportDto getRoutineTaskReportUtc(String taskKey, int taskReportId, String reportStartDate){
return rawQueryGetDto("select * from t_inspect_task_report where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?, 'utc')", new String[]{ taskKey, "" + taskReportId, reportStartDate }, RoutineTaskReportDto.class);
}
// public List<RoutineTaskReportDto> selectRoutineTaskReportByTaskKey(String taskKey) {
// return rawQueryGetDtoList("select * from t_inspect_task_report where task_key=?", new String[]{ taskKey }, RoutineTaskReportDto.class);
// }
//
// public List<RoutineTaskReportDto> getRoutineTaskReportByOperationId(Long operationId) {
// StringBuilder sb = new StringBuilder();
// sb.append(" select tr.* ");
// sb.append(" from t_inspect_task_report tr ");
// sb.append(" inner join ");
// sb.append(" t_task tt ");
// sb.append(" ON tt.task_key == tr.task_key ");
// sb.append(" WHERE tt.del_flg = 0");
// sb.append(" AND tt.operation_id = ?");
// sb.append(" ORDER BY task_report_id ASC, report_start_date ASC");
// return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, RoutineTaskReportDto.class);
// }
//
// public List<RoutineTaskReportDto> getSendableRoutineTaskReportData(long operationId) {
// StringBuilder sb = new StringBuilder();
// sb.append(" select * ");
// sb.append(" from t_inspect_task_report tr ");
// sb.append(" inner join ");
// sb.append(" t_task tt ");
// sb.append(" ON tr.task_key == tt.task_key");
// sb.append(" WHERE tr.data_send_flag = 1");
// sb.append(" AND tt.operation_id = ?");
// return rawQueryGetDtoList(sb.toString(), new String[]{ "" + operationId }, RoutineTaskReportDto.class);
// }
//
// public List<RoutineTaskReportDto> getSendableRoutineTaskReportData(long operationId, String taskKey) {
// StringBuilder sb = new StringBuilder();
// sb.append(" select * ");
// sb.append(" from t_inspect_task_report tr ");
// sb.append(" inner join ");
// sb.append(" t_task tt ");
// sb.append(" ON tr.task_key == tt.task_key");
// sb.append(" WHERE tr.data_send_flag = 1");
// sb.append(" AND tt.operation_id = ?");
// sb.append(" AND tt.task_key = ?");
// return rawQueryGetDtoList(sb.toString(), new String[]{ "" + operationId, "" + taskKey }, RoutineTaskReportDto.class);
// }
// public boolean existsToDoRoutineTaskReportData(long operationId) {
// String currDate = DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMddHHmmss_hyphen);
// StringBuilder sb = new StringBuilder();
// sb.append(" select count(*) ");
// sb.append(" from t_inspect_task_report tr ");
// sb.append(" inner join t_task tt ON tt.task_key == tr.task_key ");
// sb.append(" WHERE tt.del_flg = 0 ");
// sb.append(" AND tt.operation_id = ? ");
// sb.append(" AND datetime(report_end_date) >= datetime(?, 'utc') ");
// return rawQueryGetInt(sb.toString(), new String[]{ "" + operationId, currDate }) > 0;
// }
//
// public List<RoutineTaskReportDto> geRoutineTaskReportByTaskKey(String taskKey) {
// StringBuilder sb = new StringBuilder();
// sb.append(" SELECT * ");
// sb.append(" FROM t_inspect_task_report ");
// sb.append(" WHERE task_key = ? ");
// sb.append(" ORDER BY task_report_id, report_start_date ");
// return rawQueryGetDtoList(sb.toString(), new String[]{ taskKey }, RoutineTaskReportDto.class);
// }
// public String getRoutineTaskReportAttachedFileName(String taskKey, int taskReportId, String reportStartDate) {
// return rawQueryGetString("select local_attached_file_name from t_inspect_task_report where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?)", new String[]{ taskKey, "" + taskReportId, reportStartDate });
// }
}
...@@ -99,24 +99,12 @@ public class TaskDao extends AbstractDao { ...@@ -99,24 +99,12 @@ public class TaskDao extends AbstractDao {
/** /**
* 作業削除 * 作業削除
* @param taskKey * @param taskKey
* @param directionFlg
*/ */
public void deleteTaskData(String taskKey, boolean directionFlg) { public void deleteTaskData(String taskKey) {
String[] keyValues = new String[]{""+ taskKey}; String[] keyValues = new String[]{""+ taskKey};
delete("t_task", "task_key=?", keyValues);
if (directionFlg) { delete("t_task_report", "task_key=?", keyValues);
delete("t_task", "task_key=?", keyValues); delete("t_task_report_items", "task_key=?", keyValues);
// #32782 指示者テーブル関連削除 start
// TODO delete
delete("t_task_directions", "task_key=?", keyValues);
delete("t_task_directions_items", "task_key=?", keyValues);
// #32782 指示者テーブル関連削除 end
delete("t_task_report", "task_key=?", keyValues);
delete("t_task_report_items", "task_key=?", keyValues);
} else {
delete("t_task_report", "task_key=?", keyValues);
delete("t_task_report_items", "task_key=?", keyValues);
}
} }
/** /**
...@@ -125,11 +113,6 @@ public class TaskDao extends AbstractDao { ...@@ -125,11 +113,6 @@ public class TaskDao extends AbstractDao {
*/ */
public void delete(TaskDto dto) { public void delete(TaskDto dto) {
delete("t_task", "task_key=?", dto.getKeyValues()); delete("t_task", "task_key=?", dto.getKeyValues());
// #32782 指示者テーブル関連削除 start
// TODO delete
delete("t_task_directions", "task_key=?", dto.getKeyValues());
delete("t_task_directions_items", "task_key=?", dto.getKeyValues());
// #32782 指示者テーブル関連削除 end
delete("t_task_report", "task_key=?", dto.getKeyValues()); delete("t_task_report", "task_key=?", dto.getKeyValues());
delete("t_task_report_items", "task_key=?", dto.getKeyValues()); delete("t_task_report_items", "task_key=?", dto.getKeyValues());
delete("t_inspect_task_report", "task_key=?", new String[] { dto.taskKey }); delete("t_inspect_task_report", "task_key=?", new String[] { dto.taskKey });
......
...@@ -91,6 +91,7 @@ public class TaskReportDao extends AbstractDao { ...@@ -91,6 +91,7 @@ public class TaskReportDao extends AbstractDao {
sb.append(" ON tt.task_key == ttr.task_key "); sb.append(" ON tt.task_key == ttr.task_key ");
sb.append(" WHERE tt.del_flg = 0"); sb.append(" WHERE tt.del_flg = 0");
sb.append(" AND tt.operation_id = ?"); sb.append(" AND tt.operation_id = ?");
sb.append(" ORDER BY task_report_id ASC, report_start_date ASC");
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskReportDto.class); return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskReportDto.class);
} }
...@@ -105,6 +106,15 @@ public class TaskReportDao extends AbstractDao { ...@@ -105,6 +106,15 @@ public class TaskReportDao extends AbstractDao {
return rawQueryGetDto("select * from t_task_report where task_key=? AND task_report_level=?", new String[]{ "" + taskKey, "" + taskReportLevel }, TaskReportDto.class); return rawQueryGetDto("select * from t_task_report where task_key=? AND task_report_level=?", new String[]{ "" + taskKey, "" + taskReportLevel }, TaskReportDto.class);
} }
/**
* 作業キーで報告リストを取得
* @param taskKey
* @return
*/
public List<TaskReportDto> getTaskReportListByTaskKey(String taskKey) {
return rawQueryGetDtoList("select * from t_task_report where task_key=? ORDER BY task_report_id, report_start_date", new String[]{ "" + taskKey }, TaskReportDto.class);
}
public boolean update(TaskReportDto dto) { public boolean update(TaskReportDto dto) {
long count = update("update t_task_report " long count = update("update t_task_report "
+ "set " + "set "
...@@ -123,39 +133,6 @@ public class TaskReportDao extends AbstractDao { ...@@ -123,39 +133,6 @@ public class TaskReportDao extends AbstractDao {
return count > 0; return count > 0;
} }
// public boolean updateRoutinTask(TaskReportDto dto, boolean reportedFlg) {
// long count;
// if (reportedFlg) {
// dto.reportedFlag = true;
//
// count = update("update t_inspect_task_report "
// + "set "
// + "report_end_date=?, "
// + "attached_file_name=?, "
// + "local_attached_file_name=?, "
// + "json_data=?, "
// + "data_send_flag=?, "
// + "attached_file_send_flag=?, "
// + "reported_flag=? "
// + "where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?)",
// dto.getUpdateValues());
// } else {
// count = update("update t_inspect_task_report "
// + "set "
// + "report_end_date=?, "
// + "attached_file_name=?, "
// + "local_attached_file_name=?, "
// + "json_data=?, "
// + "data_send_flag=?, "
// + "attached_file_send_flag=? "
// + "where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?)",
// new Object[] { dto.reportEndDate, dto.attachedFileName, dto.localAttachedFileName, dto.jsonData, dto.dataSendFlag, dto.attachedFileSendFlag, dto.taskKey, dto.taskReportId, dto.reportStartDate });
// }
//
// return count > 0;
// }
// }
/** /**
* 送信フラグのあるデータが存在するか * 送信フラグのあるデータが存在するか
* *
...@@ -179,7 +156,14 @@ public class TaskReportDao extends AbstractDao { ...@@ -179,7 +156,14 @@ public class TaskReportDao extends AbstractDao {
} }
public List<TaskReportDto> getSendableTaskData(Long operationId, String taskKey) { /**
* 送信フラグがtrueのデータを取得
* @param operationId
* @param taskKey
* @param taskReportLevel
* @return
*/
public List<TaskReportDto> getSendableTaskData(Long operationId, String taskKey, int taskReportLevel) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(" select * "); sb.append(" select * ");
sb.append(" from t_task_report ttr "); sb.append(" from t_task_report ttr ");
...@@ -189,8 +173,8 @@ public class TaskReportDao extends AbstractDao { ...@@ -189,8 +173,8 @@ public class TaskReportDao extends AbstractDao {
sb.append(" WHERE ttr.data_send_flg = 1"); sb.append(" WHERE ttr.data_send_flg = 1");
sb.append(" AND tt.operation_id = ?"); sb.append(" AND tt.operation_id = ?");
sb.append(" AND tt.task_key = ?"); sb.append(" AND tt.task_key = ?");
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId, "" + taskKey}, TaskReportDto.class); sb.append(" AND ttr.task_report_level = ?");
// #32782 指示者テーブル関連削除 end return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId, "" + taskKey, "" + taskReportLevel}, TaskReportDto.class);
} }
/** /**
...@@ -222,53 +206,43 @@ public class TaskReportDao extends AbstractDao { ...@@ -222,53 +206,43 @@ public class TaskReportDao extends AbstractDao {
return rawQueryGetInt("select COUNT(*) from t_task_report where task_key=? AND task_report_level=?", new String[]{"" + taskKey, "" + taskReportLevel }) > 0; return rawQueryGetInt("select COUNT(*) from t_task_report where task_key=? AND task_report_level=?", new String[]{"" + taskKey, "" + taskReportLevel }) > 0;
} }
/**
* 定期点検用の報告更新
* @param dto
* @return
// 仮定期点検メソッド */
public boolean updateRoutineTask(TaskReportDto dto) {
long count = update("update t_task_report "
public boolean update(TaskReportDto dto, boolean reportedFlg) { + "set "
long count; + "report_end_date=?, "
if (reportedFlg) { + "attached_file_name=?, "
dto.reportedFlag = true; + "local_attached_file_name=?, "
+ "json_data=?, "
count = update("update t_inspect_task_report " + "data_send_flag=?, "
+ "set " + "attached_file_send_flag=? "
+ "report_end_date=?, " + "reported_flag=? "
+ "attached_file_name=?, " + "where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?)",
+ "local_attached_file_name=?, " new Object[]{dto.reportEndDate, dto.attachedFileName, dto.localAttachedFileName, dto.jsonData, dto.dataSendFlg, dto.attachedFileSendFlg, dto.reportedFlag, dto.taskKey, dto.taskReportId, dto.reportStartDate});
+ "json_data=?, "
+ "data_send_flag=?, "
+ "attached_file_send_flag=?, "
+ "reported_flag=? "
+ "where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?)",
dto.getUpdateValues());
} else {
count = update("update t_inspect_task_report "
+ "set "
+ "report_end_date=?, "
+ "attached_file_name=?, "
+ "local_attached_file_name=?, "
+ "json_data=?, "
+ "data_send_flag=?, "
+ "attached_file_send_flag=? "
+ "where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?)",
new Object[] { dto.reportEndDate, dto.attachedFileName, dto.localAttachedFileName, dto.jsonData, dto.dataSendFlg, dto.attachedFileSendFlg, dto.taskKey, dto.taskReportId, dto.reportStartDate });
}
return count > 0; return count > 0;
} }
public void delete(TaskReportDto dto) { /**
* テーブル物理削除(定期点検専用)
* @param dto
*/
public void deleteRoutineTaskReport(TaskReportDto dto) {
delete("t_task_report", "task_key=? and task_report_level=? task_report_id=? and datetime(report_start_date)=datetime(?, 'utc')", new String[] { dto.taskKey, "" + dto.taskReportLevel, "" + dto.taskReportId, DateTimeUtil.toString(dto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen) }); delete("t_task_report", "task_key=? and task_report_level=? task_report_id=? and datetime(report_start_date)=datetime(?, 'utc')", new String[] { dto.taskKey, "" + dto.taskReportLevel, "" + dto.taskReportId, DateTimeUtil.toString(dto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen) });
} }
/**
* 定期点検報告データで最後の時間データ取得
* @param operationId
* @return
*/
public TaskReportDto getLastRoutineTaskReportData(long operationId) { public TaskReportDto getLastRoutineTaskReportData(long operationId) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(" select tr.* "); sb.append(" select tr.* ");
sb.append(" from t_inspect_task_report tr "); sb.append(" from t_task_report tr ");
sb.append(" inner join "); sb.append(" inner join ");
sb.append(" t_task tt "); sb.append(" t_task tt ");
sb.append(" ON tr.task_key == tt.task_key"); sb.append(" ON tr.task_key == tt.task_key");
...@@ -284,73 +258,44 @@ public class TaskReportDao extends AbstractDao { ...@@ -284,73 +258,44 @@ public class TaskReportDao extends AbstractDao {
} }
} }
/**
* 定期点検の報告データ取得
* @param taskKey
* @param taskReportId
* @param reportStartDate
* @return
*/
public TaskReportDto getRoutineTaskReportUtc(String taskKey, int taskReportId, String reportStartDate){ public TaskReportDto getRoutineTaskReportUtc(String taskKey, int taskReportId, String reportStartDate){
return rawQueryGetDto("select * from t_inspect_task_report where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?, 'utc')", new String[]{ taskKey, "" + taskReportId, reportStartDate }, TaskReportDto.class); return rawQueryGetDto("select * from t_task_report where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?, 'utc')", new String[]{ taskKey, "" + taskReportId, reportStartDate }, TaskReportDto.class);
}
public List<TaskReportDto> selectRoutineTaskReportByTaskKey(String taskKey) {
return rawQueryGetDtoList("select * from t_inspect_task_report where task_key=?", new String[]{ taskKey }, TaskReportDto.class);
}
public List<TaskReportDto> getRoutineTaskReportByOperationId(Long operationId) {
StringBuilder sb = new StringBuilder();
sb.append(" select tr.* ");
sb.append(" from t_inspect_task_report tr ");
sb.append(" inner join ");
sb.append(" t_task tt ");
sb.append(" ON tt.task_key == tr.task_key ");
sb.append(" WHERE tt.del_flg = 0");
sb.append(" AND tt.operation_id = ?");
sb.append(" ORDER BY task_report_id ASC, report_start_date ASC");
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskReportDto.class);
}
public List<TaskReportDto> getSendableRoutineTaskReportData(long operationId) {
StringBuilder sb = new StringBuilder();
sb.append(" select * ");
sb.append(" from t_inspect_task_report tr ");
sb.append(" inner join ");
sb.append(" t_task tt ");
sb.append(" ON tr.task_key == tt.task_key");
sb.append(" WHERE tr.data_send_flag = 1");
sb.append(" AND tt.operation_id = ?");
return rawQueryGetDtoList(sb.toString(), new String[]{ "" + operationId }, TaskReportDto.class);
}
public List<TaskReportDto> getSendableRoutineTaskReportData(long operationId, String taskKey) {
StringBuilder sb = new StringBuilder();
sb.append(" select * ");
sb.append(" from t_inspect_task_report tr ");
sb.append(" inner join ");
sb.append(" t_task tt ");
sb.append(" ON tr.task_key == tt.task_key");
sb.append(" WHERE tr.data_send_flag = 1");
sb.append(" AND tt.operation_id = ?");
sb.append(" AND tt.task_key = ?");
return rawQueryGetDtoList(sb.toString(), new String[]{ "" + operationId, "" + taskKey }, TaskReportDto.class);
} }
/**
* 定期点検のSQL専用のため、taskReportId, report_start_dateが存在するデータの条件追加
* @param operationId
* @return
*/
public boolean existsToDoRoutineTaskReportData(long operationId) { public boolean existsToDoRoutineTaskReportData(long operationId) {
String currDate = DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMddHHmmss_hyphen); String currDate = DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMddHHmmss_hyphen);
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(" select count(*) "); sb.append(" select count(*) ");
sb.append(" from t_inspect_task_report tr "); sb.append(" from t_task_report tr ");
sb.append(" inner join t_task tt ON tt.task_key == tr.task_key "); sb.append(" inner join t_task tt ON tt.task_key == tr.task_key ");
sb.append(" WHERE tt.del_flg = 0 "); sb.append(" WHERE tt.del_flg = 0 ");
sb.append(" AND tt.operation_id = ? "); sb.append(" AND tt.operation_id = ? ");
// 定期点検のみ
sb.append(" AND tr.task_report_id != 0");
sb.append(" AND tr.report_start_date IS NOT NULL");
sb.append(" AND datetime(report_end_date) >= datetime(?, 'utc') "); sb.append(" AND datetime(report_end_date) >= datetime(?, 'utc') ");
return rawQueryGetInt(sb.toString(), new String[]{ "" + operationId, currDate }) > 0; return rawQueryGetInt(sb.toString(), new String[]{ "" + operationId, currDate }) > 0;
} }
public List<TaskReportDto> geRoutineTaskReportByTaskKey(String taskKey) { /**
StringBuilder sb = new StringBuilder(); * 定期点検報告の添付zipファイル名を取得
sb.append(" SELECT * "); * @param taskKey
sb.append(" FROM t_inspect_task_report "); * @param taskReportId
sb.append(" WHERE task_key = ? "); * @param reportStartDate
sb.append(" ORDER BY task_report_id, report_start_date "); * @return
return rawQueryGetDtoList(sb.toString(), new String[]{ taskKey }, TaskReportDto.class); */
}
public String getRoutineTaskReportAttachedFileName(String taskKey, int taskReportId, String reportStartDate) { public String getRoutineTaskReportAttachedFileName(String taskKey, int taskReportId, String reportStartDate) {
return rawQueryGetString("select local_attached_file_name from t_inspect_task_report where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?)", new String[]{ taskKey, "" + taskReportId, reportStartDate }); return rawQueryGetString("select local_attached_file_name from t_inspect_task_report where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?)", new String[]{ taskKey, "" + taskReportId, reportStartDate });
} }
......
...@@ -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() {
......
...@@ -36,7 +36,6 @@ import jp.agentec.abook.abv.bl.common.util.SecurityUtil; ...@@ -36,7 +36,6 @@ import jp.agentec.abook.abv.bl.common.util.SecurityUtil;
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.ContentDao; import jp.agentec.abook.abv.bl.data.dao.ContentDao;
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.OperationDao; import jp.agentec.abook.abv.bl.data.dao.OperationDao;
import jp.agentec.abook.abv.bl.data.dao.PushMessageDao; import jp.agentec.abook.abv.bl.data.dao.PushMessageDao;
...@@ -48,7 +47,6 @@ import jp.agentec.abook.abv.bl.data.dao.TaskWorkerGroupDao; ...@@ -48,7 +47,6 @@ import jp.agentec.abook.abv.bl.data.dao.TaskWorkerGroupDao;
import jp.agentec.abook.abv.bl.data.dao.WorkerGroupDao; import jp.agentec.abook.abv.bl.data.dao.WorkerGroupDao;
import jp.agentec.abook.abv.bl.dto.CategoryContentDto; import jp.agentec.abook.abv.bl.dto.CategoryContentDto;
import jp.agentec.abook.abv.bl.dto.ContentDto; import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.RoutineTaskReportDto;
import jp.agentec.abook.abv.bl.dto.OperationContentDto; import jp.agentec.abook.abv.bl.dto.OperationContentDto;
import jp.agentec.abook.abv.bl.dto.OperationDto; import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.PushMessageDto; import jp.agentec.abook.abv.bl.dto.PushMessageDto;
...@@ -78,10 +76,6 @@ public class OperationLogic extends AbstractLogic { ...@@ -78,10 +76,6 @@ public class OperationLogic extends AbstractLogic {
private TaskReportDao mTaskReportDao = AbstractDao.getDao(TaskReportDao.class); private TaskReportDao mTaskReportDao = AbstractDao.getDao(TaskReportDao.class);
private TaskReportSendDao mTaskReportSendDao = AbstractDao.getDao(TaskReportSendDao.class); private TaskReportSendDao mTaskReportSendDao = AbstractDao.getDao(TaskReportSendDao.class);
private TaskReportItemsDao mTaskReportItemsDao = AbstractDao.getDao(TaskReportItemsDao.class); private TaskReportItemsDao mTaskReportItemsDao = AbstractDao.getDao(TaskReportItemsDao.class);
// #32926 作業報告画面改善 start
// TODO delete RoutineTaskReportDao
private RoutineTaskReportDao mRoutineTaskReportDao = AbstractDao.getDao(RoutineTaskReportDao.class);
// #32926 作業報告画面改善 end
private PushMessageDao mPushMessageDao = AbstractDao.getDao(PushMessageDao.class); private PushMessageDao mPushMessageDao = AbstractDao.getDao(PushMessageDao.class);
...@@ -524,7 +518,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -524,7 +518,7 @@ public class OperationLogic extends AbstractLogic {
//添付ファイル変更の場合、以下の処理を行う //添付ファイル変更の場合、以下の処理を行う
String strReportStartDate = DateTimeUtil.toString_yyyyMMddHHmmss_none(taskReportDto.reportStartDate); String strReportStartDate = DateTimeUtil.toString_yyyyMMddHHmmss_none(taskReportDto.reportStartDate);
String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskReportDto.taskKey); String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskReportDto.taskKey);
String routineTaskReportDirPath = ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskReportDto.taskKey, taskReportDto.taskReportId, strReportStartDate, 0); String routineTaskReportDirPath = ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskReportDto.taskKey, taskReportDto.taskReportId, strReportStartDate);
if (!StringUtil.isNullOrEmpty(taskReportDto.jsonData)) { if (!StringUtil.isNullOrEmpty(taskReportDto.jsonData)) {
JSONObject attachedListJson = (new JSONObject(taskReportDto.jsonData)).getJSONObject("attached"); JSONObject attachedListJson = (new JSONObject(taskReportDto.jsonData)).getJSONObject("attached");
...@@ -613,7 +607,8 @@ public class OperationLogic extends AbstractLogic { ...@@ -613,7 +607,8 @@ public class OperationLogic extends AbstractLogic {
public void updateRoutineTaskReport(long operationId, long contentId, TaskReportDto taskReportDto, boolean attachedChangeFlag, boolean dataSendFlg, boolean insertFlg, boolean reportedFlg) throws IOException { public void updateRoutineTaskReport(long operationId, long contentId, TaskReportDto taskReportDto, boolean attachedChangeFlag, boolean dataSendFlg, boolean insertFlg, boolean reportedFlg) throws IOException {
taskReportDto.attachedFileSendFlg = attachedChangeFlag; taskReportDto.attachedFileSendFlg = attachedChangeFlag;
taskReportDto.dataSendFlg = dataSendFlg; taskReportDto.dataSendFlg = dataSendFlg;
mTaskReportDao.update(taskReportDto, reportedFlg); taskReportDto.reportedFlag = reportedFlg;
mTaskReportDao.updateRoutineTask(taskReportDto);
if (!StringUtil.isNullOrEmpty(taskReportDto.jsonData)) { if (!StringUtil.isNullOrEmpty(taskReportDto.jsonData)) {
JSONObject taskReportJson = new JSONObject(taskReportDto.jsonData); JSONObject taskReportJson = new JSONObject(taskReportDto.jsonData);
...@@ -656,7 +651,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -656,7 +651,7 @@ public class OperationLogic extends AbstractLogic {
String strReportStartDate = DateTimeUtil.toString_yyyyMMddHHmmss_none(taskReportDto.reportStartDate); String strReportStartDate = DateTimeUtil.toString_yyyyMMddHHmmss_none(taskReportDto.reportStartDate);
String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskReportDto.taskKey); String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskReportDto.taskKey);
String routineTaskReportDirPath = ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskReportDto.taskKey, taskReportDto.taskReportId, strReportStartDate, taskReportDto.taskReportLevel); String routineTaskReportDirPath = ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskReportDto.taskKey, taskReportDto.taskReportId, strReportStartDate);
if (insertFlg) { if (insertFlg) {
...@@ -804,8 +799,8 @@ public class OperationLogic extends AbstractLogic { ...@@ -804,8 +799,8 @@ public class OperationLogic extends AbstractLogic {
* @param contentId * @param contentId
* @param dto * @param dto
*/ */
public void deleteTaskReport(long operationId, long contentId, TaskReportDto dto) { public void deleteRoutineTaskReport(long operationId, long contentId, TaskReportDto dto) {
mTaskReportDao.delete(dto); mTaskReportDao.deleteRoutineTaskReport(dto);
String reportStartDate = DateTimeUtil.toString(dto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen); String reportStartDate = DateTimeUtil.toString(dto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen);
mTaskReportSendDao.deleteByTaskKeyIdDate(dto.taskKey, dto.taskReportId, reportStartDate); mTaskReportSendDao.deleteByTaskKeyIdDate(dto.taskKey, dto.taskReportId, reportStartDate);
...@@ -814,10 +809,10 @@ public class OperationLogic extends AbstractLogic { ...@@ -814,10 +809,10 @@ public class OperationLogic extends AbstractLogic {
// 作業報告のディレクトリ削除 // 作業報告のディレクトリ削除
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, dto.taskKey)); FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, dto.taskKey));
FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, dto.taskKey, dto.taskReportId, reportStartDate, 0)); FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, dto.taskKey, dto.taskReportId, reportStartDate));
// 作業報告送信のディレクトリ削除 // 作業報告送信のディレクトリ削除
FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, dto.taskKey, dto.taskReportId, reportStartDate, 0)); FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, dto.taskKey, dto.taskReportId, reportStartDate));
} }
/** /**
...@@ -829,12 +824,13 @@ public class OperationLogic extends AbstractLogic { ...@@ -829,12 +824,13 @@ public class OperationLogic extends AbstractLogic {
* @param reportStartDate * @param reportStartDate
*/ */
public void deleteRoutineTaskReport(long operationId, long contentId, String taskKey, int taskReportId, String reportStartDate) { public void deleteRoutineTaskReport(long operationId, long contentId, String taskKey, int taskReportId, String reportStartDate) {
RoutineTaskReportDto routineTaskReportDto = mRoutineTaskReportDao.getRoutineTaskReportUtc(taskKey, taskReportId, reportStartDate); TaskReportDto taskReportDto = mTaskReportDao.getRoutineTaskReportUtc(taskKey, taskReportId, reportStartDate);
if(routineTaskReportDto != null) { if(taskReportDto != null) {
routineTaskReportDto.dataSendFlag = true; taskReportDto.dataSendFlg = true;
routineTaskReportDto.attachedFileSendFlag = false; taskReportDto.attachedFileSendFlg = false;
routineTaskReportDto.jsonData = ""; taskReportDto.jsonData = "";
mRoutineTaskReportDao.update(routineTaskReportDto, false); taskReportDto.reportedFlag = false;
mTaskReportDao.updateRoutineTask(taskReportDto);
} }
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey); TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
...@@ -845,10 +841,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -845,10 +841,7 @@ public class OperationLogic extends AbstractLogic {
// 作業報告のディレクトリ削除 // 作業報告のディレクトリ削除
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey)); FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
// #32926 作業報告画面改善 start FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, reportStartDate));
// TODO routineTaskReportDto -> taskReportDto
FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, reportStartDate, 0));
// #32926 作業報告画面改善 end
} }
...@@ -856,27 +849,6 @@ public class OperationLogic extends AbstractLogic { ...@@ -856,27 +849,6 @@ public class OperationLogic extends AbstractLogic {
return mTaskReportDao.getRoutineTaskReportUtc(taskKey, taskReportId, reportStartDate); return mTaskReportDao.getRoutineTaskReportUtc(taskKey, taskReportId, reportStartDate);
} }
public List<TaskReportDto> getRoutineTaskReportByTaskKey(String taskKey) {
return mTaskReportDao.geRoutineTaskReportByTaskKey(taskKey);
}
/**
* 定期点検初期化
* @param operationId
* @param contentId
* @param taskKey
* @param taskReportId
* @param reportStartDate
*/
public void initialRoutineTaskReport(long operationId, long contentId, String taskKey, int taskReportId, String reportStartDate) {
RoutineTaskReportDto routineTaskReportDto = mRoutineTaskReportDao.getRoutineTaskReportUtc(taskKey, taskReportId, reportStartDate);
if(routineTaskReportDto != null) {
routineTaskReportDto.jsonData = "";
mRoutineTaskReportDao.update(routineTaskReportDto, false);
}
}
/** /**
* ホットスポットの更新 * ホットスポットの更新
* @param taskKey * @param taskKey
...@@ -999,28 +971,30 @@ public class OperationLogic extends AbstractLogic { ...@@ -999,28 +971,30 @@ public class OperationLogic extends AbstractLogic {
// 現在作業タイプを確認用のparameter追加 // 現在作業タイプを確認用のparameter追加
private void createWorkerGroupJson(Long operationId, String contentPath) throws IOException { private void createWorkerGroupJson(Long operationId, String contentPath) throws IOException {
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
int level = 0;
int listCount = 0;
List<JSONObject> workerGroupJsonList = new ArrayList<JSONObject>(); List<JSONObject> workerGroupJsonList = new ArrayList<JSONObject>();
JSONObject taskGroupJson = new JSONObject(); JSONObject taskGroupJson = new JSONObject();
List<TaskWorkerGroupDto> taskWorkerGroupDtoList = mTaskWorkerGroupDao.getTaskWorkerGroupByOperationId(operationId); List<TaskWorkerGroupDto> taskWorkerGroupDtoList = mTaskWorkerGroupDao.getTaskWorkerGroupByOperationId(operationId);
// 報告と報告(回答)のデータの区分が必要なので、「taskGroup_0」と「taskGroup_1」で形式で作成
for (TaskWorkerGroupDto dto : taskWorkerGroupDtoList) { for (TaskWorkerGroupDto dto : taskWorkerGroupDtoList) {
listCount++;
JSONObject workerGroupJson = new JSONObject(); JSONObject workerGroupJson = new JSONObject();
workerGroupJson.put(ABookKeys.GROUP_ID, dto.groupId); if (level == dto.taskReportLevel) {
workerGroupJson.put(ABookKeys.GROUP_NAME, dto.groupName); workerGroupJson.put(ABookKeys.GROUP_ID, dto.groupId);
workerGroupJsonList.add(workerGroupJson); workerGroupJson.put(ABookKeys.GROUP_NAME, dto.groupName);
} workerGroupJsonList.add(workerGroupJson);
} else {
level++;
}
// #32926 作業報告画面改善 start if (level != dto.taskReportLevel || taskWorkerGroupDtoList.size() == listCount) {
// 報告と報告(回答)のデータの区分が必要なので、「taskGroup_0」と「taskGroup_1」で形式で作成 taskGroupJson.put(String.format("taskGroup_%s", String.valueOf(dto.taskReportLevel)), workerGroupJsonList);
List<TaskReportDto> taskReportList = mTaskReportDao.getTaskReportByOperationId(operationId); workerGroupJsonList = new ArrayList<JSONObject>();
for (TaskReportDto dto : taskReportList) { }
taskGroupJson.put(String.format("taskGroup_%s", String.valueOf(dto.taskReportLevel)), workerGroupJsonList);
} }
taskGroupJson.put("taskGroup", workerGroupJsonList);
Logger.d(TAG, "createWorkerGroupJson : " + taskGroupJson.toString()); Logger.d(TAG, "createWorkerGroupJson : %s contentPath : %s ", taskGroupJson.toString(), contentPath + "/workingGroup.json");
Logger.d(TAG,contentPath + "/workingGroup.json");
// #32926 作業報告画面改善 end
FileUtil.createFile(contentPath + "/workingGroup.json", taskGroupJson.toString()); FileUtil.createFile(contentPath + "/workingGroup.json", taskGroupJson.toString());
} }
...@@ -1096,7 +1070,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1096,7 +1070,7 @@ public class OperationLogic extends AbstractLogic {
taskReportJsonRow.put(ABookKeys.REPORTED, dto.reportedFlag ? 1 : 0); taskReportJsonRow.put(ABookKeys.REPORTED, dto.reportedFlag ? 1 : 0);
List<JSONObject> taskReportInfoList = new ArrayList<JSONObject>(); List<JSONObject> taskReportInfoList = new ArrayList<JSONObject>();
if (!StringUtil.isNullOrEmpty(dto.jsonData)){ if (!StringUtil.isNullOrEmpty(dto.jsonData)) {
taskReportInfoList.add(new JSONObject(dto.jsonData)); taskReportInfoList.add(new JSONObject(dto.jsonData));
} }
taskReportJsonRow.put(ABookKeys.TASK_REPORT_INFO, taskReportInfoList); taskReportJsonRow.put(ABookKeys.TASK_REPORT_INFO, taskReportInfoList);
...@@ -1167,6 +1141,16 @@ public class OperationLogic extends AbstractLogic { ...@@ -1167,6 +1141,16 @@ public class OperationLogic extends AbstractLogic {
} }
/** /**
* 作業キーで報告リスト取得
*
* @param taskKey
* @return
*/
public List<TaskReportDto> getTaskReportByTaskKey(String taskKey) {
return mTaskReportDao.getTaskReportListByTaskKey(taskKey);
}
/**
* プロジェクト一覧取得 * プロジェクト一覧取得
* *
* @param searchWord * @param searchWord
...@@ -1272,24 +1256,35 @@ public class OperationLogic extends AbstractLogic { ...@@ -1272,24 +1256,35 @@ public class OperationLogic extends AbstractLogic {
} }
/** /**
* 作業報告履歴データ送信(全体)
* @param operationId
* @param progressCallback
* @return
* @throws Exception
*/
public boolean sendTaskReportSendData(long operationId, Callback progressCallback) throws Exception {
return sendTaskReportSendData(operationId, null, null, progressCallback);
}
/**
* 作業報告履歴データ送信 * 作業報告履歴データ送信
* @param operationId * @param operationId
* @param taskKey * @param taskKey
* @throws Exception * @throws Exception
*/ */
public boolean sendTaskReportSendData(long operationId, String taskKey, boolean isRoutinTask, Callback progressCallback) throws Exception { public boolean sendTaskReportSendData(long operationId, String taskKey, Integer taskReportLevel, Callback progressCallback) throws Exception {
OperationDto operationDto = mOperationDao.getOperation(operationId);
List<TaskReportDto> taskReportDtoList = null; List<TaskReportDto> taskReportDtoList = null;
int maxProgress = 0; int maxProgress = 0;
if (taskKey == null) { if (taskKey == null) {
taskReportDtoList = mTaskReportDao.getSendableTaskData(operationId); taskReportDtoList = mTaskReportDao.getSendableTaskData(operationId);
maxProgress = 40; maxProgress = 40;
} else { } else {
taskReportDtoList = mTaskReportDao.getSendableTaskData(operationId, taskKey); taskReportDtoList = mTaskReportDao.getSendableTaskData(operationId, taskKey, taskReportLevel);
maxProgress = 100; maxProgress = 100;
} }
if (taskReportDtoList != null && taskReportDtoList.size() > 0) { if (taskReportDtoList != null && taskReportDtoList.size() > 0) {
OperationDto operationDto = mOperationDao.getOperation(operationId);
int allSendCount = mTaskReportSendDao.getSendableTaskReportSendDataCount(operationId, taskKey); int allSendCount = mTaskReportSendDao.getSendableTaskReportSendDataCount(operationId, taskKey);
int progress = maxProgress / allSendCount; int progress = maxProgress / allSendCount;
...@@ -1297,7 +1292,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1297,7 +1292,7 @@ public class OperationLogic extends AbstractLogic {
for (TaskReportDto taskReportDto : taskReportDtoList) { for (TaskReportDto taskReportDto : taskReportDtoList) {
List<TaskReportSendDto> taskReportSendDtoList; List<TaskReportSendDto> taskReportSendDtoList;
int lastTaskReportSendId; int lastTaskReportSendId;
if (isRoutinTask) { if (operationDto.reportType == Constant.ReportType.Routine) {
// 定期点検 // 定期点検
String reportStartDateStr = DateTimeUtil.toString(taskReportDto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen); String reportStartDateStr = DateTimeUtil.toString(taskReportDto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen);
taskReportSendDtoList = mTaskReportSendDao.getSendableTaskReportSendData(taskReportDto.taskKey, taskReportDto.taskReportId, reportStartDateStr); taskReportSendDtoList = mTaskReportSendDao.getSendableTaskReportSendData(taskReportDto.taskKey, taskReportDto.taskReportId, reportStartDateStr);
...@@ -1309,9 +1304,8 @@ public class OperationLogic extends AbstractLogic { ...@@ -1309,9 +1304,8 @@ public class OperationLogic extends AbstractLogic {
for (TaskReportSendDto taskReportSendDto : taskReportSendDtoList) { for (TaskReportSendDto taskReportSendDto : taskReportSendDtoList) {
// 履歴なし:元のattachedFileSendFlg // 履歴なし:元のattachedFileSendFlg
// 履歴追加:古い履歴はtrue
// 履歴更新:true、ファイルに変更が無くてもzipファイル作成 // 履歴更新:true、ファイルに変更が無くてもzipファイル作成
if (taskReportSendDto.taskReportSendId < lastTaskReportSendId || operationDto.enableReportHistory == Constant.EnableReportHistory.Enable) { if (taskReportSendDto.taskReportSendId < lastTaskReportSendId) {
taskReportDto.attachedFileSendFlg = true; taskReportDto.attachedFileSendFlg = true;
} }
...@@ -1320,7 +1314,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1320,7 +1314,7 @@ public class OperationLogic extends AbstractLogic {
if (taskReportDto.attachedFileSendFlg) { if (taskReportDto.attachedFileSendFlg) {
String fileName = null; String fileName = null;
zipFile = createAttachedFileForSend(operationId, taskReportDto.taskKey, taskReportSendDto.taskReportSendId, isRoutinTask, taskReportDto.taskReportId, strReportStartDate, taskReportDto.taskReportLevel); zipFile = createAttachedFileForSend(operationId, taskReportDto.taskKey, taskReportSendDto.taskReportSendId, operationDto.reportType == Constant.ReportType.Routine, taskReportDto.taskReportId, strReportStartDate, taskReportDto.taskReportLevel);
if (zipFile != null) { if (zipFile != null) {
fileName = FileUtil.getFilenameWithoutExt(zipFile.getName()); fileName = FileUtil.getFilenameWithoutExt(zipFile.getName());
} }
...@@ -1328,27 +1322,27 @@ public class OperationLogic extends AbstractLogic { ...@@ -1328,27 +1322,27 @@ public class OperationLogic extends AbstractLogic {
} }
try { try {
AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).testSendTaskData( AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).sendTaskData(
cache.getMemberInfo().sid, cache.getMemberInfo().sid,
operationId, operationId,
taskReportDto, taskReportDto,
zipFile, zipFile,
taskReportSendDto.saveDate, taskReportSendDto.saveDate,
isRoutinTask operationDto.reportType
); );
progressCallback.callback(new Integer(progress)); progressCallback.callback(new Integer(progress));
mTaskReportSendDao.deleteBySendId(taskReportSendDto.taskReportSendId); mTaskReportSendDao.deleteBySendId(taskReportSendDto.taskReportSendId);
if (isRoutinTask) { if (operationDto.reportType == Constant.ReportType.Routine) {
// 定期点検 // 定期点検
FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, taskReportSendDto.taskReportId, strReportStartDate, taskReportSendDto.taskReportSendId, taskReportDto.taskReportLevel)); FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, taskReportSendDto.taskReportId, strReportStartDate, taskReportSendDto.taskReportSendId));
} else { } else {
FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, taskReportSendDto.taskReportSendId, taskReportDto.taskReportLevel)); FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey,taskReportLevel, taskReportSendDto.taskReportSendId));
} }
} catch (ABVException ex) { } catch (ABVException ex) {
if (ex.getCode() == ABVExceptionCode.P_E_ACMS_P005) { if (ex.getCode() == ABVExceptionCode.P_E_ACMS_P005) {
mTaskReportSendDao.deleteBySendId(taskReportSendDto.taskReportSendId); mTaskReportSendDao.deleteBySendId(taskReportSendDto.taskReportSendId);
FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, taskReportSendDto.taskReportId, strReportStartDate, taskReportSendDto.taskReportSendId, taskReportDto.taskReportLevel)); FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, taskReportSendDto.taskReportId, strReportStartDate, taskReportSendDto.taskReportSendId));
return true; return true;
} }
} catch (Exception ex) { } catch (Exception ex) {
...@@ -1362,7 +1356,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1362,7 +1356,7 @@ public class OperationLogic extends AbstractLogic {
if (taskReportDto.delFlg) { if (taskReportDto.delFlg) {
// 物理削除 // 物理削除
mTaskDao.deleteTaskData(taskReportDto.taskKey, false); mTaskDao.deleteTaskData(taskReportDto.taskKey);
} else { } else {
taskReportDto.dataSendFlg = false; taskReportDto.dataSendFlg = false;
taskReportDto.attachedFileSendFlg = false; taskReportDto.attachedFileSendFlg = false;
...@@ -1439,7 +1433,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1439,7 +1433,7 @@ public class OperationLogic extends AbstractLogic {
*/ */
public String getRoutineTaskReportFile(long operationId, String taskKey, long taskId, int taskReportId, int taskReportInfoId, String reportStartDate, String attachedFileName) throws ABVException, InterruptedException { public String getRoutineTaskReportFile(long operationId, String taskKey, long taskId, int taskReportId, int taskReportInfoId, String reportStartDate, String attachedFileName) throws ABVException, InterruptedException {
GetTaskFileParameters parameters = new GetTaskFileParameters(cache.getMemberInfo().sid, taskId, 1, taskReportInfoId); GetTaskFileParameters parameters = new GetTaskFileParameters(cache.getMemberInfo().sid, taskId, 1, taskReportInfoId);
String outputFilePath = ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, reportStartDate, 0) + "/" + attachedFileName + ".zip"; String outputFilePath = ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, reportStartDate) + "/" + attachedFileName + ".zip";
AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).getTaskFile(parameters, operationId, outputFilePath); AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).getTaskFile(parameters, operationId, outputFilePath);
return outputFilePath; return outputFilePath;
} }
...@@ -1479,8 +1473,8 @@ public class OperationLogic extends AbstractLogic { ...@@ -1479,8 +1473,8 @@ public class OperationLogic extends AbstractLogic {
mOperationDao.updateContentCreatingFlg(operationId, true); mOperationDao.updateContentCreatingFlg(operationId, true);
} }
public RoutineTaskReportDto getLastRoutineTaskReportData(long operationId) { public TaskReportDto getLastRoutineTaskReportData(long operationId) {
return mRoutineTaskReportDao.getLastRoutineTaskReportData(operationId); return mTaskReportDao.getLastRoutineTaskReportData(operationId);
} }
/** /**
...@@ -1549,7 +1543,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1549,7 +1543,7 @@ public class OperationLogic extends AbstractLogic {
if (routineFlag) { if (routineFlag) {
filePath = ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, taskKey, reportId, reportStartDate, taskReportSendId); filePath = ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, taskKey, reportId, reportStartDate, taskReportSendId);
} else { } else {
filePath = ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskKey, taskReportSendId, taskReportLevel); filePath = ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskKey, taskReportLevel, taskReportSendId);
} }
File fileDir = new File(filePath); File fileDir = new File(filePath);
...@@ -1601,6 +1595,11 @@ public class OperationLogic extends AbstractLogic { ...@@ -1601,6 +1595,11 @@ public class OperationLogic extends AbstractLogic {
} }
} }
/**
* 作業の開始日のチェック
* @param operationId
* @return
*/
public String getRoutineTaskOperationAvailableDateStr(Long operationId) { public String getRoutineTaskOperationAvailableDateStr(Long operationId) {
OperationDto operationDto = getOperation(operationId); OperationDto operationDto = getOperation(operationId);
Date currDate = DateTimeUtil.getCurrentSqlDate(); Date currDate = DateTimeUtil.getCurrentSqlDate();
......
<?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);
......
...@@ -23,6 +23,7 @@ import jp.agentec.abook.abv.bl.common.Callback; ...@@ -23,6 +23,7 @@ import jp.agentec.abook.abv.bl.common.Callback;
import jp.agentec.abook.abv.bl.common.CommonExecutor; import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant; import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys; import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.ABVException;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.dto.OperationDto; import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.OperationTaskDto; import jp.agentec.abook.abv.bl.dto.OperationTaskDto;
...@@ -111,7 +112,7 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -111,7 +112,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
mOperationLogic.insertTaskReportSend(taskKey, taskReportId, reportStartDate, null, true); mOperationLogic.insertTaskReportSend(taskKey, taskReportId, reportStartDate, null, true);
} }
sendTaskData(context, operationId, taskKey); sendTaskData(context, operationId, taskKey, taskReportLevel);
break; break;
// #32782 指示者テーブル関連削除 end // #32782 指示者テーブル関連削除 end
...@@ -160,46 +161,35 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -160,46 +161,35 @@ public class ABookCheckWebViewHelper extends ABookHelper {
CommonExecutor.execute(new Runnable() { CommonExecutor.execute(new Runnable() {
@Override @Override
public void run() { public void run() {
OperationDto operationDto = mOperationLogic.getOperation(operationId);
boolean isError = false; boolean isError = false;
// try { try {
// if (taskReportLevel == Constant.TaskReportLevel.ReportType) { if (mOperationLogic.sendTaskReportSendData(operationId, taskKey, taskReportLevel, progressCallback)) {
// // #32782 指示者テーブル関連削除 start context.handleErrorMessageToast(R.string.P005);
// // TODO change }
// mOperationLogic.sendTaskReportSendData(operationId, taskKey, taskReportLevel, progressCallback);
// // #32782 指示者テーブル関連削除 end mOperationLogic.updateSyncOperation(operationId, true);
// mOperationLogic.updateSyncOperation(operationId, true);
// } else { } catch (ABVException ex) {
// OperationDto operationDto = mOperationLogic.getOperation(operationId); Logger.e(TAG, "sendTaskData", ex);
// if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) {
// if (mOperationLogic.sendRoutineTaskReportSendData(operationId, taskKey, progressCallback) > 0){
// context.handleErrorMessageToast(R.string.P005);
// }
// } else {
// mOperationLogic.sendTaskReportSendData(operationId, taskKey, progressCallback);
// }
// if (enableReportHistory != Constant.OperationUpdateType.HISTORY_ADD) {
// mOperationLogic.updateSyncOperation(operationId, true);
// }
// }
// } catch (ABVException ex) {
// Logger.e(TAG, "sendTaskData", ex);
// if (isDirections) { // if (isDirections) {
// context.showSimpleAlertDialog(R.string.app_name, R.string.msg_send_error_task_directions_data); // context.showSimpleAlertDialog(R.string.app_name, R.string.msg_send_error_task_directions_data);
// } else { // } else {
// context.showSimpleAlertDialog(R.string.app_name, R.string.msg_send_error_task_report_data); context.showSimpleAlertDialog(R.string.app_name, R.string.msg_send_error_task_report_data);
// } // }
// } catch (Exception e) { isError = true;
// Logger.e(TAG, e); } catch (Exception e) {
Logger.e(TAG, e);
// if (isDirections) { // if (isDirections) {
// context.showSimpleAlertDialog(R.string.app_name, R.string.msg_send_error_task_directions_data); // context.showSimpleAlertDialog(R.string.app_name, R.string.msg_send_error_task_directions_data);
// } else { // } else {
// context.showSimpleAlertDialog(R.string.app_name, R.string.msg_send_error_task_report_data); context.showSimpleAlertDialog(R.string.app_name, R.string.msg_send_error_task_report_data);
// } // }
// isError = true; isError = true;
// } finally { } finally {
// mFinishCallback.callback(isError); mFinishCallback.callback(isError);
// context.closeProgressPopup(); context.closeProgressPopup();
// } }
} }
}); });
} }
...@@ -275,122 +265,19 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -275,122 +265,19 @@ public class ABookCheckWebViewHelper extends ABookHelper {
} }
/** /**
* 作業指示の登録・更新
* *
* @param taskKey * @param taskKey
* @param enableReportHistory
* @param operationId * @param operationId
* @param contentId * @param contentId
* @param param * @param param
* @param contentPath * @param contentPath
* @param insertFlg * @param insertFlg
* @param reportType
* @param taskReportLevel
* @throws IOException * @throws IOException
*/ */
private void insertOrUpdateTaskDirections(String taskKey, long operationId, long contentId, Map<String, String> param, String contentPath, boolean insertFlg) throws IOException { private void insertOrUpdateTaskReport(String taskKey, int enableReportHistory, long operationId, long contentId, Map<String, String> param, String contentPath, boolean insertFlg, int reportType, int taskReportLevel) throws IOException {
// #32782 指示者テーブル関連削除 start
// TODO Delete method
boolean attachedChangeFlag = param.get(ABookKeys.ATTACHED_CHANGE_FLAG).equals("1") ? true : false;
String taskDirections = param.get(ABookKeys.TASK_DIRECTIONS);
JSONObject taskDirectionsJson = new JSONObject(taskDirections);
String taskHotSpotInfo = param.get(ABookKeys.HOT_SPOT);
if (insertFlg) {
mOperationLogic.insertTaskReport(taskKey, operationId, contentId, taskDirectionsJson, taskHotSpotInfo, null, attachedChangeFlag, true);
mOperationLogic.createJsonForOperationContent(operationId, contentPath, false);
} else {
mOperationLogic.updateTaskReport(taskKey, operationId, contentId, taskDirectionsJson, taskHotSpotInfo, null, attachedChangeFlag, true);
mOperationLogic.createJsonForOperationContent(operationId, contentPath, false);
}
// #32782 指示者テーブル関連削除 end
}
// #32782 指示者テーブル関連削除 start
// TODO change
/*
private void insertOrUpdateTaskReport(String taskKey, int enableReportHistory, long operationId, long contentId, Map<String, String> param, String contentPath, boolean insertFlg, boolean routineTaskReportFlg) throws IOException {
int taskReportSendId = 0;
// #32782 指示者テーブル関連削除 start
// 指示者か報告者か判断
int mOperationAuthLevel = ABVDataCache.getInstance().getMemberInfo().operationAuthLevel;
boolean attachedChangeFlag = param.get(ABookKeys.ATTACHED_CHANGE_FLAG).equals("1") ? true : false;
String taskReport = param.get(ABookKeys.TASK_REPORT);
// TODO この処理後、削除
if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
taskReport = param.get(ABookKeys.TASK_DIRECTIONS);
}
JSONObject taskReportJson = new JSONObject(taskReport);
String taskHotSpotInfo = null;
if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
taskHotSpotInfo = param.get(ABookKeys.HOT_SPOT);
}
// #32782 指示者テーブル関連削除 end
int taskReportId = 0;
String reportStartDate = "";
// 指示者の場合下記の処理を行わない
if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
if (insertFlg) {
mOperationLogic.insertTaskReportReply(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true, taskHotSpotInfo);
mOperationLogic.createJsonForOperationContent(operationId, enableReportHistory, contentPath, false);
} else {
mOperationLogic.updateTaskReportReplyLevel(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true, taskHotSpotInfo);
mOperationLogic.createJsonForOperationContent(operationId, enableReportHistory, contentPath, false);
}
} else {
if (routineTaskReportFlg) {
taskReportId = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_ID));
reportStartDate = param.get(ABookKeys.REPORT_START_DATE);
reportStartDate = reportStartDate.replace("T", " ");
//reportStartDate = DateTimeUtil.toString(DateTimeUtil.toDate(reportStartDate, "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen), DateTimeFormat.yyyyMMddHHmmss_hyphen);
RoutineTaskReportDto routineTaskTaskReportDto = mOperationLogic.getRoutineTaskReportUtc(taskKey, taskReportId, reportStartDate);
routineTaskTaskReportDto.jsonData = taskReport;
mOperationLogic.updateRoutineTaskReport(operationId, contentId, routineTaskTaskReportDto, attachedChangeFlag, true, insertFlg, true);
} else {
if (insertFlg) {
mOperationLogic.insertTaskReportReply(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true, taskHotSpotInfo);
} else {
mOperationLogic.updateTaskReportReplyLevel(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true, taskHotSpotInfo);
}
}
if (routineTaskReportFlg) {
mOperationLogic.createJsonForOperationContent(operationId, enableReportHistory, contentPath, false);
copyRoutineTaskReportAttachedMovie(operationId, contentId, taskKey, taskReportId, reportStartDate);
} else {
mOperationLogic.createJsonForOperationContent(operationId, enableReportHistory, contentPath, false);
copyTaskAttachedMovie(operationId, contentId, taskKey, String.valueOf(taskReportLevel));
}
if (enableReportHistory == Constant.OperationUpdateType.HISTORY_NO) {
//データ無い場合は中でinsertされる
taskReportSendId = mOperationLogic.updateTaskReportSend(taskKey, taskReportId, reportStartDate, taskReportJson, false);
} else {
taskReportSendId = mOperationLogic.insertTaskReportSend(taskKey, taskReportId, reportStartDate, taskReportJson, false);
}
if (enableReportHistory == Constant.OperationUpdateType.HISTORY_ADD) {
if (routineTaskReportFlg) {
mOperationLogic.initialRoutineTaskReport(operationId, contentId, taskKey, taskReportId, reportStartDate);
mOperationLogic.createRoutineTaskReportJson(operationId, contentPath);
} else {
mOperationLogic.initialTaskReport(operationId, contentId, taskKey);
mOperationLogic.createTaskReportJson(operationId, contentPath);
}
}
copyReportTaskSendFiles(operationId, taskKey, taskReportSendId, routineTaskReportFlg, taskReportId, reportStartDate);
if (enableReportHistory == Constant.OperationUpdateType.HISTORY_ADD) {
// 作業報告のディレクトリ削除
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
FileUtil.delete(ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, false));
}
}
}
*/
private void insertOrUpdateTaskReport(String taskKey, int reportUpdateType, long operationId, long contentId, Map<String, String> param, String contentPath, boolean insertFlg, int reportType, int taskReportLevel) throws IOException {
int taskReportSendId = 0; int taskReportSendId = 0;
boolean attachedChangeFlag = param.get(ABookKeys.ATTACHED_CHANGE_FLAG).equals("1") ? true : false; boolean attachedChangeFlag = param.get(ABookKeys.ATTACHED_CHANGE_FLAG).equals("1") ? true : false;
String taskReport = param.get(ABookKeys.TASK_REPORT); String taskReport = param.get(ABookKeys.TASK_REPORT);
...@@ -402,12 +289,13 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -402,12 +289,13 @@ public class ABookCheckWebViewHelper extends ABookHelper {
taskReportId = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_ID)); taskReportId = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_ID));
reportStartDate = param.get(ABookKeys.REPORT_START_DATE); reportStartDate = param.get(ABookKeys.REPORT_START_DATE);
reportStartDate = reportStartDate.replace("T", " "); reportStartDate = reportStartDate.replace("T", " ");
//reportStartDate = DateTimeUtil.toString(DateTimeUtil.toDate(reportStartDate, "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen), DateTimeFormat.yyyyMMddHHmmss_hyphen);
TaskReportDto taskReportDto = mOperationLogic.getRoutineTaskReportUtc(taskKey, taskReportId, reportStartDate); TaskReportDto taskReportDto = mOperationLogic.getRoutineTaskReportUtc(taskKey, taskReportId, reportStartDate);
taskReportDto.jsonData = taskReport; taskReportDto.jsonData = taskReport;
mOperationLogic.updateRoutineTaskReport(operationId, contentId, taskReportDto, attachedChangeFlag, true, insertFlg, true); mOperationLogic.updateRoutineTaskReport(operationId, contentId, taskReportDto, attachedChangeFlag, true, insertFlg, true);
mOperationLogic.createJsonForOperationContent(operationId, contentPath, true);
copyRoutineTaskReportAttachedMovie(operationId, contentId, taskKey, taskReportId, reportStartDate);
} else { } else {
if (taskReportLevel == Constant.TaskReportLevel.ReportType) { if (taskReportLevel == Constant.TaskReportLevel.ReportType) {
String hotSpotInfo = param.get(ABookKeys.HOT_SPOT); String hotSpotInfo = param.get(ABookKeys.HOT_SPOT);
...@@ -423,52 +311,34 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -423,52 +311,34 @@ public class ABookCheckWebViewHelper extends ABookHelper {
mOperationLogic.updateTaskReportReplyLevel(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true); mOperationLogic.updateTaskReportReplyLevel(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true);
} }
} }
}
if (reportType == Constant.ReportType.Routine) {
mOperationLogic.createJsonForOperationContent(operationId, contentPath, true);
copyRoutineTaskReportAttachedMovie(operationId, contentId, taskKey, taskReportId, reportStartDate);
} else {
mOperationLogic.createJsonForOperationContent(operationId, contentPath, false); mOperationLogic.createJsonForOperationContent(operationId, contentPath, false);
copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel); copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel);
} }
if (reportUpdateType == Constant.EnableReportHistory.Invalid) { if (enableReportHistory == Constant.EnableReportHistory.Invalid) {
//データ無い場合は中でinsertされる //データ無い場合は中でinsertされる
taskReportSendId = mOperationLogic.updateTaskReportSend(taskKey, taskReportId, reportStartDate, taskReportJson, false); taskReportSendId = mOperationLogic.updateTaskReportSend(taskKey, taskReportId, reportStartDate, taskReportJson, false);
}else { } else {
taskReportSendId = mOperationLogic.insertTaskReportSend(taskKey, taskReportId, reportStartDate, taskReportJson, false); taskReportSendId = mOperationLogic.insertTaskReportSend(taskKey, taskReportId, reportStartDate, taskReportJson, false);
} }
// #32926 作業報告画面改善 start // #32926 作業報告画面改善 start
copyReportTaskSendFiles(operationId, taskKey, taskReportSendId, reportType == Constant.ReportType.Routine, taskReportId, reportStartDate, taskReportLevel); copyReportTaskSendFiles(operationId, taskKey, taskReportSendId, reportType == Constant.ReportType.Routine, taskReportId, reportStartDate, taskReportLevel);
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
if (reportUpdateType == Constant.EnableReportHistory.Enable) {
// 作業報告のディレクトリ削除
// #32926 作業報告画面改善 start
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel));
// #32926 作業報告画面改善 end
}
} }
// #32782 指示者テーブル関連削除 end
// xwalkで動画ファイルにアクセスするため、../files/..の以下のパスのディレクトりを../cache/..以下のパスに変更 // xwalkで動画ファイルにアクセスするため、../files/..の以下のパスのディレクトりを../cache/..以下のパスに変更
public void allCopyTaskAttachedMovieFileToCache(long operationId, long contentId, OperationDto operationDto) { public void allCopyTaskAttachedMovieFileToCache(long operationId, long contentId, OperationDto operationDto) {
try { try {
List<TaskDto> taskDtoList = mOperationLogic.getOperationTask(operationId); List<TaskDto> taskDtoList = mOperationLogic.getOperationTask(operationId);
for (TaskDto taskDto : taskDtoList) { for (TaskDto taskDto : taskDtoList) {
if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) { List<TaskReportDto> taskReportDtoList = mOperationLogic.getTaskReportByTaskKey(taskDto.taskKey);
List<TaskReportDto> listRoutineTaskReport = mOperationLogic.getRoutineTaskReportByTaskKey(taskDto.taskKey); for (TaskReportDto taskReportDto : taskReportDtoList) {
for (TaskReportDto routineTaskDto : listRoutineTaskReport) { if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) {
copyRoutineTaskReportAttachedMovie(operationId, contentId, routineTaskDto.taskKey, routineTaskDto.taskReportId, routineTaskDto.reportStartDate); copyRoutineTaskReportAttachedMovie(operationId, contentId, taskReportDto.taskKey, taskReportDto.taskReportId, taskReportDto.reportStartDate);
} else {
copyTaskAttachedMovie(operationId, contentId, taskDto.taskKey, taskReportDto.taskReportLevel);
} }
} else {
// #32926 作業報告画面改善 start
copyTaskAttachedMovie(operationId, contentId, taskDto.taskKey, taskDto.taskReportLevel);
// #32926 作業報告画面改善 end
} }
} }
} catch (IOException e) { } catch (IOException e) {
...@@ -497,7 +367,7 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -497,7 +367,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
return; return;
} }
String taskKeyPath = ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, reportStartDate, 0); String taskKeyPath = ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, reportStartDate);
File taskKeyFile = new File(taskKeyPath); File taskKeyFile = new File(taskKeyPath);
// 作業報告書の添付ファイル(mp4,mov拡張子のみ)コピー // 作業報告書の添付ファイル(mp4,mov拡張子のみ)コピー
...@@ -514,17 +384,15 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -514,17 +384,15 @@ public class ABookCheckWebViewHelper extends ABookHelper {
} }
/** /**
* /.../files/ABook/project/{projectId}/{taskKey}/{taskType}/*.(mov,mp4)を * /.../files/ABook/project/{projectId}/{taskKey}/{taskType}/{taskReportLevel}/*.(mov,mp4)を
* /.../cache/{contentId}/attachedMovie/{taskKey}/{taskType}/*.(mov,mp4)にコピー * /.../cache/{contentId}/attachedMovie/{taskKey}/{taskType}/{taskReportLevel}/*.(mov,mp4)にコピー
* *
* @param operationId * @param operationId
* @param contentId * @param contentId
*/ */
// #32926 作業報告画面改善 start
public void copyTaskAttachedMovie(long operationId, long contentId, String taskKey, int taskReportLevel) throws IOException { public void copyTaskAttachedMovie(long operationId, long contentId, String taskKey, int taskReportLevel) throws IOException {
// 作業指示書の添付ファイル(mp4,mov拡張子のみ)コピー // 作業指示書の添付ファイル(mp4,mov拡張子のみ)コピー
String taskKeyPath = ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel); String taskKeyPath = ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel);
// #32926 作業報告画面改善 end
File taskKeyFile = new File(taskKeyPath); File taskKeyFile = new File(taskKeyPath);
if (taskKeyFile.exists()) { if (taskKeyFile.exists()) {
String attachedMoviesFilePath = ABVEnvironment.getInstance().getAttachedDirectionOrReportDirPath(contentId, taskKey, taskReportLevel); String attachedMoviesFilePath = ABVEnvironment.getInstance().getAttachedDirectionOrReportDirPath(contentId, taskKey, taskReportLevel);
...@@ -538,21 +406,6 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -538,21 +406,6 @@ public class ABookCheckWebViewHelper extends ABookHelper {
} }
} }
} }
// // 作業報告書の添付ファイル(mp4,mov拡張子のみ)コピー
// if (ABVDataCache.getInstance().getMemberInfo().operationAuthLevel == OperationAuthLevel.WORKER) {
// taskKeyPath = ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, taskReportLevel);
// taskKeyFile = new File(taskKeyPath);
// if (taskKeyFile.exists()) {
// String attachedMoviesFilePath = ABVEnvironment.getInstance().getAttachedDirectionOrReportDirPath(contentId, taskKey, taskReportLevel);
// FileUtil.delete(attachedMoviesFilePath);
// FileUtil.createNewDirectory(attachedMoviesFilePath);
// for (String taskAttachedFile : taskKeyFile.list()) {
// if (StringUtil.endsWithAny(taskAttachedFile.toLowerCase(), "mov", "mp4")) {
// FileUtil.copy(taskKeyPath + "/" + taskAttachedFile, attachedMoviesFilePath + "/" + taskAttachedFile, true);
// }
// }
// }
// }
} }
/** /**
...@@ -573,7 +426,7 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -573,7 +426,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
if (routineTaskReportFlg) { if (routineTaskReportFlg) {
dReportStartDate = DateTimeUtil.toDate(reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen); dReportStartDate = DateTimeUtil.toDate(reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen);
sReportStartDate = DateTimeUtil.toString_yyyyMMddHHmmss_none(dReportStartDate); sReportStartDate = DateTimeUtil.toString_yyyyMMddHHmmss_none(dReportStartDate);
taskAttachedPath = ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, sReportStartDate, taskReportLevel); taskAttachedPath = ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, sReportStartDate);
} else { } else {
// #32926 作業報告画面改善 start // #32926 作業報告画面改善 start
taskAttachedPath = ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel); taskAttachedPath = ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel);
...@@ -584,15 +437,17 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -584,15 +437,17 @@ public class ABookCheckWebViewHelper extends ABookHelper {
if (taskAttachedFiles.exists()) { if (taskAttachedFiles.exists()) {
String taskReportSendPath; String taskReportSendPath;
if (routineTaskReportFlg) { if (routineTaskReportFlg) {
taskReportSendPath = ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, taskKey, taskReportId, sReportStartDate, taskReportSendId, taskReportLevel); taskReportSendPath = ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, taskKey, taskReportId, sReportStartDate, taskReportSendId);
} else { } else {
taskReportSendPath = ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskKey, taskReportSendId, taskReportLevel); taskReportSendPath = ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskKey, taskReportLevel, taskReportSendId);
} }
FileUtil.delete(taskReportSendPath); FileUtil.delete(taskReportSendPath);
FileUtil.createNewDirectory(taskReportSendPath); FileUtil.createNewDirectory(taskReportSendPath);
for (String taskAttachedFile : taskAttachedFiles.list()) { for (String taskAttachedFile : taskAttachedFiles.list()) {
FileUtil.copy(taskAttachedPath + "/" + taskAttachedFile, taskReportSendPath + "/" + taskAttachedFile, true); if (!taskAttachedFile.equals(ABVEnvironment.getInstance().REPORT_SEND)) {
FileUtil.copy(taskAttachedPath + "/" + taskAttachedFile, taskReportSendPath + "/" + taskAttachedFile, true);
}
} }
} }
} }
...@@ -609,7 +464,7 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -609,7 +464,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
@Override @Override
protected Void doInBackground(Void... params) { protected Void doInBackground(Void... params) {
try { try {
String taskReportSendPath = ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskKey, taskReportSendId, taskReportLevel); String taskReportSendPath = ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskKey, taskReportLevel, taskReportSendId);
FileUtil.delete(taskReportSendPath); FileUtil.delete(taskReportSendPath);
} catch (Exception ex) { } catch (Exception ex) {
Logger.e(String.format("%s.deleteReportTaskSendFiles(%d, %s)", TAG, operationId, taskKey), ex); Logger.e(String.format("%s.deleteReportTaskSendFiles(%d, %s)", TAG, operationId, taskKey), ex);
......
...@@ -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