Commit 99e0cbc2 by Jeong Gilmo

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

parents 30c2a398 3493050a
...@@ -578,67 +578,6 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -578,67 +578,6 @@ public class AcmsClient implements AcmsClientResponseListener {
return json; return json;
} }
/**
* 定期点検データ送信
* @param sid
* @param operationId
* @param taskReportId
* @param taskReportInfoId
* @param reportStartDate
* @param taskReportInfo
* @param formFile
* @param attachedChangeFlag
* @param taskReportSendSaveDate
* @return
* @throws ABVException
* @throws NetworkDisconnectedException
* @throws IOException
*/
public AcmsMessageJSON sendRoutineTaskReportData(String sid, long operationId, int taskReportId, int taskReportInfoId
, Date reportStartDate, String taskReportInfo, File formFile, boolean attachedChangeFlag, Date taskReportSendSaveDate) throws ABVException, NetworkDisconnectedException, IOException {
if (networkAdapter != null && !networkAdapter.isNetworkConnected()) { // NWのチェック
throw new NetworkDisconnectedException();
}
HttpResponse result;
String apiUrl = AcmsApis.getApiUrl(env.acmsAddress, urlPath, AcmsApis.ApiSendRoutineTaskData);
List<HttpMultipart> HttpMultipartList = new ArrayList<HttpMultipart>();
HttpMultipartList.add(new HttpMultipart(ABookKeys.SID, sid));
HttpMultipartList.add(new HttpMultipart(ABookKeys.OPERATION_ID, StringUtil.toString(operationId)));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_ID, StringUtil.toString(taskReportId)));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_INFO_ID, StringUtil.toString(taskReportInfoId)));
HttpMultipartList.add(new HttpMultipart(ABookKeys.REPORT_START_DATE, DateTimeUtil.toStringForCmsGMT(reportStartDate)));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_INFO, taskReportInfo));
HttpMultipartList.add(new HttpMultipart(ABookKeys.ATTACHED_CHANGE_FLAG, attachedChangeFlag ? "1" : "0"));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_SAVE_DATE, DateTimeUtil.toStringForCmsGMT(taskReportSendSaveDate)));
if (formFile != null) {
HttpMultipartList.add(new HttpMultipart(ABookKeys.FORM_FILE, formFile));
}
result = HttpRequestSender.post(apiUrl, HttpMultipartList.toArray(new HttpMultipart[HttpMultipartList.size()]));
Logger.d(TAG, "[sendRoutineTaskReportData].request: operationId=%d, taskReportId=%d, taskReportInfoId=%d, reportStartDate=%tc, taskReportInfo=%s, attachedChangeFlag=%b, taskReportSendSaveDate=%tc"
, operationId, taskReportId, taskReportInfoId, reportStartDate, taskReportInfo, attachedChangeFlag, taskReportSendSaveDate);
AcmsMessageJSON json = new AcmsMessageJSON(result.httpResponseBody);
Logger.d(TAG, "[sendRoutineTaskReportData].response: %s", json);
if (json.errorMessage != null) {
if (json.errorMessage[0].equals("P003")) {
throw new ABVException(ABVExceptionCode.P_E_ACMS_P003);
} else if (json.errorMessage[0].equals("P004")) {
throw new ABVException(ABVExceptionCode.P_E_ACMS_P004);
} else if (json.errorMessage[0].equals("P005")) {
throw new ABVException(ABVExceptionCode.P_E_ACMS_P005);
}
}
if (json.httpStatus != 200) {
throw new AcmsException(ABVExceptionCode.S_E_ACMS_0001, json);
}
return json;
}
/** /**
* プロジェクトの作業データ取得 * プロジェクトの作業データ取得
* @param param * @param param
......
...@@ -156,4 +156,10 @@ public class Constant { ...@@ -156,4 +156,10 @@ public class Constant {
int NO = 0; int NO = 0;
int YES = 1; int YES = 1;
} }
// 作業可能区分
public interface EnableReport {
int NO = 0;
int YES = 1;
}
} }
...@@ -62,6 +62,15 @@ public class OperationContentDao extends AbstractDao { ...@@ -62,6 +62,15 @@ public class OperationContentDao extends AbstractDao {
return rawQueryGetLongList("select content_id from r_operation_content where operation_id=?", new String[]{""+ operationId}); return rawQueryGetLongList("select content_id from r_operation_content where operation_id=?", new String[]{""+ operationId});
} }
/**
* 資料IDに紐づいた作業が存在しないと資料を削除する判定
* @param contentId
* @return
*/
public boolean isDeleteContent (Long contentId) {
return rawQueryGetInt("select COUNT(*) from r_operation_content where content_id=?", new String[]{"" + contentId }) == 0;
}
public boolean insertOperationContent(OperationContentDto dto) { public boolean insertOperationContent(OperationContentDto dto) {
StringBuffer sql = new StringBuffer(); StringBuffer sql = new StringBuffer();
......
...@@ -100,6 +100,11 @@ public class OperationDao extends AbstractDao { ...@@ -100,6 +100,11 @@ public class OperationDao extends AbstractDao {
dto.enableReportEdit = cursor.getInt(column); dto.enableReportEdit = cursor.getInt(column);
} }
column = cursor.getColumnIndex("report_type");
if (column != -1) {
dto.reportType = cursor.getInt(column);
}
return dto; return dto;
} }
...@@ -206,13 +211,13 @@ public class OperationDao extends AbstractDao { ...@@ -206,13 +211,13 @@ public class OperationDao extends AbstractDao {
public void deleteAll() { public void deleteAll() {
delete("t_push_message", null, null); delete("t_push_message", null, null);
delete("r_operation_content", null, null); delete("r_operation_content", null, null);
delete("r_task_worker_group", null, null);
delete("t_operation", null, null); delete("t_operation", null, null);
delete("t_task", null, null); delete("t_task", null, null);
delete("t_task_report", null, null); delete("t_task_report", null, null);
delete("t_task_report_send", null, null); delete("t_task_report_send", null, null);
delete("t_task_report_items", null, null); delete("t_task_report_items", null, null);
delete("m_worker_group", null, null); delete("m_worker_group", null, null);
delete("r_task_worker_group", null, null);
} }
public List<OperationDto> getOperations(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String reportTypeStr) { public List<OperationDto> getOperations(String searchOperationName, String searchStartDateStr, String searchEndDateStr, String reportTypeStr) {
......
...@@ -60,6 +60,16 @@ public class TaskReportDao extends AbstractDao { ...@@ -60,6 +60,16 @@ public class TaskReportDao extends AbstractDao {
if (column != -1) { if (column != -1) {
dto.reportedFlag = toBool(cursor.getInt(column)); dto.reportedFlag = toBool(cursor.getInt(column));
} }
column = cursor.getColumnIndex("enable_report");
if (column != -1) {
dto.enableReport = cursor.getInt(column);
}
column = cursor.getColumnIndex("task_report_level");
if (column != -1) {
dto.taskReportLevel = cursor.getInt(column);
}
return dto; return dto;
} }
...@@ -76,12 +86,20 @@ public class TaskReportDao extends AbstractDao { ...@@ -76,12 +86,20 @@ public class TaskReportDao extends AbstractDao {
+ "task_report_info_id, " + "task_report_info_id, "
+ "report_start_date, " + "report_start_date, "
+ "report_end_date, " + "report_end_date, "
+ "reported_flg) " + "enable_report, "
+ "reported_flg, "
+ "task_report_level) "
+ "values " + "values "
+ "(?,?,?,?,?,?,?,?,?,?,?)", + "(?,?,?,?,?,?,?,?,?,?,?,?,?)",
dto.getInsertValues()); dto.getInsertValues());
} }
/**
* 作業IDで報告取得
* (作業報告タイプ 昇順、作業報告ID 昇順、報告開始日 昇順)
* @param operationId
* @return
*/
public List<TaskReportDto> getTaskReportByOperationId(Long operationId) { public List<TaskReportDto> getTaskReportByOperationId(Long operationId) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(" select ttr.* "); sb.append(" select ttr.* ");
...@@ -91,7 +109,7 @@ public class TaskReportDao extends AbstractDao { ...@@ -91,7 +109,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"); sb.append(" ORDER BY task_report_level ASC, 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);
} }
...@@ -127,8 +145,10 @@ public class TaskReportDao extends AbstractDao { ...@@ -127,8 +145,10 @@ public class TaskReportDao extends AbstractDao {
+ "task_report_info_id=?, " + "task_report_info_id=?, "
+ "report_start_date=?, " + "report_start_date=?, "
+ "report_end_date=?, " + "report_end_date=?, "
+ "reported_flg=? " + "enable_report=?, "
+ "where task_key=?", + "reported_flg=?, "
+ "task_report_level=? "
+ "where task_key=? AND task_report_level=?",
dto.getUpdateValues()); dto.getUpdateValues());
return count > 0; return count > 0;
} }
...@@ -189,7 +209,7 @@ public class TaskReportDao extends AbstractDao { ...@@ -189,7 +209,7 @@ public class TaskReportDao extends AbstractDao {
} }
public List<TaskReportDto> selectByTaskKey(String taskKey, int taskReportLevel) { public List<TaskReportDto> selectByTaskKey(String taskKey, int taskReportLevel) {
return rawQueryGetDtoList("select * from t_task_report where task_key=? and task_report_level", new String[]{ "" + taskKey, "" + taskReportLevel }, TaskReportDto.class); return rawQueryGetDtoList("select * from t_task_report where task_key=? and task_report_level=?", new String[]{ "" + taskKey, "" + taskReportLevel }, TaskReportDto.class);
} }
public List<TaskReportDto> selectAll() { public List<TaskReportDto> selectAll() {
...@@ -227,6 +247,14 @@ public class TaskReportDao extends AbstractDao { ...@@ -227,6 +247,14 @@ public class TaskReportDao extends AbstractDao {
} }
/** /**
* テーブル物理削除
* @param dto
*/
public void delete(TaskReportDto dto) {
delete("t_task_report", "task_key=? and task_report_level=?", new String[] { dto.taskKey, "" + dto.taskReportLevel });
}
/**
* テーブル物理削除(定期点検専用) * テーブル物理削除(定期点検専用)
* @param dto * @param dto
*/ */
......
...@@ -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.task_report_level DESC "); sql.append(" ORDER BY rtwg.task_report_level ASC ");
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);
} }
......
...@@ -29,12 +29,12 @@ public class TaskReportDto extends AbstractDto { ...@@ -29,12 +29,12 @@ public class TaskReportDto extends AbstractDto {
@Override @Override
public Object[] getInsertValues() { public Object[] getInsertValues() {
return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskReportId, taskReportInfoId, reportStartDate, reportEndDate, reportedFlag}; return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskReportId, taskReportInfoId, reportStartDate, reportEndDate, enableReport, reportedFlag, taskReportLevel};
} }
@Override @Override
public Object[] getUpdateValues() { public Object[] getUpdateValues() {
return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskReportId, taskReportInfoId, reportStartDate, reportEndDate, reportedFlag, taskKey }; return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskReportId, taskReportInfoId, reportStartDate, reportEndDate, enableReport, reportedFlag, taskReportLevel, taskKey, taskReportLevel };
} }
@Override @Override
......
...@@ -77,6 +77,8 @@ public class OperationLogic extends AbstractLogic { ...@@ -77,6 +77,8 @@ public class OperationLogic extends AbstractLogic {
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);
private ContentLogic mContentLogic = AbstractLogic.getLogic(ContentLogic.class);
private PushMessageDao mPushMessageDao = AbstractDao.getDao(PushMessageDao.class); private PushMessageDao mPushMessageDao = AbstractDao.getDao(PushMessageDao.class);
private TaskWorkerGroupDao mTaskWorkerGroupDao = AbstractDao.getDao(TaskWorkerGroupDao.class); private TaskWorkerGroupDao mTaskWorkerGroupDao = AbstractDao.getDao(TaskWorkerGroupDao.class);
...@@ -196,12 +198,21 @@ public class OperationLogic extends AbstractLogic { ...@@ -196,12 +198,21 @@ public class OperationLogic extends AbstractLogic {
// サーバーから取得したプロジェクト情報がローカルに存在しないので削除する // サーバーから取得したプロジェクト情報がローカルに存在しないので削除する
for (OperationDto deleteOperationDto : deleteListDtoArray) { for (OperationDto deleteOperationDto : deleteListDtoArray) {
List<TaskDto> taskDtoList = mTaskDao.selectAllTaskByOperationId(deleteOperationDto.operationId); List<TaskDto> taskDtoList = mTaskDao.selectAllTaskByOperationId(deleteOperationDto.operationId);
List<Long> contentIds = mOperationContentDao.getContentIds(deleteOperationDto.operationId);
for(TaskDto taskDto : taskDtoList) { for(TaskDto taskDto : taskDtoList) {
mTaskDao.delete(taskDto); mTaskDao.delete(taskDto);
} }
mPushMessageDao.delete(deleteOperationDto.operationId); mPushMessageDao.delete(deleteOperationDto.operationId);
mOperationDao.delete(deleteOperationDto); mOperationDao.delete(deleteOperationDto);
// 作業削除時、紐づいた資料を削除
for (Long contentId : contentIds) {
if (mOperationContentDao.isDeleteContent(contentId)) {
ContentDto contentDto = mContentDao.getContent(contentId);
mContentLogic.deleteContent(contentDto, true);
}
}
String operationTaskDirPath = ABVEnvironment.getInstance().getOperationDirFile(deleteOperationDto.operationId); String operationTaskDirPath = ABVEnvironment.getInstance().getOperationDirFile(deleteOperationDto.operationId);
FileUtil.delete(operationTaskDirPath); FileUtil.delete(operationTaskDirPath);
} }
...@@ -244,7 +255,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -244,7 +255,7 @@ public class OperationLogic extends AbstractLogic {
* @param dataSendFlg * @param dataSendFlg
* @throws IOException * @throws IOException
*/ */
public void insertTaskReport(String taskKey, long operationId, long contentId, JSONObject taskDirectionsJson, String hotSpotInfo, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg) throws IOException { public void insertTaskReport(String taskKey, long operationId, long contentId, int enableReport, JSONObject taskDirectionsJson, String hotSpotInfo, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg) throws IOException {
TaskDto taskDto = new TaskDto(); TaskDto taskDto = new TaskDto();
TaskReportDto taskReportDto = new TaskReportDto(); TaskReportDto taskReportDto = new TaskReportDto();
...@@ -278,6 +289,8 @@ public class OperationLogic extends AbstractLogic { ...@@ -278,6 +289,8 @@ public class OperationLogic extends AbstractLogic {
taskReportDto.attachedFileSendFlg = attachedChangeFlag; taskReportDto.attachedFileSendFlg = attachedChangeFlag;
// 作業報告 // 作業報告
taskReportDto.taskReportLevel = Constant.TaskReportLevel.ReportType; taskReportDto.taskReportLevel = Constant.TaskReportLevel.ReportType;
// 報告可能区分
taskReportDto.enableReport = enableReport;
if (localAttachedFileName != null) { if (localAttachedFileName != null) {
taskReportDto.localAttachedFileName = localAttachedFileName; taskReportDto.localAttachedFileName = localAttachedFileName;
} }
...@@ -318,7 +331,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -318,7 +331,7 @@ public class OperationLogic extends AbstractLogic {
* @param dataSendFlg * @param dataSendFlg
* @throws IOException * @throws IOException
*/ */
public void updateTaskReport(String taskKey, long operationId, long contentId, JSONObject taskReportJson, String hotSpotInfo, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg) throws IOException { public void updateTaskReport(String taskKey, long operationId, long contentId, int enableReport, JSONObject taskReportJson, String hotSpotInfo, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg) throws IOException {
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey); TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
if (taskDto == null) { if (taskDto == null) {
// ignore // ignore
...@@ -351,7 +364,10 @@ public class OperationLogic extends AbstractLogic { ...@@ -351,7 +364,10 @@ public class OperationLogic extends AbstractLogic {
} }
taskReportDto.jsonData = taskReportJson.toString(); taskReportDto.jsonData = taskReportJson.toString();
taskReportDto.dataSendFlg = dataSendFlg; taskReportDto.dataSendFlg = dataSendFlg;
// 作業報告階層
taskReportDto.taskReportLevel = Constant.TaskReportLevel.ReportType; taskReportDto.taskReportLevel = Constant.TaskReportLevel.ReportType;
// 報告可能区分
taskReportDto.enableReport = enableReport;
// attachedFileSendFlgがtrueの場合は、更新しない // attachedFileSendFlgがtrueの場合は、更新しない
if (!taskReportDto.attachedFileSendFlg) { if (!taskReportDto.attachedFileSendFlg) {
...@@ -389,7 +405,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -389,7 +405,7 @@ public class OperationLogic extends AbstractLogic {
} }
/** /**
* 作業指示の削除 * 作業報告の削除
* *
* @param operationId * @param operationId
* @param contentId * @param contentId
...@@ -423,36 +439,43 @@ public class OperationLogic extends AbstractLogic { ...@@ -423,36 +439,43 @@ public class OperationLogic extends AbstractLogic {
* @param dataSendFlg * @param dataSendFlg
* @throws IOException * @throws IOException
*/ */
public void insertTaskReportReply(String taskKey, long operationId, long contentId, JSONObject taskReportJson, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg) throws IOException { public void insertTaskReportReply(String taskKey, long operationId, long contentId, int enableReport, JSONObject taskReportJson, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg) throws IOException {
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey); TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
if (taskDto == null) { if (taskDto == null) {
//TODO error //TODO error
return; return;
} }
TaskReportDto taskReportDto = new TaskReportDto(); TaskReportDto taskReportDto = new TaskReportDto();
JSONObject taskJson = taskReportJson.getJSONObject("task"); // taskReportJsonがnullではない場合のみ以下の処理を行う
if (taskReportJson != null) {
JSONObject taskJson = taskReportJson.getJSONObject("task");
Iterator taskKeys = taskJson.keys(); Iterator taskKeys = taskJson.keys();
while (taskKeys.hasNext()) { while (taskKeys.hasNext()) {
TaskReportItemsDto taskReportItemsDto = new TaskReportItemsDto(); TaskReportItemsDto taskReportItemsDto = new TaskReportItemsDto();
String itemKey = (String) taskKeys.next(); String itemKey = (String) taskKeys.next();
if (itemKey.startsWith("q_3_")) { if (itemKey.startsWith("q_3_")) {
taskDto.taskStatus = taskJson.getInt(itemKey); taskDto.taskStatus = taskJson.getInt(itemKey);
} }
taskReportItemsDto.taskKey = taskKey; taskReportItemsDto.taskKey = taskKey;
taskReportItemsDto.itemKey = itemKey; taskReportItemsDto.itemKey = itemKey;
try { try {
taskReportItemsDto.inputValue = taskJson.getString(itemKey); taskReportItemsDto.inputValue = taskJson.getString(itemKey);
} catch (JSONException e) { } catch (JSONException e) {
// 値がStringではない場合、無視する // 値がStringではない場合、無視する
continue; continue;
}
mTaskReportItemsDao.insertTaskReportItems(taskReportItemsDto);
} }
mTaskReportItemsDao.insertTaskReportItems(taskReportItemsDto); taskReportDto.jsonData = taskReportJson.toString();
} else {
taskReportDto.jsonData = "";
} }
taskReportDto.taskKey = taskKey; taskReportDto.taskKey = taskKey;
taskReportDto.jsonData = taskReportJson.toString();
taskReportDto.dataSendFlg = dataSendFlg; taskReportDto.dataSendFlg = dataSendFlg;
taskReportDto.attachedFileSendFlg = attachedChangeFlag; taskReportDto.attachedFileSendFlg = attachedChangeFlag;
taskReportDto.taskReportLevel = Constant.TaskReportLevel.ReportReplyType;
taskReportDto.enableReport = enableReport;
// 削除の時、deleteではなく、jsonDataを空にして、データが残っているので、updateする // 削除の時、deleteではなく、jsonDataを空にして、データが残っているので、updateする
List<TaskReportDto> taskReport = mTaskReportDao.selectByTaskKey(taskReportDto.taskKey, Constant.TaskReportLevel.ReportReplyType); List<TaskReportDto> taskReport = mTaskReportDao.selectByTaskKey(taskReportDto.taskKey, Constant.TaskReportLevel.ReportReplyType);
...@@ -464,21 +487,21 @@ public class OperationLogic extends AbstractLogic { ...@@ -464,21 +487,21 @@ public class OperationLogic extends AbstractLogic {
mTaskDao.update(taskDto); mTaskDao.update(taskDto);
//添付ファイル変更の場合、以下の処理を行う if (taskReportJson != null) {
String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey); //添付ファイル変更の場合、以下の処理を行う
// #32926 作業報告画面改善 start String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey);
String operationDrectionOrReportDirPath = ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, Constant.TaskReportLevel.ReportReplyType); String operationDrectionOrReportDirPath = ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, Constant.TaskReportLevel.ReportReplyType);
// #32926 作業報告画面改善 end
JSONObject attachedListJson = taskReportJson.getJSONObject("attached"); JSONObject attachedListJson = taskReportJson.getJSONObject("attached");
List<String> attachedFileNames = JSONObject.getValues(attachedListJson); List<String> attachedFileNames = JSONObject.getValues(attachedListJson);
// コピー元のファイルで、添付ファイルとして使用しないファイル削除 // コピー元のファイルで、添付ファイルとして使用しないファイル削除
deleteDifferentialFile(tempDirPath, attachedFileNames); deleteDifferentialFile(tempDirPath, attachedFileNames);
// 添付ディレクトリの移動 // 添付ディレクトリの移動
boolean result = FileUtil.copy(tempDirPath, operationDrectionOrReportDirPath, true); boolean result = FileUtil.copy(tempDirPath, operationDrectionOrReportDirPath, true);
if(result) { if (result) {
FileUtil.delete(tempDirPath); FileUtil.delete(tempDirPath);
}
} }
} }
...@@ -534,12 +557,12 @@ public class OperationLogic extends AbstractLogic { ...@@ -534,12 +557,12 @@ public class OperationLogic extends AbstractLogic {
} }
} }
public void updateTaskReportReplyLevel(String taskKey, long operationId, long contentId, JSONObject taskReport, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg) throws IOException { public void updateTaskReportReply(String taskKey, long operationId, long contentId, int enableReport, JSONObject taskReport, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg) throws IOException {
TaskReportDto taskReportDto = mTaskReportDao.getTaskReport(taskKey, Constant.TaskReportLevel.ReportReplyType); TaskReportDto taskReportDto = mTaskReportDao.getTaskReport(taskKey, Constant.TaskReportLevel.ReportReplyType);
if (taskReportDto == null) { if (taskReportDto == null) {
Logger.w(TAG, "taskReportDto is null"); Logger.w(TAG, "taskReportDto is null");
// #32926 作業報告画面改善 start // #32926 作業報告画面改善 start
insertTaskReportReply(taskKey, operationId, contentId, taskReport, localAttachedFileName, attachedChangeFlag, dataSendFlg); insertTaskReportReply(taskKey, operationId, contentId, enableReport, taskReport, localAttachedFileName, attachedChangeFlag, dataSendFlg);
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
return; return;
} }
...@@ -570,6 +593,11 @@ public class OperationLogic extends AbstractLogic { ...@@ -570,6 +593,11 @@ public class OperationLogic extends AbstractLogic {
taskReportDto.attachedFileSendFlg = attachedChangeFlag; taskReportDto.attachedFileSendFlg = attachedChangeFlag;
} }
// 作業報告階層
taskReportDto.taskReportLevel = Constant.TaskReportLevel.ReportReplyType;
// 報告可能区分
taskReportDto.enableReport = enableReport;
mTaskReportDao.update(taskReportDto); mTaskReportDao.update(taskReportDto);
mTaskDao.update(taskDto); mTaskDao.update(taskDto);
String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey); String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey);
...@@ -786,11 +814,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -786,11 +814,7 @@ public class OperationLogic extends AbstractLogic {
} }
// 作業報告のディレクトリ削除 // 作業報告のディレクトリ削除
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey)); deleteTaskReportReplyFileData(operationId, contentId, taskKey);
// #32926 作業報告画面改善 start
FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, Constant.TaskReportLevel.ReportReplyType));
// #32926 作業報告画面改善 end
} }
/** /**
...@@ -897,12 +921,12 @@ public class OperationLogic extends AbstractLogic { ...@@ -897,12 +921,12 @@ public class OperationLogic extends AbstractLogic {
*/ */
public void createJsonForOperationContent(Long operationId, String contentPath, boolean routineTaskReportFlg) throws IOException { public void createJsonForOperationContent(Long operationId, String contentPath, boolean routineTaskReportFlg) throws IOException {
try { try {
createTaskReportJson(operationId, contentPath); if (routineTaskReportFlg) {
// if (routineTaskReportFlg) { // 定期点検
// createRoutineTaskReportJson(operationId, contentPath); createRoutineTaskReportJson(operationId, contentPath);
// } else { } else {
// createTaskReportJson(operationId, contentPath); createTaskReportJson(operationId, contentPath);
// } }
createTaskReportSuggestJson(operationId, contentPath); createTaskReportSuggestJson(operationId, contentPath);
createHopSpotJson(operationId, contentPath); createHopSpotJson(operationId, contentPath);
} catch (IOException e) { } catch (IOException e) {
...@@ -967,30 +991,31 @@ public class OperationLogic extends AbstractLogic { ...@@ -967,30 +991,31 @@ public class OperationLogic extends AbstractLogic {
* @param contentPath * @param contentPath
* @throws IOException * @throws IOException
*/ */
// #32926 作業報告画面改善 start
// 現在作業タイプを確認用のparameter追加 // 現在作業タイプを確認用のparameter追加
private void createWorkerGroupJson(Long operationId, String contentPath) throws IOException { private void createWorkerGroupJson(Long operationId, String contentPath) throws IOException {
// #32926 作業報告画面改善 end
int level = 0; int level = 0;
int listCount = 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」で形式で作成 // 報告と報告(回答)のデータの区分が必要なので、「taskGroup_0」と「taskGroup_1」で形式で作成
for (TaskWorkerGroupDto dto : taskWorkerGroupDtoList) { for (TaskWorkerGroupDto dto : taskWorkerGroupDtoList) {
listCount++; listCount++; // 最後のインデックスの判定のため
JSONObject workerGroupJson = new JSONObject(); if (level != dto.taskReportLevel) {
if (level == dto.taskReportLevel) { taskGroupJson.put(String.format("taskReport_%s", String.valueOf(level)), workerGroupJsonList);
workerGroupJson.put(ABookKeys.GROUP_ID, dto.groupId); workerGroupJsonList = new ArrayList<JSONObject>();
workerGroupJson.put(ABookKeys.GROUP_NAME, dto.groupName);
workerGroupJsonList.add(workerGroupJson);
} else {
level++; level++;
} }
if (level != dto.taskReportLevel || taskWorkerGroupDtoList.size() == listCount) { JSONObject workerGroupJson = new JSONObject();
taskGroupJson.put(String.format("taskGroup_%s", String.valueOf(dto.taskReportLevel)), workerGroupJsonList); workerGroupJson.put(ABookKeys.GROUP_ID, dto.groupId);
workerGroupJsonList = new ArrayList<JSONObject>(); workerGroupJson.put(ABookKeys.GROUP_NAME, dto.groupName);
workerGroupJsonList.add(workerGroupJson);
// 最後の時、taskReport_{level}でセット
if (listCount == taskWorkerGroupDtoList.size()) {
taskGroupJson.put(String.format("taskGroup_%s", String.valueOf(level)), workerGroupJsonList);
} }
} }
...@@ -1022,7 +1047,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1022,7 +1047,7 @@ public class OperationLogic extends AbstractLogic {
} }
/** /**
* 作業指示、作業報告用のjsonファイル * 作業報告用のjsonファイル
* 報告と報告(回答)のデータの区分が必要なので、「taskReport_0」と「taskReport_1」で形式で作成 * 報告と報告(回答)のデータの区分が必要なので、「taskReport_0」と「taskReport_1」で形式で作成
* 報告(回答)の場合はtaskReport_1を作成 * 報告(回答)の場合はtaskReport_1を作成
* *
...@@ -1034,19 +1059,39 @@ public class OperationLogic extends AbstractLogic { ...@@ -1034,19 +1059,39 @@ public class OperationLogic extends AbstractLogic {
List<JSONObject> taskReportJsonList = new ArrayList<JSONObject>(); List<JSONObject> taskReportJsonList = new ArrayList<JSONObject>();
JSONObject taskReportJson = new JSONObject(); JSONObject taskReportJson = new JSONObject();
List<TaskReportDto> taskReportDtoList = mTaskReportDao.getTaskReportByOperationId(operationId); List<TaskReportDto> taskReportDtoList = mTaskReportDao.getTaskReportByOperationId(operationId);
// #32926 作業報告画面改善 start
int taskReportLevel = 0; int level = 0;
int listCount = 0;
for (TaskReportDto dto : taskReportDtoList) { for (TaskReportDto dto : taskReportDtoList) {
taskReportLevel = dto.taskReportLevel; listCount++; // 最後のインデックスの判定のため
if (level != dto.taskReportLevel) {
taskReportJson.put(String.format("taskReport_%s", String.valueOf(level)), taskReportJsonList);
taskReportJsonList = new ArrayList<JSONObject>();
level++;
}
if(dto.jsonData != null && dto.jsonData.length() > 0) { if(dto.jsonData != null && dto.jsonData.length() > 0) {
taskReportJsonList.add(new JSONObject(dto.jsonData).put(ABookKeys.HAS_AUTHORITY, dto.enableReport)); taskReportJsonList.add(new JSONObject(dto.jsonData).put(ABookKeys.HAS_AUTHORITY, dto.enableReport));
} else {
JSONObject emptyTaskReportJson = new JSONObject();
emptyTaskReportJson.put(ABookKeys.TASK_KEY, dto.taskKey);
emptyTaskReportJson.put(ABookKeys.HAS_AUTHORITY, dto.enableReport);
taskReportJsonList.add(emptyTaskReportJson);
}
// 最後の時、taskReport_{level}でセット
if (listCount == taskReportDtoList.size()) {
taskReportJson.put(String.format("taskReport_%s", String.valueOf(level)), taskReportJsonList);
} }
} }
taskReportJson.put(String.format("taskReport_%d", taskReportLevel), taskReportJsonList);
// データが存在しない場合、
if (taskReportDtoList.size() <= 0) {
taskReportJson.put("taskReport_0", taskReportJsonList);
}
Logger.d(TAG, "createTaskReportJson : " + taskReportJson.toString()); Logger.d(TAG, "createTaskReportJson : " + taskReportJson.toString());
Logger.d(TAG,contentPath + "/" + ABookKeys.TASK_REPORT + ".json"); Logger.d(TAG,contentPath + "/" + ABookKeys.TASK_REPORT + ".json");
// #32926 作業報告画面改善 end
FileUtil.createFile(contentPath + "/" + ABookKeys.TASK_REPORT + ".json", taskReportJson.toString()); FileUtil.createFile(contentPath + "/" + ABookKeys.TASK_REPORT + ".json", taskReportJson.toString());
} }
...@@ -1055,7 +1100,6 @@ public class OperationLogic extends AbstractLogic { ...@@ -1055,7 +1100,6 @@ public class OperationLogic extends AbstractLogic {
List<JSONObject> taskReportJsonList = new ArrayList<JSONObject>(); List<JSONObject> taskReportJsonList = new ArrayList<JSONObject>();
JSONObject taskReportJsonRoot = new JSONObject(); JSONObject taskReportJsonRoot = new JSONObject();
JSONObject taskReportJsonRow; JSONObject taskReportJsonRow;
// #32926 作業報告画面改善 start
int taskReportLevel = 0; int taskReportLevel = 0;
int taskReportId = 0; int taskReportId = 0;
List<TaskReportDto> routineTaskReportDtoList = mTaskReportDao.getTaskReportByOperationId(operationId); List<TaskReportDto> routineTaskReportDtoList = mTaskReportDao.getTaskReportByOperationId(operationId);
...@@ -1071,7 +1115,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1071,7 +1115,7 @@ public class OperationLogic extends AbstractLogic {
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).put(ABookKeys.HAS_AUTHORITY, dto.enableReport));
} }
taskReportJsonRow.put(ABookKeys.TASK_REPORT_INFO, taskReportInfoList); taskReportJsonRow.put(ABookKeys.TASK_REPORT_INFO, taskReportInfoList);
taskReportJsonList.add(taskReportJsonRow); taskReportJsonList.add(taskReportJsonRow);
...@@ -1081,7 +1125,6 @@ public class OperationLogic extends AbstractLogic { ...@@ -1081,7 +1125,6 @@ public class OperationLogic extends AbstractLogic {
taskReportJsonRoot.put(String.format("taskReport_%d", taskReportLevel), taskReportJsonList); taskReportJsonRoot.put(String.format("taskReport_%d", taskReportLevel), taskReportJsonList);
Logger.d(TAG, "createRoutineTaskReportJson : " + taskReportJsonRoot.toString()); Logger.d(TAG, "createRoutineTaskReportJson : " + taskReportJsonRoot.toString());
Logger.d(TAG,contentPath + "/" + ABookKeys.TASK_REPORT + ".json"); Logger.d(TAG,contentPath + "/" + ABookKeys.TASK_REPORT + ".json");
// #32926 作業報告画面改善 end
FileUtil.createFile(contentPath + "/" + ABookKeys.TASK_REPORT + ".json", taskReportJsonRoot.toString()); FileUtil.createFile(contentPath + "/" + ABookKeys.TASK_REPORT + ".json", taskReportJsonRoot.toString());
} }
...@@ -1337,7 +1380,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1337,7 +1380,7 @@ public class OperationLogic extends AbstractLogic {
// 定期点検 // 定期点検
FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, taskReportSendDto.taskReportId, strReportStartDate, taskReportSendDto.taskReportSendId)); FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, taskReportSendDto.taskReportId, strReportStartDate, taskReportSendDto.taskReportSendId));
} else { } else {
FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey,taskReportLevel, taskReportSendDto.taskReportSendId)); FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, taskReportDto.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) {
...@@ -1345,6 +1388,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1345,6 +1388,7 @@ public class OperationLogic extends AbstractLogic {
FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, taskReportSendDto.taskReportId, strReportStartDate, taskReportSendDto.taskReportSendId)); FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, taskReportSendDto.taskReportId, strReportStartDate, taskReportSendDto.taskReportSendId));
return true; return true;
} }
throw ex;
} catch (Exception ex) { } catch (Exception ex) {
throw ex; throw ex;
} finally { } finally {
...@@ -1375,8 +1419,19 @@ public class OperationLogic extends AbstractLogic { ...@@ -1375,8 +1419,19 @@ public class OperationLogic extends AbstractLogic {
* @param taskKey * @param taskKey
*/ */
public void deleteTaskFileData(long operationId, long contentId, String taskKey) { public void deleteTaskFileData(long operationId, long contentId, String taskKey) {
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskDirFilePath(operationId, taskKey)); FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskDirFilePath(operationId, taskKey));
}
/**
* 作業報告(回答)関連ディレクトリ削除
* @param operationId
* @param contentId
* @param taskKey
*/
public void deleteTaskReportReplyFileData(long operationId, long contentId, String taskKey) {
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey)); FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, Constant.TaskReportLevel.ReportReplyType));
} }
/** /**
......
...@@ -74,8 +74,8 @@ ...@@ -74,8 +74,8 @@
</string-array> </string-array>
<string-array name="operation_report_types"> <string-array name="operation_report_types">
<item>タイプ1</item> <item>報告</item>
<item>タイプ2</item> <item>定期点検</item>
<item>タイプ3</item> <item>報告(回答)</item>
</string-array> </string-array>
</resources> </resources>
\ No newline at end of file
...@@ -107,7 +107,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -107,7 +107,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
public Long mOperationId; public Long mOperationId;
protected int mXWalkOpenType = -1; protected int mXWalkOpenType = -1;
protected int mOperationType; protected int mOperationType;
protected int enableReportHistory; //0:履歴無し 1:履歴可 protected int mEnableReportHistory; //0:履歴無し 1:履歴可
// 報告可能区分
protected int mEnableReportEdit; //0:報告無し 1:報告可
protected String mContentPath; protected String mContentPath;
protected int mStatusCode; protected int mStatusCode;
protected boolean isOperationPdf = false; protected boolean isOperationPdf = false;
...@@ -154,8 +156,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -154,8 +156,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
if (!isLinkedContent) { if (!isLinkedContent) {
operationDto = AbstractLogic.getLogic(OperationLogic.class).getOperation(mOperationId); operationDto = AbstractLogic.getLogic(OperationLogic.class).getOperation(mOperationId);
mXWalkOpenType = intent.getIntExtra(Constant.ABookCheck.XWALK_OPEN_TYPE, Constant.XWalkOpenType.DEFAULT); mXWalkOpenType = intent.getIntExtra(Constant.ABookCheck.XWALK_OPEN_TYPE, Constant.XWalkOpenType.DEFAULT);
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION || mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) { if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) { if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
mOperationType = operationDto.operationType; mOperationType = operationDto.operationType;
if (mOperationType != OperationType.PDF && isNormalSize()) { if (mOperationType != OperationType.PDF && isNormalSize()) {
// 縦画面固定 // 縦画面固定
...@@ -171,8 +173,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -171,8 +173,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}).start(); }).start();
mStatusCode = 0; mStatusCode = 0;
} }
mEnableReportEdit = operationDto.enableReportEdit;
enableReportHistory = operationDto.enableReportHistory; mEnableReportHistory = operationDto.enableReportHistory;
linkUrl = intent.getStringExtra("LINKURL"); // LinkURL linkUrl = intent.getStringExtra("LINKURL"); // LinkURL
...@@ -646,8 +648,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -646,8 +648,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
protected void createCheckToolbar() { protected void createCheckToolbar() {
final RelativeLayout fl; final RelativeLayout fl;
if (operationDto != null && operationDto.operationType == OperationType.PDF && if (operationDto != null && operationDto.operationType == OperationType.PDF && mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
(mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION || mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT)) {
fl = (RelativeLayout) findViewById(R.id.RelativeLayout2); fl = (RelativeLayout) findViewById(R.id.RelativeLayout2);
} else { } else {
fl = (RelativeLayout) findViewById(R.id.frameTopbar); fl = (RelativeLayout) findViewById(R.id.frameTopbar);
...@@ -689,8 +690,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -689,8 +690,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
}); });
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION || mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) { if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) { if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
if (mOperationType != OperationType.PDF && isNormalSize()) { if (mOperationType != OperationType.PDF && isNormalSize()) {
// 縦画面固定 // 縦画面固定
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
...@@ -923,7 +924,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -923,7 +924,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}; };
ABookCheckWebViewHelper.getInstance().doABookCheckParam(ABVContentViewActivity.this, ABookCheckWebViewHelper.getInstance().doABookCheckParam(ABVContentViewActivity.this,
mCmd, mTaskKey, enableReportHistory, abookCheckParam, mOperationId, mContentPath, getContentId(), mCmd, mTaskKey, mEnableReportHistory, abookCheckParam, mOperationId, mContentPath, getContentId(),
operationDto.reportType, finishCallback, operationDto.reportType, finishCallback,
taskReportLevel); taskReportLevel);
...@@ -1181,8 +1182,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1181,8 +1182,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
return isOperationPdf; return isOperationPdf;
} }
public boolean isDirector() { /**
return mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION; * 報告可能フラグ
* @return
*/
public boolean isReportEdit() {
return mEnableReportEdit == Constant.EnableReportEdit.YES;
} }
/** /**
......
...@@ -77,7 +77,6 @@ import jp.agentec.abook.abv.bl.download.ContentFileExtractor; ...@@ -77,7 +77,6 @@ import jp.agentec.abook.abv.bl.download.ContentFileExtractor;
import jp.agentec.abook.abv.bl.download.ContentZipDownloadNotification; import jp.agentec.abook.abv.bl.download.ContentZipDownloadNotification;
import jp.agentec.abook.abv.bl.dto.ContentDto; import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.FixPushMessageDto; import jp.agentec.abook.abv.bl.dto.FixPushMessageDto;
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;
...@@ -829,6 +828,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -829,6 +828,7 @@ 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);
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);
...@@ -839,26 +839,35 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -839,26 +839,35 @@ public class OperationListActivity extends ABVUIActivity {
progress = 40 / json.taskDtoList.size(); progress = 40 / json.taskDtoList.size();
} }
boolean isRoutineTask = operationDto.reportType == Constant.ReportType.Routine;
JSONObject taskReportJson; JSONObject taskReportJson;
for (TaskDto serverTaskDto : json.taskDtoList) { for (TaskDto serverTaskDto : json.taskDtoList) {
if (operationDto.reportType == Constant.ReportType.Routine) {
if (isExistsTaskInList(localTaskList, serverTaskDto)) {
mTaskDao.update(serverTaskDto);
} else {
mTaskDao.insert(serverTaskDto);
}
List<TaskReportDto> localTaskReportList = mTaskReportDao.getNotNullStartDateTaskReportByTaskKey(serverTaskDto.taskKey);
List<TaskReportDto> localRemove = new ArrayList(); List<TaskReportDto> localRemove = new ArrayList();
// 先にローカルにしか存在しない事を削除 : DB, files List<TaskReportDto> localTaskReportList = mTaskReportDao.getTaskReportListByTaskKey(serverTaskDto.taskKey);
for (TaskReportDto localTaskReportDto : localTaskReportList) { for (TaskReportDto localTaskReportDto : localTaskReportList) {
if (!isExistsRoutinTaskReportInList(serverTaskDto.taskReportDtoList, localTaskReportDto)) { if (!isExistsTaskReportInList(serverTaskDto.taskReportDtoList, localTaskReportDto, isRoutineTask)) {
mOperationLogic.deleteRoutineTaskReport(operationId, operationContentDto.contentId, localTaskReportDto); if (isRoutineTask) {
localRemove.add(localTaskReportDto); mOperationLogic.deleteRoutineTaskReport(operationId, operationContentDto.contentId, localTaskReportDto);
} else {
// taskDtoが存在するとtaskReportLevel 0 (作業報告)が存在しないことはないので、報告(回答)のみチェックして削除
if (localTaskReportDto.taskReportLevel == Constant.TaskReportLevel.ReportReplyType) {
// 作業報告のディレクトリ削除
mOperationLogic.deleteTaskReportReplyFileData(operationId, operationContentDto.contentId, serverTaskDto.taskKey);
mTaskReportDao.delete(localTaskReportDto);
}
}
localTaskReportList.remove(localTaskReportDto);
} }
} }
localTaskReportList.removeAll(localRemove); if (operationDto.reportType == Constant.ReportType.Routine) {
if (isExistsTaskInList(localTaskList, serverTaskDto)) {
mTaskDao.update(serverTaskDto);
} else {
mTaskDao.insert(serverTaskDto);
}
// サーバーからの情報で更新 // サーバーからの情報で更新
for (TaskReportDto taskReportDto : serverTaskDto.taskReportDtoList) { for (TaskReportDto taskReportDto : serverTaskDto.taskReportDtoList) {
...@@ -870,7 +879,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -870,7 +879,7 @@ public class OperationListActivity extends ABVUIActivity {
if (isSyncGetTaskFileError) { if (isSyncGetTaskFileError) {
return null; return null;
} }
if (isExistsRoutinTaskReportInList(localTaskReportList, taskReportDto)) { if (isExistsTaskReportInList(localTaskReportList, taskReportDto, true)) {
// 報告データが存在すると作業報告を更新する // 報告データが存在すると作業報告を更新する
if (taskReportDto.jsonData != null) { if (taskReportDto.jsonData != null) {
mOperationLogic.updateRoutineTaskReport(serverTaskDto.operationId, operationContentDto.contentId, taskReportDto, false, false, false, false); mOperationLogic.updateRoutineTaskReport(serverTaskDto.operationId, operationContentDto.contentId, taskReportDto, false, false, false, false);
...@@ -900,14 +909,19 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -900,14 +909,19 @@ public class OperationListActivity extends ABVUIActivity {
taskReportJson.put(ABookKeys.TASK_STATUS, serverTaskDto.taskStatus); taskReportJson.put(ABookKeys.TASK_STATUS, serverTaskDto.taskStatus);
// 作業報告を更新 // 作業報告を更新
// update // update
mOperationLogic.updateTaskReport(serverTaskDto.taskKey, serverTaskDto.operationId, operationContentDto.contentId, mOperationLogic.updateTaskReport(serverTaskDto.taskKey, serverTaskDto.operationId, operationContentDto.contentId, taskReportDto.enableReport,
taskReportJson, serverTaskDto.taskHotSpotInfo, attachedFileName, false, false); taskReportJson, serverTaskDto.taskHotSpotInfo, attachedFileName, false, false);
} else { } else {
// 作業報告(回答) // 作業報告(回答)
if (taskReportDto.jsonData != null) { if (taskReportDto.jsonData != null) {
mOperationLogic.updateTaskReportReplyLevel(serverTaskDto.taskKey, serverTaskDto.operationId, operationContentDto.contentId, // データの更新
mOperationLogic.updateTaskReportReply(serverTaskDto.taskKey, serverTaskDto.operationId, operationContentDto.contentId, taskReportDto.enableReport,
new JSONObject(taskReportDto.jsonData), attachedFileName, false, false); new JSONObject(taskReportDto.jsonData), attachedFileName, false, false);
} } else {
// jsonDataがない場合
mOperationLogic.insertTaskReportReply(serverTaskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId, taskReportDto.enableReport,
null, attachedFileName, false, false);
}
} }
// 更新済みの場合、localTaskListから削除 // 更新済みの場合、localTaskListから削除
localTaskList.remove(serverTaskDto); localTaskList.remove(serverTaskDto);
...@@ -928,12 +942,16 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -928,12 +942,16 @@ public class OperationListActivity extends ABVUIActivity {
taskReportJson = new JSONObject(taskReportDto.jsonData); taskReportJson = new JSONObject(taskReportDto.jsonData);
taskReportJson.put(ABookKeys.TASK_STATUS, serverTaskDto.taskStatus); taskReportJson.put(ABookKeys.TASK_STATUS, serverTaskDto.taskStatus);
mOperationLogic.insertTaskReport(serverTaskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId, mOperationLogic.insertTaskReport(serverTaskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId, taskReportDto.enableReport,
taskReportJson, serverTaskDto.taskHotSpotInfo, attachedFileName, false, false); taskReportJson, serverTaskDto.taskHotSpotInfo, attachedFileName, false, false);
} else { } else {
if (taskReportDto.jsonData != null) { if (taskReportDto.jsonData != null) {
mOperationLogic.insertTaskReportReply(serverTaskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId, mOperationLogic.insertTaskReportReply(serverTaskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId, taskReportDto.enableReport,
new JSONObject(taskReportDto.jsonData), attachedFileName, false, false); new JSONObject(taskReportDto.jsonData), attachedFileName, false, false);
} else {
// jsonDataがない場合
mOperationLogic.insertTaskReportReply(serverTaskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId, taskReportDto.enableReport,
null, attachedFileName, false, false);
} }
} }
} }
...@@ -1553,17 +1571,26 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1553,17 +1571,26 @@ public class OperationListActivity extends ABVUIActivity {
} }
/** /**
* 定期点検の報告存在チェック * 報告存在チェック
* @param listDto * @param listDto
* @param rDto * @param rDto
* @return * @return
*/ */
private boolean isExistsRoutinTaskReportInList(List<TaskReportDto> listDto, TaskReportDto rDto) { private boolean isExistsTaskReportInList(List<TaskReportDto> listDto, TaskReportDto rDto, boolean isRoutineTask) {
for (TaskReportDto lDto : listDto) { for (TaskReportDto lDto : listDto) {
if (lDto.taskKey.equals(rDto.taskKey) && if (isRoutineTask) {
lDto.taskReportId == rDto.taskReportId && // 定期点検の場合、taskKey,taskReportId,reportStartDateで判定
lDto.reportStartDate.equals(rDto.reportStartDate)) { if (lDto.taskKey.equals(rDto.taskKey) &&
return true; lDto.taskReportId == rDto.taskReportId &&
lDto.reportStartDate.equals(rDto.reportStartDate)) {
return true;
}
} else {
// taskKeyと作業報告階層で判定
if (lDto.taskKey.equals(rDto.taskKey) &&
lDto.taskReportLevel == rDto.taskReportLevel) {
return true;
}
} }
} }
return false; return false;
......
...@@ -90,37 +90,37 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -90,37 +90,37 @@ public class ABookCheckWebViewHelper extends ABookHelper {
String reportStartDate = ""; String reportStartDate = "";
boolean sendTaskReportDataFlg = false; boolean sendTaskReportDataFlg = false;
// TODO検討 if (reportType == Constant.ReportType.Routine) {
// copyTaskAttachedMovie(operationId, contentId, taskKey, String.valueOf(taskReportLevel)); taskReportId = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_ID));
if (reportType == Constant.ReportType.Routine) { reportStartDate = param.get(ABookKeys.REPORT_START_DATE).replace("T", " ");
taskReportId = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_ID)); mOperationLogic.deleteRoutineTaskReport(operationId, contentId, taskKey, taskReportId, reportStartDate);
reportStartDate = param.get(ABookKeys.REPORT_START_DATE).replace("T", " "); mOperationLogic.createJsonForOperationContent(operationId, contentPath, false);
mOperationLogic.deleteRoutineTaskReport(operationId, contentId, taskKey, taskReportId, reportStartDate); copyRoutineTaskReportAttachedMovie(operationId, contentId, taskKey, taskReportId, reportStartDate);
mOperationLogic.createJsonForOperationContent(operationId, contentPath, false); } else {
copyRoutineTaskReportAttachedMovie(operationId, contentId, taskKey, taskReportId, reportStartDate); if (taskReportLevel == Constant.TaskReportLevel.ReportType) {
mOperationLogic.deleteTaskReport(operationId, contentId, taskKey);
} else { } else {
mOperationLogic.deleteTaskReportReply(operationId, contentId, taskKey); mOperationLogic.deleteTaskReportReply(operationId, contentId, taskKey);
mOperationLogic.createJsonForOperationContent(operationId, contentPath, false);
copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel);
} }
mOperationLogic.createJsonForOperationContent(operationId, contentPath, false);
copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel);
}
if (enableReportHistory == Constant.EnableReportHistory.Invalid) { if (enableReportHistory == Constant.EnableReportHistory.Invalid) {
taskReportSendId = mOperationLogic.getLastTaskReportSendId(taskKey); taskReportSendId = mOperationLogic.getLastTaskReportSendId(taskKey);
mOperationLogic.updateTaskReportSend(taskKey, taskReportId, reportStartDate, null, true); mOperationLogic.updateTaskReportSend(taskKey, taskReportId, reportStartDate, null, true);
deleteReportTaskSendFiles(operationId, taskKey, taskReportSendId, taskReportLevel); deleteReportTaskSendFiles(operationId, taskKey, taskReportSendId, taskReportLevel);
} else if (enableReportHistory == Constant.EnableReportHistory.Enable) { } else if (enableReportHistory == Constant.EnableReportHistory.Enable) {
mOperationLogic.insertTaskReportSend(taskKey, taskReportId, reportStartDate, null, true); mOperationLogic.insertTaskReportSend(taskKey, taskReportId, reportStartDate, null, true);
} }
sendTaskData(context, operationId, taskKey, taskReportLevel); sendTaskData(context, operationId, taskKey, taskReportLevel);
break; break;
// #32782 指示者テーブル関連削除 end
case ABookKeys.CMD_MOVE_HOT_SPOT: case ABookKeys.CMD_MOVE_HOT_SPOT:
mOperationLogic.updateTaskHotspot(taskKey, param); mOperationLogic.updateTaskHotspot(taskKey, param);
mOperationLogic.createHopSpotJson(operationId, contentPath); mOperationLogic.createHopSpotJson(operationId, contentPath);
break; break;
// case ABookKeys.CMD_CANCEL_TASK_DIRECTIONS:
case ABookKeys.CMD_CANCEL_TASK_REPORT: case ABookKeys.CMD_CANCEL_TASK_REPORT:
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey)); FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
mFinishCallback.callback(false); mFinishCallback.callback(false);
...@@ -164,12 +164,11 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -164,12 +164,11 @@ public class ABookCheckWebViewHelper extends ABookHelper {
OperationDto operationDto = mOperationLogic.getOperation(operationId); OperationDto operationDto = mOperationLogic.getOperation(operationId);
boolean isError = false; boolean isError = false;
try { try {
mOperationLogic.updateSyncOperation(operationId, true);
if (mOperationLogic.sendTaskReportSendData(operationId, taskKey, taskReportLevel, progressCallback)) { if (mOperationLogic.sendTaskReportSendData(operationId, taskKey, taskReportLevel, progressCallback)) {
context.handleErrorMessageToast(R.string.P005); context.handleErrorMessageToast(R.string.P005);
} }
mOperationLogic.updateSyncOperation(operationId, true);
} catch (ABVException ex) { } catch (ABVException ex) {
Logger.e(TAG, "sendTaskData", ex); Logger.e(TAG, "sendTaskData", ex);
// if (isDirections) { // if (isDirections) {
...@@ -300,15 +299,15 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -300,15 +299,15 @@ public class ABookCheckWebViewHelper extends ABookHelper {
if (taskReportLevel == Constant.TaskReportLevel.ReportType) { if (taskReportLevel == Constant.TaskReportLevel.ReportType) {
String hotSpotInfo = param.get(ABookKeys.HOT_SPOT); String hotSpotInfo = param.get(ABookKeys.HOT_SPOT);
if (insertFlg) { if (insertFlg) {
mOperationLogic.insertTaskReport(taskKey, operationId, contentId, taskReportJson, hotSpotInfo, null, attachedChangeFlag, true); mOperationLogic.insertTaskReport(taskKey, operationId, contentId, Constant.EnableReport.YES, taskReportJson, hotSpotInfo, null, attachedChangeFlag, true);
} else { } else {
mOperationLogic.updateTaskReport(taskKey, operationId, contentId, taskReportJson, hotSpotInfo, null, attachedChangeFlag, true); mOperationLogic.updateTaskReport(taskKey, operationId, contentId, Constant.EnableReport.YES, taskReportJson, hotSpotInfo, null, attachedChangeFlag, true);
} }
} else { } else {
if (insertFlg) { if (insertFlg) {
mOperationLogic.insertTaskReportReply(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true); mOperationLogic.insertTaskReportReply(taskKey, operationId, contentId, Constant.EnableReport.YES, taskReportJson, null, attachedChangeFlag, true);
} else { } else {
mOperationLogic.updateTaskReportReplyLevel(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true); mOperationLogic.updateTaskReportReply(taskKey, operationId, contentId, Constant.EnableReport.YES, taskReportJson, null, attachedChangeFlag, true);
} }
} }
mOperationLogic.createJsonForOperationContent(operationId, contentPath, false); mOperationLogic.createJsonForOperationContent(operationId, contentPath, false);
...@@ -340,6 +339,7 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -340,6 +339,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
copyTaskAttachedMovie(operationId, contentId, taskDto.taskKey, taskReportDto.taskReportLevel); copyTaskAttachedMovie(operationId, contentId, taskDto.taskKey, taskReportDto.taskReportLevel);
} }
} }
} }
} catch (IOException e) { } catch (IOException e) {
Logger.e(TAG, "fileCopyToCacheAttachedDir error. ", e); Logger.e(TAG, "fileCopyToCacheAttachedDir error. ", e);
......
...@@ -89,7 +89,6 @@ import jp.agentec.abook.abv.bl.acms.client.json.content.PageInfoJSON; ...@@ -89,7 +89,6 @@ import jp.agentec.abook.abv.bl.acms.client.json.content.PageInfoJSON;
import jp.agentec.abook.abv.bl.acms.client.json.content.PageInfoJSON.PageInfoJSONData; import jp.agentec.abook.abv.bl.acms.client.json.content.PageInfoJSON.PageInfoJSONData;
import jp.agentec.abook.abv.bl.acms.client.json.content.PageObjectJSON; import jp.agentec.abook.abv.bl.acms.client.json.content.PageObjectJSON;
import jp.agentec.abook.abv.bl.acms.client.json.content.TaskHotspotJSON; import jp.agentec.abook.abv.bl.acms.client.json.content.TaskHotspotJSON;
import jp.agentec.abook.abv.bl.acms.type.OperationAuthLevel;
import jp.agentec.abook.abv.bl.acms.type.OperationType; import jp.agentec.abook.abv.bl.acms.type.OperationType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment; import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.CommonExecutor; import jp.agentec.abook.abv.bl.common.CommonExecutor;
...@@ -4913,7 +4912,6 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -4913,7 +4912,6 @@ public class ContentViewActivity extends ABVContentViewActivity {
} }
switch (mXWalkOpenType) { switch (mXWalkOpenType) {
case Constant.XWalkOpenType.TASK_DERECTION:
case Constant.XWalkOpenType.TASK_REPORT: case Constant.XWalkOpenType.TASK_REPORT:
if (mOperationType == OperationType.LIST) { if (mOperationType == OperationType.LIST) {
taskListButton.setVisibility(View.GONE); taskListButton.setVisibility(View.GONE);
...@@ -5041,8 +5039,8 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5041,8 +5039,8 @@ public class ContentViewActivity extends ABVContentViewActivity {
// 移動・タップの切り替えボタン // 移動・タップの切り替えボタン
btnMoveOrClickToggleIcon = (ImageButton) mScaleZoomLayout.findViewById(id.btn_move_click_toggle); btnMoveOrClickToggleIcon = (ImageButton) mScaleZoomLayout.findViewById(id.btn_move_click_toggle);
if (isDirector()) { if (isReportEdit()) {
// 指示者の場合 // 報告の場合
btnMoveOrClickToggleIcon.setVisibility(View.VISIBLE); btnMoveOrClickToggleIcon.setVisibility(View.VISIBLE);
btnMoveOrClickToggleIcon.setOnClickListener(new View.OnClickListener() { btnMoveOrClickToggleIcon.setOnClickListener(new View.OnClickListener() {
@Override @Override
...@@ -5058,7 +5056,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5058,7 +5056,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
} }
}); });
} else { } else {
// 作業者の場合 // 報告(回答)の場合
btnMoveOrClickToggleIcon.setVisibility(View.INVISIBLE); btnMoveOrClickToggleIcon.setVisibility(View.INVISIBLE);
} }
...@@ -5243,7 +5241,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5243,7 +5241,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
} }
public int getOperationReportUpdateType() { public int getOperationReportUpdateType() {
return enableReportHistory; return mEnableReportHistory;
} }
/** /**
......
...@@ -329,7 +329,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { ...@@ -329,7 +329,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
} }
}); });
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION || mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) { if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
webView.addJavascriptInterface(jsInf, "android"); webView.addJavascriptInterface(jsInf, "android");
} }
Logger.d(TAG, "loadUrl: " + url); Logger.d(TAG, "loadUrl: " + url);
......
...@@ -349,7 +349,7 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity { ...@@ -349,7 +349,7 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity {
return false; return false;
} }
}); });
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION || mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) { if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
webView.addJavascriptInterface(jsInf, "android"); webView.addJavascriptInterface(jsInf, "android");
} }
// webView.postUrl(url,EncodingUtils.getBytes("", "utf-8")); // webView.postUrl(url,EncodingUtils.getBytes("", "utf-8"));
......
...@@ -184,7 +184,6 @@ public class ParentWebViewActivity extends ABVContentViewActivity { ...@@ -184,7 +184,6 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
} }
switch (mXWalkOpenType) { switch (mXWalkOpenType) {
case Constant.XWalkOpenType.TASK_DERECTION:
case Constant.XWalkOpenType.TASK_REPORT: case Constant.XWalkOpenType.TASK_REPORT:
if (mOperationType == OperationType.LIST) { if (mOperationType == OperationType.LIST) {
taskListButton.setVisibility(View.GONE); taskListButton.setVisibility(View.GONE);
...@@ -212,7 +211,7 @@ public class ParentWebViewActivity extends ABVContentViewActivity { ...@@ -212,7 +211,7 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
@Override @Override
protected void onDestroy() { protected void onDestroy() {
Logger.d(TAG, "onDestroy"); Logger.d(TAG, "onDestroy");
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION || mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) { if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
// tempファイル削除 // tempファイル削除
FileUtil.delete(ABVEnvironment.getInstance().getTempDirPath(contentId)); FileUtil.delete(ABVEnvironment.getInstance().getTempDirPath(contentId));
FileUtil.delete(ABVEnvironment.getInstance().getAttachedMoviesFilePath(contentId)); FileUtil.delete(ABVEnvironment.getInstance().getAttachedMoviesFilePath(contentId));
......
...@@ -244,7 +244,7 @@ public class OperationTaskLayout extends RelativeLayout { ...@@ -244,7 +244,7 @@ public class OperationTaskLayout extends RelativeLayout {
taskView.setOnTouchListener(new View.OnTouchListener() { taskView.setOnTouchListener(new View.OnTouchListener() {
@Override @Override
public boolean onTouch(View view, MotionEvent event) { public boolean onTouch(View view, MotionEvent event) {
if (mContext.mMoveTaskFlg && rootLayout.isEnableOperationTaskNewOrMove()) { if (mContext.mMoveTaskFlg && mContext.isReportEdit()) {
// 指示者且つ、移動モードの場合 // 指示者且つ、移動モードの場合
if (event.getAction() == MotionEvent.ACTION_DOWN) { if (event.getAction() == MotionEvent.ACTION_DOWN) {
ClipData data = ClipData.newPlainText("", ""); ClipData data = ClipData.newPlainText("", "");
......
...@@ -924,7 +924,7 @@ public class ZoomRelativeLayout extends RelativeLayout { ...@@ -924,7 +924,7 @@ public class ZoomRelativeLayout extends RelativeLayout {
Logger.v(TAG, "[OnDoubleTapListener]:[onDoubleTap]"); Logger.v(TAG, "[OnDoubleTapListener]:[onDoubleTap]");
if (isOperationPdf && mContext instanceof ContentViewActivity) { if (isOperationPdf && mContext instanceof ContentViewActivity) {
if(((ContentViewActivity) mContext).getOpenedProjestTask() || !isEnableOperationTaskNewOrMove() || ((ContentViewActivity) mContext).mMoveTaskFlg) { if(((ContentViewActivity) mContext).getOpenedProjestTask() || !((ContentViewActivity) mContext).isReportEdit() || ((ContentViewActivity) mContext).mMoveTaskFlg) {
return true; return true;
} }
...@@ -999,10 +999,6 @@ public class ZoomRelativeLayout extends RelativeLayout { ...@@ -999,10 +999,6 @@ public class ZoomRelativeLayout extends RelativeLayout {
} }
}; };
public boolean isEnableOperationTaskNewOrMove() {
return ((ContentViewActivity)mContext).isDirector();
}
public boolean isZooming() { public boolean isZooming() {
return mScaleFactor > 1.0f; return mScaleFactor > 1.0f;
} }
......
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