Commit b365f57a by Jeong Gilmo

#32782 指示者テーブル関連削除

parent fc9484dd
...@@ -28,9 +28,15 @@ public class OperationDataJSON extends AcmsCommonJSON { ...@@ -28,9 +28,15 @@ public class OperationDataJSON extends AcmsCommonJSON {
public static final String TaskCode = "taskCode"; public static final String TaskCode = "taskCode";
public static final String TaskStatus = "taskStatus"; public static final String TaskStatus = "taskStatus";
public static final String TaskHotspotInfo = "taskHotspotInfo"; public static final String TaskHotspotInfo = "taskHotspotInfo";
public static final String TaskDirectionsInfo = "taskDirectionsInfo"; // #32782 指示者テーブル関連削除 start
// TODO Delete TaskDirections
public static final String TaskDirectionsInfo = "taskReportInfo";
// #32782 指示者テーブル関連削除 end
public static final String TaskReportInfo = "taskReportInfo"; public static final String TaskReportInfo = "taskReportInfo";
public static final String TaskDirectionsKey = "taskDirectionsKey"; // #32782 指示者テーブル関連削除 start
// TODO Delete TaskDirections
public static final String TaskDirectionsKey = "taskReportKey";
// #32782 指示者テーブル関連削除 end
public static final String TaskReportKey = "taskReportKey"; public static final String TaskReportKey = "taskReportKey";
public static final String Task = "task"; public static final String Task = "task";
...@@ -50,10 +56,9 @@ public class OperationDataJSON extends AcmsCommonJSON { ...@@ -50,10 +56,9 @@ public class OperationDataJSON extends AcmsCommonJSON {
for (int i = 0; i < taskList.length(); i++) { for (int i = 0; i < taskList.length(); i++) {
JSONObject taskJson = taskList.getJSONObject(i); JSONObject taskJson = taskList.getJSONObject(i);
TaskDto dto = new TaskDto(); TaskDto dto = new TaskDto();
// 0305 start // #32782 指示者テーブル関連削除 start
// dto.taskDirectionsDto = new TaskDirectionsDto();
dto.taskDirectionsDto = new TaskReportDto(); dto.taskDirectionsDto = new TaskReportDto();
// 0305 end // #32782 指示者テーブル関連削除 end
dto.taskReportDto = new TaskReportDto(); dto.taskReportDto = new TaskReportDto();
dto.operationId = taskJson.getLong(OperationId); dto.operationId = taskJson.getLong(OperationId);
......
...@@ -41,10 +41,9 @@ public class RoutineTaskDataJSON extends OperationDataJSON { ...@@ -41,10 +41,9 @@ public class RoutineTaskDataJSON extends OperationDataJSON {
for (int i = 0; i < taskList.length(); i++) { for (int i = 0; i < taskList.length(); i++) {
JSONObject taskJson = taskList.getJSONObject(i); JSONObject taskJson = taskList.getJSONObject(i);
TaskDto dto = new TaskDto(); TaskDto dto = new TaskDto();
// 0305 start // #32782 指示者テーブル関連削除 start
// dto.taskDirectionsDto = new TaskDirectionsDto();
dto.taskDirectionsDto = new TaskReportDto(); dto.taskDirectionsDto = new TaskReportDto();
// 0305 end // #32782 指示者テーブル関連削除 end
dto.taskReportDto = new TaskReportDto(); dto.taskReportDto = new TaskReportDto();
dto.operationId = taskJson.getLong(OperationId); dto.operationId = taskJson.getLong(OperationId);
......
...@@ -17,10 +17,13 @@ public class ABookKeys { ...@@ -17,10 +17,13 @@ public class ABookKeys {
// ABOOKCHECK SCHEME // ABOOKCHECK SCHEME
public static final String ABOOK_CHECK_API = "abookcheck-api"; public static final String ABOOK_CHECK_API = "abookcheck-api";
// #32782 指示者テーブル関連削除 start
// TODO TaskDirections 削除処理が必要
public static final String CMD_INSERT_TASK_DIRECTIONS = "insertTaskDirections"; public static final String CMD_INSERT_TASK_DIRECTIONS = "insertTaskDirections";
public static final String CMD_UPDATE_TASK_DIRECTIONS = "updateTaskDirections"; public static final String CMD_UPDATE_TASK_DIRECTIONS = "updateTaskDirections";
public static final String CMD_DELETE_TASK_DIRECTIONS = "deleteTaskDirections"; public static final String CMD_DELETE_TASK_DIRECTIONS = "deleteTaskDirections";
public static final String CMD_CANCEL_TASK_DIRECTIONS = "cancelTaskDirections"; public static final String CMD_CANCEL_TASK_DIRECTIONS = "cancelTaskDirections";
// #32782 指示者テーブル関連削除 end
public static final String CMD_MOVE_HOT_SPOT = "moveHotspot"; public static final String CMD_MOVE_HOT_SPOT = "moveHotspot";
public static final String CMD_SHOW_DIRECTION_OZD = "showDirectionOzd"; public static final String CMD_SHOW_DIRECTION_OZD = "showDirectionOzd";
public static final String CMD_PREVIEW_DIRECTION_OZD = "previewDirectionOzd"; public static final String CMD_PREVIEW_DIRECTION_OZD = "previewDirectionOzd";
...@@ -47,8 +50,11 @@ public class ABookKeys { ...@@ -47,8 +50,11 @@ 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 TASK_DIRECTIONS = "taskDirections"; // #32782 指示者テーブル関連削除 start
public static final String TASK_DIRECTIONS_SUGGEST = "taskDirectionsSuggest"; // TODO TASK_DIRECTIONS 削除が必要
public static final String TASK_DIRECTIONS = "taskReport";
public static final String TASK_DIRECTIONS_SUGGEST = "taskReportSuggest";
// #32782 指示者テーブル関連削除 end
public static final String TASK_HOTSPOT = "taskHotspot"; public static final String TASK_HOTSPOT = "taskHotspot";
public static final String TASK_REPORT = "taskReport"; public static final String TASK_REPORT = "taskReport";
public static final String TASK_REPORT_SUGGEST = "taskReportSuggest"; public static final String TASK_REPORT_SUGGEST = "taskReportSuggest";
......
...@@ -91,10 +91,10 @@ public class ABVDataOpenHelper { ...@@ -91,10 +91,10 @@ public class ABVDataOpenHelper {
iTableScripts.add(new TOperation()); iTableScripts.add(new TOperation());
iTableScripts.add(new ROperationContent()); iTableScripts.add(new ROperationContent());
iTableScripts.add(new TTask()); iTableScripts.add(new TTask());
// 0305 start // #32782 指示者テーブル関連削除 start
// iTableScripts.add(new TTaskDirections()); // iTableScripts.add(new TTaskDirections());
// iTableScripts.add(new TTaskDirectionsItems()); // iTableScripts.add(new TTaskDirectionsItems());
// 0305 end // #32782 指示者テーブル関連削除 end
iTableScripts.add(new TTaskReport()); iTableScripts.add(new TTaskReport());
iTableScripts.add(new TTaskReportSend()); iTableScripts.add(new TTaskReportSend());
iTableScripts.add(new TTaskReportItems()); iTableScripts.add(new TTaskReportItems());
......
...@@ -204,10 +204,10 @@ public class OperationDao extends AbstractDao { ...@@ -204,10 +204,10 @@ public class OperationDao extends AbstractDao {
delete("r_project_content", null, null); delete("r_project_content", null, null);
delete("t_project", null, null); delete("t_project", null, null);
delete("t_task", null, null); delete("t_task", null, null);
// 0305 start // #32782 指示者テーブル関連削除 start
// delete("t_task_directions", null, null); // delete("t_task_directions", null, null);
// delete("t_task_directions_items", null, null); // delete("t_task_directions_items", null, null);
// 0305 end // #32782 指示者テーブル関連削除 end
delete("t_task_report", null, null); delete("t_task_report", null, null);
delete("t_task_report_send", null, null); delete("t_task_report_send", null, null);
delete("t_task_report_items", null, null); delete("t_task_report_items", null, null);
......
...@@ -100,12 +100,9 @@ public class TaskDao extends AbstractDao { ...@@ -100,12 +100,9 @@ public class TaskDao extends AbstractDao {
if (directionFlg) { if (directionFlg) {
delete("t_task", "task_key=?", keyValues); delete("t_task", "task_key=?", keyValues);
// 0305 start // #32782 指示者テーブル関連削除
// delete("t_task_directions", "task_key=?", keyValues);
// delete("t_task_directions_items", "task_key=?", keyValues);
delete("t_task_report", "task_key=?", keyValues); delete("t_task_report", "task_key=?", keyValues);
delete("t_task_report_items", "task_key=?", keyValues); delete("t_task_report_items", "task_key=?", keyValues);
// 0305 end
} else { } else {
delete("t_task_report", "task_key=?", keyValues); delete("t_task_report", "task_key=?", keyValues);
delete("t_task_report_items", "task_key=?", keyValues); delete("t_task_report_items", "task_key=?", keyValues);
...@@ -118,10 +115,7 @@ public class TaskDao extends AbstractDao { ...@@ -118,10 +115,7 @@ 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());
// 0305 start // #32782 指示者テーブル関連削除
// delete("t_task_directions", "task_key=?", dto.getKeyValues());
// delete("t_task_directions_items", "task_key=?", dto.getKeyValues());
// 0305 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 });
......
...@@ -53,12 +53,12 @@ public class TaskReportDao extends AbstractDao { ...@@ -53,12 +53,12 @@ public class TaskReportDao extends AbstractDao {
if (column != -1) { if (column != -1) {
dto.delFlg = toBool(cursor.getInt(column)); dto.delFlg = toBool(cursor.getInt(column));
} }
// 0305 start // #32782 指示者テーブル関連削除 start
column = cursor.getColumnIndex("reportor_flag"); column = cursor.getColumnIndex("reportor_flag");
if (column != -1) { if (column != -1) {
dto.reportorFlag = toBool(cursor.getInt(column)); dto.reporterFlag = toBool(cursor.getInt(column));
} }
// 0305 end // #32782 指示者テーブル関連削除 end
return dto; return dto;
} }
...@@ -70,12 +70,12 @@ public class TaskReportDao extends AbstractDao { ...@@ -70,12 +70,12 @@ public class TaskReportDao extends AbstractDao {
+ "attached_file_name, " + "attached_file_name, "
+ "local_attached_file_name, " + "local_attached_file_name, "
+ "attached_file_send_flg, " + "attached_file_send_flg, "
// 0301 start + "data_send_flg, "
+ "reportor_flag, " // #32782 指示者テーブル関連削除 start
// 0301 end + "reporter_flag) "
+ "data_send_flg) " // #32782 指示者テーブル関連削除 end
+ "values " + "values "
+ "(?,?,?,?,?,?)", + "(?,?,?,?,?,?,?)",
dto.getInsertValues()); dto.getInsertValues());
} }
...@@ -103,9 +103,9 @@ public class TaskReportDao extends AbstractDao { ...@@ -103,9 +103,9 @@ public class TaskReportDao extends AbstractDao {
+ "local_attached_file_name=?, " + "local_attached_file_name=?, "
+ "attached_file_send_flg=?, " + "attached_file_send_flg=?, "
+ "data_send_flg=?, " + "data_send_flg=?, "
// 0301 start // #32782 指示者テーブル関連削除 start
+ "reportor_flag=? " + "reporter_flag=? "
// 0301 end // #32782 指示者テーブル関連削除 end
+ "where task_key=?", + "where task_key=?",
dto.getUpdateValues()); dto.getUpdateValues());
return count > 0; return count > 0;
...@@ -133,7 +133,7 @@ public class TaskReportDao extends AbstractDao { ...@@ -133,7 +133,7 @@ public class TaskReportDao extends AbstractDao {
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskReportDto.class); return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskReportDto.class);
} }
public List<TaskReportDto> getSendableTaskData(Long operationId, String taskKey, boolean reportorFlag) { public List<TaskReportDto> getSendableTaskData(Long operationId, String taskKey, boolean reporterFlag) {
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 ");
...@@ -143,10 +143,10 @@ public class TaskReportDao extends AbstractDao { ...@@ -143,10 +143,10 @@ 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.project_id = ?"); sb.append(" AND tt.project_id = ?");
sb.append(" AND tt.task_key = ?"); sb.append(" AND tt.task_key = ?");
// 0305 start // #32782 指示者テーブル関連削除 start
sb.append(" AND ttr.reportor_flag = ?"); sb.append(" AND ttr.repertor_flag = ?");
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId, "" + taskKey, "" + reportorFlag}, TaskReportDto.class); return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId, "" + taskKey, "" + reporterFlag}, TaskReportDto.class);
// 0305 end // #32782 指示者テーブル関連削除 end
} }
public String getTaskReportAttachedFileName(String taskKey) { public String getTaskReportAttachedFileName(String taskKey) {
......
...@@ -28,9 +28,9 @@ public class TTaskReport extends SQLiteTableScript { ...@@ -28,9 +28,9 @@ 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 ");
// 0305 start // #32782 指示者テーブル関連削除 start
sql.append(" , reportor_flag BOOLEAN DEFAULT 0 "); sql.append(" , reporter_flag BOOLEAN DEFAULT 0 ");
// 0305 end // #32782 指示者テーブル関連削除 end
sql.append(" ) "); sql.append(" ) ");
ddl.add(sql.toString()); ddl.add(sql.toString());
......
...@@ -16,11 +16,11 @@ public class TaskDto extends AbstractDto { ...@@ -16,11 +16,11 @@ public class TaskDto extends AbstractDto {
public String taskHotSpotInfo; public String taskHotSpotInfo;
public boolean delFlg; public boolean delFlg;
// 0305 start // #32782 指示者テーブル関連削除 start
// public TaskDirectionsDto taskDirectionsDto; // TODO TaskDirectionDto から TaskReportDto に変更、taskDirectionsDto 名を変更必要
public TaskReportDto taskDirectionsDto; public TaskReportDto taskDirectionsDto;
// #32782 指示者テーブル関連削除 end
public TaskReportDto taskReportDto; public TaskReportDto taskReportDto;
// 0305 end
public int taskReportId; public int taskReportId;
public List<RoutineTaskReportDto> RoutineTaskReportList; public List<RoutineTaskReportDto> RoutineTaskReportList;
......
...@@ -15,24 +15,22 @@ public class TaskReportDto extends AbstractDto { ...@@ -15,24 +15,22 @@ public class TaskReportDto extends AbstractDto {
public String taskHotSpotInfo; public String taskHotSpotInfo;
public boolean delFlg; public boolean delFlg;
// 0301 start // #32782 指示者テーブル関連削除 start
public boolean reportorFlag; public boolean reporterFlag;
// 0301 end // #32782 指示者テーブル関連削除 end
@Override @Override
public Object[] getInsertValues() { public Object[] getInsertValues() {
// 0301 start // #32782 指示者テーブル関連削除 start
return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, reportorFlag }; return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, reporterFlag };
// return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg }; // #32782 指示者テーブル関連削除 end
// 0301 end
} }
@Override @Override
public Object[] getUpdateValues() { public Object[] getUpdateValues() {
// 0301 start // #32782 指示者テーブル関連削除 start
return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, reportorFlag, taskKey }; return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, reporterFlag, taskKey };
// return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskKey }; // #32782 指示者テーブル関連削除 end
// 0301 end
} }
@Override @Override
......
...@@ -78,10 +78,10 @@ public class OperationLogic extends AbstractLogic { ...@@ -78,10 +78,10 @@ public class OperationLogic extends AbstractLogic {
private WorkerGroupDao mWorkerGroupDao = AbstractDao.getDao(WorkerGroupDao.class); private WorkerGroupDao mWorkerGroupDao = AbstractDao.getDao(WorkerGroupDao.class);
private TaskDao mTaskDao = AbstractDao.getDao(TaskDao.class); private TaskDao mTaskDao = AbstractDao.getDao(TaskDao.class);
// 0301 start // #32782 指示者テーブル関連削除 start
// private TaskDirectionsDao mTaskDirectionsDao = AbstractDao.getDao(TaskDirectionsDao.class); // private TaskDirectionsDao mTaskDirectionsDao = AbstractDao.getDao(TaskDirectionsDao.class);
// private TaskDirectionsItemsDao mTaskDirectionsItemsDao = AbstractDao.getDao(TaskDirectionsItemsDao.class); // private TaskDirectionsItemsDao mTaskDirectionsItemsDao = AbstractDao.getDao(TaskDirectionsItemsDao.class);
// 0301 end // #32782 指示者テーブル関連削除 end
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);
...@@ -228,124 +228,10 @@ public class OperationLogic extends AbstractLogic { ...@@ -228,124 +228,10 @@ public class OperationLogic extends AbstractLogic {
* @throws IOException * @throws IOException
*/ */
public void insertTaskDirections( String taskKey, long operationId, long contentId, JSONObject taskDirectionsJson, String hotSpotInfo, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg) throws IOException { public void insertTaskDirections( String taskKey, long operationId, long contentId, JSONObject taskDirectionsJson, String hotSpotInfo, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg) throws IOException {
// 0305 start // #32782 指示者テーブル関連削除 start
// TaskDto taskDto = new TaskDto();
// TaskDirectionsDto taskDirectionsDto = new TaskDirectionsDto();
// JSONObject taskJson = taskDirectionsJson.getJSONObject("task");
// taskDto.taskKey = taskKey;
// taskDto.operationId = operationId;
// taskDto.taskHotSpotInfo = hotSpotInfo;
//
//
// Iterator taskKeys = taskJson.keys();
// while (taskKeys.hasNext()) {
// TaskDirectionsItemsDto taskDirectionsItemsDto = new TaskDirectionsItemsDto();
// String itemKey = (String) taskKeys.next();
// if (itemKey.startsWith("q_1_")) {
// taskDto.taskCode = taskJson.getString(itemKey);
// }
// taskDirectionsItemsDto.taskKey = taskKey;
// taskDirectionsItemsDto.itemKey = itemKey;
// try {
// taskDirectionsItemsDto.inputValue = taskJson.getString(itemKey);
// } catch (JSONException e) {
// // 値がStringではない場合、無視する
// continue;
// }
// mTaskDirectionsItemsDao.insertTaskDirectionsItems(taskDirectionsItemsDto);
// }
// taskDirectionsDto.taskKey = taskKey;
// taskDirectionsDto.jsonData = taskDirectionsJson.toString();
// taskDirectionsDto.dataSendFlg = dataSendFlg;
// taskDirectionsDto.attachedFileSendFlg = attachedChangeFlag;
// if (localAttachedFileName != null) {
// taskDirectionsDto.localAttachedFileName = localAttachedFileName;
// }
//
// if (taskDirectionsJson.has(ABookKeys.TASK_STATUS)) {
// taskDto.taskStatus = taskDirectionsJson.getInt(ABookKeys.TASK_STATUS);
// }
//
// mTaskDirectionsDao.insert(taskDirectionsDto);
// mTaskDao.insert(taskDto);
//
// String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey);
//
// //添付ファイル変更の場合、以下の処理を行う
// JSONObject attachedListJson = taskDirectionsJson.getJSONObject("attached");
// List<String> attachedFileNames = JSONObject.getValues(attachedListJson);
// // コピー元のファイルで、添付ファイルとして使用しないファイル削除
// deleteDifferentialFile(tempDirPath, attachedFileNames);
//
// String operationDrectionOrReportDirPath = ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, true);
//
// // 添付ディレクトリの移動
// boolean result = FileUtil.copy(tempDirPath, operationDrectionOrReportDirPath, true);
// if (result) {
// FileUtil.delete(tempDirPath);
// }
TaskDto taskDto = new TaskDto();
TaskReportDto taskReportDto = new TaskReportDto();
JSONObject taskJson = taskDirectionsJson.getJSONObject("task");
taskDto.taskKey = taskKey;
taskDto.operationId = operationId;
taskDto.taskHotSpotInfo = hotSpotInfo;
Iterator taskKeys = taskJson.keys();
while (taskKeys.hasNext()) {
TaskReportItemsDto taskReportItemsDto = new TaskReportItemsDto();
String itemKey = (String) taskKeys.next();
if (itemKey.startsWith("q_1_")) {
taskDto.taskCode = taskJson.getString(itemKey);
}
taskReportItemsDto.taskKey = taskKey;
taskReportItemsDto.itemKey = itemKey;
try {
taskReportItemsDto.inputValue = taskJson.getString(itemKey);
} catch (JSONException e) {
// 値がStringではない場合、無視する
continue;
}
mTaskReportItemsDao.insertTaskReportItems(taskReportItemsDto);
}
taskReportDto.taskKey = taskKey;
taskReportDto.jsonData = taskDirectionsJson.toString();
taskReportDto.dataSendFlg = dataSendFlg;
taskReportDto.attachedFileSendFlg = attachedChangeFlag;
if (localAttachedFileName != null) {
taskReportDto.localAttachedFileName = localAttachedFileName;
}
if (taskDirectionsJson.has(ABookKeys.TASK_STATUS)) {
taskDto.taskStatus = taskDirectionsJson.getInt(ABookKeys.TASK_STATUS);
}
// 0305 start
// 指示の場合
taskReportDto.reportorFlag = false;
// 0305 end
mTaskReportDao.insert(taskReportDto);
mTaskDao.insert(taskDto);
String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey);
//添付ファイル変更の場合、以下の処理を行う
JSONObject attachedListJson = taskDirectionsJson.getJSONObject("attached");
List<String> attachedFileNames = JSONObject.getValues(attachedListJson);
// コピー元のファイルで、添付ファイルとして使用しないファイル削除
deleteDifferentialFile(tempDirPath, attachedFileNames);
String operationDrectionOrReportDirPath = ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, true); // TODO Delete method
// #32782 指示者テーブル関連削除 end
// 添付ディレクトリの移動
boolean result = FileUtil.copy(tempDirPath, operationDrectionOrReportDirPath, true);
if (result) {
FileUtil.delete(tempDirPath);
}
// 0305 end
} }
/** /**
...@@ -362,137 +248,9 @@ public class OperationLogic extends AbstractLogic { ...@@ -362,137 +248,9 @@ public class OperationLogic extends AbstractLogic {
* @throws IOException * @throws IOException
*/ */
public void updateTaskDirections(String taskKey, long operationId, long contentId, JSONObject taskDirectionsJson, String hotSpotInfo, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg) throws IOException { public void updateTaskDirections(String taskKey, long operationId, long contentId, JSONObject taskDirectionsJson, String hotSpotInfo, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg) throws IOException {
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey); // #32782 指示者テーブル関連削除 start
if (taskDto == null) { // TODO Delete method
// ignore // #32782 指示者テーブル関連削除 end
Logger.w(TAG, "taskDto is null");
return;
}
// 0305 start
// TaskDirectionsDto taskDirectionsDto = mTaskDirectionsDao.getTaskDirections(taskKey);
// taskDto.operationId = operationId;
// taskDto.taskHotSpotInfo = hotSpotInfo;
// JSONObject taskJson = taskDirectionsJson.getJSONObject("task");
//
// Iterator taskKeys = taskJson.keys();
// List<TaskDirectionsItemsDto> taskDirectionsItemsDtoList = mTaskDirectionsItemsDao.getTaskDirectionsItemByTaskKey(taskKey);
// for (TaskDirectionsItemsDto taskDirectionsItemsDto : taskDirectionsItemsDtoList) {
// try {
// String newValue = taskJson.getString(taskDirectionsItemsDto.itemKey);
// if (!newValue.equals(taskDirectionsItemsDto.inputValue)) {
// // 値が異なる場合のみ、更新する
// taskDirectionsItemsDto.inputValue = newValue;
// if (taskDirectionsItemsDto.itemKey.startsWith("q_1_")) {
// // 値が異なるため、作業コードの入力値を変更する
// taskDto.taskCode = taskDirectionsItemsDto.inputValue;
// }
// mTaskDirectionsItemsDao.updateTaskDirectionsItems(taskDirectionsItemsDto);
// }
// } catch (JSONException e) {
// // 値がStringではない場合、無視する
// continue;
// }
// }
// taskDirectionsDto.jsonData = taskDirectionsJson.toString();
// taskDirectionsDto.dataSendFlg = dataSendFlg;
//
// // attachedFileSendFlgがtrueの場合は、更新しない
// if (!taskDirectionsDto.attachedFileSendFlg) {
// taskDirectionsDto.attachedFileSendFlg = attachedChangeFlag;
// }
// if (localAttachedFileName != null) {
// taskDirectionsDto.localAttachedFileName = localAttachedFileName;
// }
//
// if (taskDirectionsJson.has(ABookKeys.TASK_STATUS)) {
// taskDto.taskStatus = taskDirectionsJson.getInt(ABookKeys.TASK_STATUS);
// }
//
// mTaskDirectionsDao.update(taskDirectionsDto);
// mTaskDao.update(taskDto);
// String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey);
// String operationDrectionOrReportDirPath = ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, true);
// if (taskDirectionsDto.attachedFileSendFlg) {
// //添付ファイル変更の場合、以下の処理を行う
// JSONObject attachedListJson = taskDirectionsJson.getJSONObject("attached");
// List<String> attachedFileNames = JSONObject.getValues(attachedListJson);
//
// // コピー元のファイルで、添付ファイルとして使用しないファイル削除
// deleteDifferentialFile(tempDirPath, attachedFileNames);
// // 同じファイル名が存在すれば、コピー先ファイルを削除
// deleteDifferentialFile(operationDrectionOrReportDirPath, attachedFileNames);
//
// // 添付ディレクトリの移動
// boolean result = FileUtil.copy(tempDirPath, operationDrectionOrReportDirPath, true);
// if(result) {
// FileUtil.delete(tempDirPath);
// }
// }
TaskReportDto taskReportDto = mTaskReportDao.getTaskReport(taskKey);
taskDto.operationId = operationId;
taskDto.taskHotSpotInfo = hotSpotInfo;
JSONObject taskJson = taskDirectionsJson.getJSONObject("task");
Iterator taskKeys = taskJson.keys();
List<TaskReportItemsDto> taskReportItemsDtoList = mTaskReportItemsDao.getTaskReportItemByTaskKey(taskKey);
for (TaskReportItemsDto taskReportItemsDto : taskReportItemsDtoList) {
try {
String newValue = taskJson.getString(taskReportItemsDto.itemKey);
if (!newValue.equals(taskReportItemsDto.inputValue)) {
// 値が異なる場合のみ、更新する
taskReportItemsDto.inputValue = newValue;
if (taskReportItemsDto.itemKey.startsWith("q_1_")) {
// 値が異なるため、作業コードの入力値を変更する
taskDto.taskCode = taskReportItemsDto.inputValue;
}
mTaskReportItemsDao.updateTaskReportItems(taskReportItemsDto);
}
} catch (JSONException e) {
// 値がStringではない場合、無視する
continue;
}
}
taskReportDto.jsonData = taskDirectionsJson.toString();
taskReportDto.dataSendFlg = dataSendFlg;
// attachedFileSendFlgがtrueの場合は、更新しない
if (!taskReportDto.attachedFileSendFlg) {
taskReportDto.attachedFileSendFlg = attachedChangeFlag;
}
if (localAttachedFileName != null) {
taskReportDto.localAttachedFileName = localAttachedFileName;
}
if (taskDirectionsJson.has(ABookKeys.TASK_STATUS)) {
taskDto.taskStatus = taskDirectionsJson.getInt(ABookKeys.TASK_STATUS);
}
// 0305 start
taskReportDto.reportorFlag = false;
// 0305 end
mTaskReportDao.update(taskReportDto);
mTaskDao.update(taskDto);
String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey);
String operationDrectionOrReportDirPath = ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, true);
if (taskReportDto.attachedFileSendFlg) {
//添付ファイル変更の場合、以下の処理を行う
JSONObject attachedListJson = taskDirectionsJson.getJSONObject("attached");
List<String> attachedFileNames = JSONObject.getValues(attachedListJson);
// コピー元のファイルで、添付ファイルとして使用しないファイル削除
deleteDifferentialFile(tempDirPath, attachedFileNames);
// 同じファイル名が存在すれば、コピー先ファイルを削除
deleteDifferentialFile(operationDrectionOrReportDirPath, attachedFileNames);
// 添付ディレクトリの移動
boolean result = FileUtil.copy(tempDirPath, operationDrectionOrReportDirPath, true);
if(result) {
FileUtil.delete(tempDirPath);
}
}
// 0305 end
} }
// TODO // TODO
...@@ -505,33 +263,9 @@ public class OperationLogic extends AbstractLogic { ...@@ -505,33 +263,9 @@ public class OperationLogic extends AbstractLogic {
* @param taskKey * @param taskKey
*/ */
public void deleteTaskDirections(long operationId, long contentId, String taskKey) { public void deleteTaskDirections(long operationId, long contentId, String taskKey) {
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey); // #32782 指示者テーブル関連削除 start
if (taskDto == null) { // TODO Delete method
return; // #32782 指示者テーブル関連削除 end
}
// 0305 start
// TaskDirectionsDto taskDirectionsDto = mTaskDirectionsDao.getTaskDirections(taskKey);
// taskDirectionsDto.dataSendFlg = true;
// taskDirectionsDto.attachedFileSendFlg = false;
// taskDto.delFlg = true;
// mTaskDirectionsDao.update(taskDirectionsDto);
// mTaskDao.update(taskDto);
TaskReportDto taskReportDto = mTaskReportDao.getTaskReport(taskKey);
taskReportDto.dataSendFlg = true;
taskReportDto.attachedFileSendFlg = false;
taskDto.delFlg = true;
// 0305 start
taskReportDto.reportorFlag = false;
// 0305 end
mTaskReportDao.update(taskReportDto);
mTaskDao.update(taskDto);
// プロジェクトの作業データディレクトリ削除
deleteTaskFileData(operationId, contentId, taskKey);
// 0305 end
} }
/** /**
...@@ -540,15 +274,28 @@ public class OperationLogic extends AbstractLogic { ...@@ -540,15 +274,28 @@ public class OperationLogic extends AbstractLogic {
* @param taskKey * @param taskKey
* @param operationId * @param operationId
* @param contentId * @param contentId
* @param taskReportJson
* @param localAttachedFileName
* @param attachedChangeFlag * @param attachedChangeFlag
* @param dataSendFlg * @param dataSendFlg
* @param hotSpotInfo
* @throws IOException * @throws IOException
*/ */
public void insertTaskReport(String taskKey, long operationId, long contentId, JSONObject taskReportJson, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg) throws IOException { public void insertTaskReport(String taskKey, long operationId, long contentId, JSONObject taskReportJson, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg, String hotSpotInfo) throws IOException {
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey); TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
int mOperationAuthLevel = ABVDataCache.getInstance().getMemberInfo().operationAuthLevel;
if (taskDto == null) { if (taskDto == null) {
//TODO error taskDto = new TaskDto();
return; // 指示者と報告者判断する
String taskHotSpotInfo = null;
if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
taskDto.taskKey = taskKey;
taskDto.operationId = operationId;
taskDto.taskHotSpotInfo = hotSpotInfo;
} else {
//TODO error
return;
}
} }
TaskReportDto taskReportDto = new TaskReportDto(); TaskReportDto taskReportDto = new TaskReportDto();
JSONObject taskJson = taskReportJson.getJSONObject("task"); JSONObject taskJson = taskReportJson.getJSONObject("task");
...@@ -557,8 +304,16 @@ public class OperationLogic extends AbstractLogic { ...@@ -557,8 +304,16 @@ public class OperationLogic extends AbstractLogic {
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_2_")) {
taskDto.taskStatus = taskJson.getInt(itemKey); // 指示者の場合
if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
if (itemKey.startsWith("q_1_")) {
taskDto.taskStatus = taskJson.getInt(itemKey);
}
} else {
if (itemKey.startsWith("q_2_")) {
taskDto.taskStatus = taskJson.getInt(itemKey);
}
} }
taskReportItemsDto.taskKey = taskKey; taskReportItemsDto.taskKey = taskKey;
taskReportItemsDto.itemKey = itemKey; taskReportItemsDto.itemKey = itemKey;
...@@ -575,10 +330,19 @@ public class OperationLogic extends AbstractLogic { ...@@ -575,10 +330,19 @@ public class OperationLogic extends AbstractLogic {
taskReportDto.dataSendFlg = dataSendFlg; taskReportDto.dataSendFlg = dataSendFlg;
taskReportDto.attachedFileSendFlg = attachedChangeFlag; taskReportDto.attachedFileSendFlg = attachedChangeFlag;
// 0305 start // #32782 指示者テーブル関連削除 start
// 報告者の場合 // 報告者の場合
taskReportDto.reportorFlag = true; taskReportDto.reporterFlag = true;
// 0305 end // #32782 指示者テーブル関連削除 end
if (localAttachedFileName != null) {
taskReportDto.localAttachedFileName = localAttachedFileName;
}
if (taskReportJson.has(ABookKeys.TASK_STATUS)) {
taskDto.taskStatus = taskReportJson.getInt(ABookKeys.TASK_STATUS);
}
// 削除の時、deleteではなく、jsonDataを空にして、データが残っているので、updateする // 削除の時、deleteではなく、jsonDataを空にして、データが残っているので、updateする
List<TaskReportDto> taskReport = mTaskReportDao.selectByTaskKey(taskReportDto.taskKey); List<TaskReportDto> taskReport = mTaskReportDao.selectByTaskKey(taskReportDto.taskKey);
...@@ -587,7 +351,12 @@ public class OperationLogic extends AbstractLogic { ...@@ -587,7 +351,12 @@ public class OperationLogic extends AbstractLogic {
} else { } else {
mTaskReportDao.insert(taskReportDto); mTaskReportDao.insert(taskReportDto);
} }
mTaskDao.update(taskDto);
if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
mTaskDao.insert(taskDto);
} else {
mTaskDao.update(taskDto);
}
//添付ファイル変更の場合、以下の処理を行う //添付ファイル変更の場合、以下の処理を行う
String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey); String tempDirPath = ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey);
...@@ -665,17 +434,30 @@ public class OperationLogic extends AbstractLogic { ...@@ -665,17 +434,30 @@ public class OperationLogic extends AbstractLogic {
* @param taskReport * @param taskReport
* @param attachedChangeFlag * @param attachedChangeFlag
* @param dataSendFlg * @param dataSendFlg
* @param hotSpotInfo
* @throws IOException * @throws IOException
*/ */
public void updateTaskReport(String taskKey, long operationId, long contentId, JSONObject taskReport, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg) throws IOException { public void updateTaskReport(String taskKey, long operationId, long contentId, JSONObject taskReport, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg, String hotSpotInfo) throws IOException {
TaskReportDto taskReportDto = mTaskReportDao.getTaskReport(taskKey); TaskReportDto taskReportDto = mTaskReportDao.getTaskReport(taskKey);
// 指示者か報告者か判断
int mOperationAuthLevel = ABVDataCache.getInstance().getMemberInfo().operationAuthLevel;
if (taskReportDto == null) { if (taskReportDto == null) {
Logger.w(TAG, "taskReportDto is null"); Logger.w(TAG, "taskReportDto is null");
insertTaskReport(taskKey, operationId, contentId, taskReport, localAttachedFileName, attachedChangeFlag, dataSendFlg); // 指示者の場合
if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
insertTaskReport(taskKey, operationId, contentId, taskReport, localAttachedFileName, attachedChangeFlag, dataSendFlg, hotSpotInfo);
}
return; return;
} }
JSONObject taskJson = taskReport.getJSONObject("task"); JSONObject taskJson = taskReport.getJSONObject("task");
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey); TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
// 指示者の場合
if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
taskDto.operationId = operationId;
taskDto.taskHotSpotInfo = hotSpotInfo;
}
List<TaskReportItemsDto> taskReportItemsDaoList = mTaskReportItemsDao.getTaskReportItemByTaskKey(taskKey); List<TaskReportItemsDto> taskReportItemsDaoList = mTaskReportItemsDao.getTaskReportItemByTaskKey(taskKey);
for (TaskReportItemsDto taskReportItemsDto : taskReportItemsDaoList) { for (TaskReportItemsDto taskReportItemsDto : taskReportItemsDaoList) {
try { try {
...@@ -685,9 +467,17 @@ public class OperationLogic extends AbstractLogic { ...@@ -685,9 +467,17 @@ public class OperationLogic extends AbstractLogic {
taskReportItemsDto.inputValue = newValue; taskReportItemsDto.inputValue = newValue;
mTaskReportItemsDao.updateTaskReportItems(taskReportItemsDto); mTaskReportItemsDao.updateTaskReportItems(taskReportItemsDto);
} }
if (taskReportItemsDto.itemKey.startsWith("q_2_")) { // 指示者の場合
// 値が異なるため、作業コードの入力値を変更する if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
taskDto.taskStatus = Integer.parseInt(taskReportItemsDto.inputValue); if (taskReportItemsDto.inputValue.startsWith("q_1_")) {
// 値が異なるため、作業コードの入力値を変更する
taskDto.taskCode = taskReportItemsDto.inputValue;
}
} else {
if (taskReportItemsDto.itemKey.startsWith("q_2_")) {
// 値が異なるため、作業コードの入力値を変更する
taskDto.taskStatus = Integer.parseInt(taskReportItemsDto.inputValue);
}
} }
} catch (JSONException e) { } catch (JSONException e) {
// 値がStringではない場合、無視する // 値がStringではない場合、無視する
...@@ -700,10 +490,20 @@ public class OperationLogic extends AbstractLogic { ...@@ -700,10 +490,20 @@ public class OperationLogic extends AbstractLogic {
if (!taskReportDto.attachedFileSendFlg) { if (!taskReportDto.attachedFileSendFlg) {
taskReportDto.attachedFileSendFlg = attachedChangeFlag; taskReportDto.attachedFileSendFlg = attachedChangeFlag;
} }
// #32782 指示者テーブル関連削除 start
taskReportDto.reporterFlag = true;
// #32782 指示者テーブル関連削除 end
// 0305 start // 指示者の場合
taskReportDto.reportorFlag = true; if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
// 0305 end if (localAttachedFileName != null) {
taskReportDto.localAttachedFileName = localAttachedFileName;
}
if (taskReport.has(ABookKeys.TASK_STATUS)) {
taskDto.taskStatus = taskReport.getInt(ABookKeys.TASK_STATUS);
}
}
mTaskReportDao.update(taskReportDto); mTaskReportDao.update(taskReportDto);
mTaskDao.update(taskDto); mTaskDao.update(taskDto);
...@@ -901,23 +701,39 @@ public class OperationLogic extends AbstractLogic { ...@@ -901,23 +701,39 @@ public class OperationLogic extends AbstractLogic {
* @param taskKey * @param taskKey
*/ */
public void deleteTaskReport(long operationId, long contentId, String taskKey) { public void deleteTaskReport(long operationId, long contentId, String taskKey) {
// #32782 指示者テーブル関連削除 start
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
if (taskDto == null) {
return;
} else {
taskDto.taskStatus = 0;
mTaskDao.update(taskDto);
}
TaskReportDto taskReportDto = mTaskReportDao.getTaskReport(taskKey); TaskReportDto taskReportDto = mTaskReportDao.getTaskReport(taskKey);
if(taskReportDto != null) {
if (ABVDataCache.getInstance().getMemberInfo().operationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
taskReportDto.dataSendFlg = true; taskReportDto.dataSendFlg = true;
taskReportDto.attachedFileSendFlg = false; taskReportDto.attachedFileSendFlg = false;
taskReportDto.jsonData = ""; taskDto.delFlg = true;
mTaskReportDao.update(taskReportDto); mTaskReportDao.update(taskReportDto);
}
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
if (taskDto != null) {
taskDto.taskStatus = 0;
mTaskDao.update(taskDto); mTaskDao.update(taskDto);
// プロジェクトの作業データディレクトリ削除
deleteTaskFileData(operationId, contentId, taskKey);
} else {
if(taskReportDto != null) {
taskReportDto.dataSendFlg = true;
taskReportDto.attachedFileSendFlg = false;
taskReportDto.jsonData = "";
mTaskReportDao.update(taskReportDto);
}
// 作業報告のディレクトリ削除
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
FileUtil.delete(ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, false));
} }
// #32782 指示者テーブル関連削除 end
// 作業報告のディレクトリ削除
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
FileUtil.delete(ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, false));
} }
/** /**
...@@ -1028,17 +844,12 @@ public class OperationLogic extends AbstractLogic { ...@@ -1028,17 +844,12 @@ public class OperationLogic extends AbstractLogic {
*/ */
public void updateTaskHotspot(String taskKey, Map<String, String> param) { public void updateTaskHotspot(String taskKey, Map<String, String> param) {
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey); TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
// 0305 start // #32782 指示者テーブル関連削除 start
// TaskDirectionsDto taskDirectionsDto = mTaskDirectionsDao.getTaskDirections(taskKey);
// taskDirectionsDto.dataSendFlg = true;
// taskDto.taskHotSpotInfo = param.get(ABookKeys.HOT_SPOT);
// mTaskDirectionsDao.update(taskDirectionsDto);
TaskReportDto taskReportDao = mTaskReportDao.getTaskReport(taskKey); TaskReportDto taskReportDao = mTaskReportDao.getTaskReport(taskKey);
taskReportDao.dataSendFlg = true; taskReportDao.dataSendFlg = true;
taskDto.taskHotSpotInfo = param.get(ABookKeys.HOT_SPOT); taskDto.taskHotSpotInfo = param.get(ABookKeys.HOT_SPOT);
mTaskReportDao.update(taskReportDao); mTaskReportDao.update(taskReportDao);
// 0305 end // #32782 指示者テーブル関連削除 end
mTaskDao.update(taskDto); mTaskDao.update(taskDto);
} }
...@@ -1051,15 +862,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1051,15 +862,7 @@ public class OperationLogic extends AbstractLogic {
*/ */
public void updateTaskHotspot(String taskKey, float newX, float newY) { public void updateTaskHotspot(String taskKey, float newX, float newY) {
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey); TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
// 0305 start // #32782 指示者テーブル関連削除 start
// TaskDirectionsDto taskDirectionsDto = mTaskDirectionsDao.getTaskDirections(taskKey);
// taskDirectionsDto.dataSendFlg = true;
// JSONObject hotSpot = new JSONObject(taskDto.taskHotSpotInfo);
// hotSpot.put("x", newX);
// hotSpot.put("y", newY);
// taskDto.taskHotSpotInfo = hotSpot.toString();
// mTaskDirectionsDao.update(taskDirectionsDto);
TaskReportDto taskReportDto = mTaskReportDao.getTaskReport(taskKey); TaskReportDto taskReportDto = mTaskReportDao.getTaskReport(taskKey);
taskReportDto.dataSendFlg = true; taskReportDto.dataSendFlg = true;
JSONObject hotSpot = new JSONObject(taskDto.taskHotSpotInfo); JSONObject hotSpot = new JSONObject(taskDto.taskHotSpotInfo);
...@@ -1067,13 +870,13 @@ public class OperationLogic extends AbstractLogic { ...@@ -1067,13 +870,13 @@ public class OperationLogic extends AbstractLogic {
hotSpot.put("y", newY); hotSpot.put("y", newY);
taskDto.taskHotSpotInfo = hotSpot.toString(); taskDto.taskHotSpotInfo = hotSpot.toString();
mTaskReportDao.update(taskReportDto); mTaskReportDao.update(taskReportDto);
// 0305 end // #32782 指示者テーブル関連削除 end
mTaskDao.update(taskDto); mTaskDao.update(taskDto);
} }
/** /**
* 作業指示、作業報告用のjsonファイル * 作業指示、作業報告用のjsonファイル
* taskDirections.jsonとtaskDirectionsSuggest.jsonとhotspot.jsonを作成 * taskReport.jsonとtaskReportSuggest.jsonとhotspot.jsonを作成
* *
* @param operationId * @param operationId
* @param reportUpdateType * @param reportUpdateType
...@@ -1087,7 +890,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1087,7 +890,7 @@ public class OperationLogic extends AbstractLogic {
/** /**
* 作業指示、作業報告用のjsonファイル * 作業指示、作業報告用のjsonファイル
* taskDirections.jsonとtaskDirectionsSuggest.jsonとhotspot.jsonを作成 * taskReport.jsonとtaskReportSuggest.jsonとhotspot.jsonを作成
* *
* @param operationId * @param operationId
* @param reportUpdateType * @param reportUpdateType
...@@ -1098,22 +901,15 @@ public class OperationLogic extends AbstractLogic { ...@@ -1098,22 +901,15 @@ public class OperationLogic extends AbstractLogic {
*/ */
public void createJsonForOperationContent(Long operationId, int reportUpdateType, String contentPath, boolean directionsFlg, boolean routineTaskReportFlg) throws IOException { public void createJsonForOperationContent(Long operationId, int reportUpdateType, String contentPath, boolean directionsFlg, boolean routineTaskReportFlg) throws IOException {
try { try {
// 0305 start // #32782 指示者テーブル関連削除 start
createTaskDirectionsJson(operationId, contentPath); createTaskReportJson(operationId, contentPath);
createTaskDirectionsSuggestJson(operationId, contentPath); createTaskReportSuggestJson(operationId, contentPath);
if (!directionsFlg) { if (!directionsFlg) {
//if (reportUpdateType != Constant.OperationUpdateType.HISTORY_ADD ) {
// createTaskReportJson(operationId, contentPath);
//}
if (routineTaskReportFlg) { if (routineTaskReportFlg) {
createRoutineTaskReportJson(operationId, contentPath); createRoutineTaskReportJson(operationId, contentPath);
} else {
createTaskReportJson(operationId, contentPath);
} }
createTaskReportSuggestJson(operationId, contentPath);
} }
// #32782 指示者テーブル関連削除 end
// 0305 end
createHopSpotJson(operationId, contentPath); createHopSpotJson(operationId, contentPath);
} catch (IOException e) { } catch (IOException e) {
...@@ -1223,27 +1019,9 @@ public class OperationLogic extends AbstractLogic { ...@@ -1223,27 +1019,9 @@ public class OperationLogic extends AbstractLogic {
* @throws IOException * @throws IOException
*/ */
private void createTaskDirectionsJson(Long operationId, String contentPath) throws IOException { private void createTaskDirectionsJson(Long operationId, String contentPath) throws IOException {
// 0305 start // #32782 指示者テーブル関連削除 start
// List<JSONObject> taskDirectionsJsonList = new ArrayList<JSONObject>(); // TODO Delete method
// JSONObject taskDirectionsJson = new JSONObject(); // #32782 指示者テーブル関連削除 end
// List<TaskDirectionsDto> taskDirectionsDtoList = mTaskDirectionsDao.getTaskDirectionsByOperationId(operationId);
// for (TaskDirectionsDto dto : taskDirectionsDtoList) {
// taskDirectionsJsonList.add(new JSONObject(dto.jsonData));
// }
// taskDirectionsJson.put(ABookKeys.TASK_DIRECTIONS, taskDirectionsJsonList);
// Logger.d(TAG, "createTaskDirectionsJson : " + taskDirectionsJson.toString());
// FileUtil.createFile(contentPath + "/" + ABookKeys.TASK_DIRECTIONS + ".json", taskDirectionsJson.toString());
List<JSONObject> taskReportJsonList = new ArrayList<JSONObject>();
JSONObject taskReportJson = new JSONObject();
List<TaskReportDto> taskReportDtoList = mTaskReportDao.getTaskReportByOperationId(operationId);
for (TaskReportDto dto : taskReportDtoList) {
taskReportJsonList.add(new JSONObject(dto.jsonData));
}
taskReportJson.put(ABookKeys.TASK_DIRECTIONS, taskReportJsonList);
Logger.d(TAG, "createTaskDirectionsJson : " + taskReportJson.toString());
FileUtil.createFile(contentPath + "/" + ABookKeys.TASK_DIRECTIONS + ".json", taskReportJson.toString());
// 0305 end
} }
/** /**
...@@ -1254,59 +1032,9 @@ public class OperationLogic extends AbstractLogic { ...@@ -1254,59 +1032,9 @@ public class OperationLogic extends AbstractLogic {
* @throws IOException * @throws IOException
*/ */
private void createTaskDirectionsSuggestJson(Long operationId, String contentPath) throws IOException { private void createTaskDirectionsSuggestJson(Long operationId, String contentPath) throws IOException {
// 0305 start // #32782 指示者テーブル関連削除 start
// JSONObject itemJson = new JSONObject(); // TODO Delete mothod
// JSONObject taskDirectionsSuggestJson = new JSONObject(); // #32782 指示者テーブル関連削除 end
// List<TaskDirectionsItemsDto> taskDirectionsItemsDtoList = mTaskDirectionsItemsDao.getTaskDirectionsItemByOperationId(operationId);
// for (TaskDirectionsItemsDto dto : taskDirectionsItemsDtoList) {
// JSONArray jsonArray = new JSONArray();
// if (itemJson.has(dto.itemKey)) {
// boolean result = false;
// jsonArray = itemJson.getJSONArray(dto.itemKey);
// for (int i = 0; i < jsonArray.length(); i++) {
// if (jsonArray.get(i).equals(dto.inputValue)) {
// result = true;
// break;
// }
// }
// if (!result) {
// jsonArray.put(dto.inputValue);
// itemJson.put(dto.itemKey, jsonArray);
// }
// } else {
// jsonArray.put(dto.inputValue);
// itemJson.put(dto.itemKey, jsonArray);
// }
// }
// taskDirectionsSuggestJson.put(ABookKeys.TASK_DIRECTIONS_SUGGEST, itemJson);
// FileUtil.createFile(contentPath + "/" + ABookKeys.TASK_DIRECTIONS_SUGGEST + ".json", taskDirectionsSuggestJson.toString());
JSONObject itemJson = new JSONObject();
JSONObject taskReportSuggestJson = new JSONObject();
List<TaskReportItemsDto> taskReportItemsDtoList = mTaskReportItemsDao.getTaskReportItemByOperationId(operationId);
for (TaskReportItemsDto dto : taskReportItemsDtoList) {
JSONArray jsonArray = new JSONArray();
if (itemJson.has(dto.itemKey)) {
boolean result = false;
jsonArray = itemJson.getJSONArray(dto.itemKey);
for (int i = 0; i < jsonArray.length(); i++) {
if (jsonArray.get(i).equals(dto.inputValue)) {
result = true;
break;
}
}
if (!result) {
jsonArray.put(dto.inputValue);
itemJson.put(dto.itemKey, jsonArray);
}
} else {
jsonArray.put(dto.inputValue);
itemJson.put(dto.itemKey, jsonArray);
}
}
taskReportSuggestJson.put(ABookKeys.TASK_DIRECTIONS_SUGGEST, itemJson);
FileUtil.createFile(contentPath + "/" + ABookKeys.TASK_DIRECTIONS_SUGGEST + ".json", taskReportSuggestJson.toString());
// 0305 end
} }
...@@ -1414,10 +1142,9 @@ public class OperationLogic extends AbstractLogic { ...@@ -1414,10 +1142,9 @@ public class OperationLogic extends AbstractLogic {
// プロジェクト毎に作業の送信フラグがあるかチェックし、存在する場合プロジェクトのデータ同期必要区分をtrueにセット // プロジェクト毎に作業の送信フラグがあるかチェックし、存在する場合プロジェクトのデータ同期必要区分をtrueにセット
if (ABVDataCache.getInstance().getMemberInfo().operationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) { if (ABVDataCache.getInstance().getMemberInfo().operationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
// 作業指示者 // 作業指示者
// 0305 start // #32782 指示者テーブル関連削除 start
// if (mTaskDirectionsDao.isExistSendTaskData(operationDto.operationId)) {
if (mTaskReportDao.isExistSendTaskData(operationDto.operationId)) { if (mTaskReportDao.isExistSendTaskData(operationDto.operationId)) {
// 0305 end // #32782 指示者テーブル関連削除 end
mOperationDao.updateNeedSyncFlg(operationDto.operationId, true); mOperationDao.updateNeedSyncFlg(operationDto.operationId, true);
} }
} else { } else {
...@@ -1534,52 +1261,9 @@ public class OperationLogic extends AbstractLogic { ...@@ -1534,52 +1261,9 @@ public class OperationLogic extends AbstractLogic {
* @return * @return
* @throws Exception * @throws Exception
*/ */
// TODO sendTaskDirectionsData 名を変更必要
public void sendTaskDirectionsData(long operationId, String taskKey, Callback progressCallback) throws ABVException, NetworkDisconnectedException, IOException, ZipException, NoSuchAlgorithmException { public void sendTaskDirectionsData(long operationId, String taskKey, Callback progressCallback) throws ABVException, NetworkDisconnectedException, IOException, ZipException, NoSuchAlgorithmException {
// 0305 start // #32782 指示者テーブル関連削除 start
// List<TaskDirectionsDto> taskDirectionsDtoList = null;
// int maxProgress = 0;
// if (taskKey == null) {
// taskDirectionsDtoList = mTaskDirectionsDao.getSendableTaskData(operationId);
// maxProgress = 40;
// } else {
// taskDirectionsDtoList = mTaskDirectionsDao.getSendableTaskData(operationId, taskKey);
// maxProgress = 100;
// }
//
// if (taskDirectionsDtoList != null && taskDirectionsDtoList.size() > 0) {
// //プログレスを40%進行させるための計算
// int progress = maxProgress / taskDirectionsDtoList.size();
//
// for (TaskDirectionsDto dto : taskDirectionsDtoList) {
// File zipFile = null;
// if (dto.attachedFileSendFlg) {
// String fileName = null;
// zipFile = createAttachedFile(operationId, dto.taskKey, true);
// if (zipFile != null) {
// fileName = FileUtil.getFilenameWithoutExt(zipFile.getName());
// }
// dto.localAttachedFileName = fileName != null ? SecurityUtil.getMd5Hash(fileName) : null;
// }
//
// AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).sendTaskData
// (cache.getMemberInfo().sid, String.valueOf(operationId), dto.taskKey, dto.delFlg ? "1" : "0", String.valueOf(0), dto.taskHotSpotInfo, dto.jsonData, zipFile, dto.attachedFileSendFlg, null);
//
// if (zipFile != null) {
// zipFile.delete();
// }
// if (dto.delFlg) {
// // 物理削除
// mTaskDao.deleteTaskData(dto.taskKey, true);
// } else {
// dto.dataSendFlg = false;
// dto.attachedFileSendFlg = false;
// mTaskDirectionsDao.update(dto);
// }
// progressCallback.callback(new Integer(progress));
// }
// }
List<TaskReportDto> taskReportDtoList = null; List<TaskReportDto> taskReportDtoList = null;
int maxProgress = 0; int maxProgress = 0;
if (taskKey == null) { if (taskKey == null) {
...@@ -1617,15 +1301,15 @@ public class OperationLogic extends AbstractLogic { ...@@ -1617,15 +1301,15 @@ public class OperationLogic extends AbstractLogic {
} else { } else {
dto.dataSendFlg = false; dto.dataSendFlg = false;
dto.attachedFileSendFlg = false; dto.attachedFileSendFlg = false;
// 0305 start // #32782 指示者テーブル関連削除 start
dto.reportorFlag = false; dto.reporterFlag = false;
// 0305 end // #32782 指示者テーブル関連削除 end
mTaskReportDao.update(dto); mTaskReportDao.update(dto);
} }
progressCallback.callback(new Integer(progress)); progressCallback.callback(new Integer(progress));
} }
} }
// 0305 end // #32782 指示者テーブル関連削除 end
} }
/** /**
...@@ -1645,74 +1329,110 @@ public class OperationLogic extends AbstractLogic { ...@@ -1645,74 +1329,110 @@ public class OperationLogic extends AbstractLogic {
maxProgress = 100; maxProgress = 100;
} }
if (taskReportDtoList != null && taskReportDtoList.size() > 0) { if (taskReportDtoList != null && taskReportDtoList.size() > 0) {
OperationDto operationDto = mOperationDao.getOperation(operationId); // #32782 指示者テーブル関連削除 start
// 指示者の場合
int allSendCount = mTaskReportSendDao.getSendableTaskReportSendDataCount(operationId, taskKey); if (ABVDataCache.getInstance().getMemberInfo().operationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
int progress = maxProgress / allSendCount; //プログレスを40%進行させるための計算
int progress = maxProgress / taskReportDtoList.size();
for (TaskReportDto taskReportDto : taskReportDtoList) {
List<TaskReportSendDto> taskReportSendDtoList = mTaskReportSendDao.getSendableTaskReportSendData(taskReportDto.taskKey);
int lastTaskReportSendId = mTaskReportSendDao.getLastTaskReportSendId(taskReportDto.taskKey);
for (TaskReportSendDto taskReportSendDto : taskReportSendDtoList) {
// 履歴なし:元のattachedFileSendFlg
// 履歴追加:古い履歴はtrue
// 履歴更新:true、ファイルに変更が無くてもzipファイル作成
if (taskReportSendDto.taskReportSendId < lastTaskReportSendId || operationDto.reportUpdateType == Constant.OperationUpdateType.HISTORY_UPDATE) {
taskReportDto.attachedFileSendFlg = true;
}
for (TaskReportDto dto : taskReportDtoList) {
File zipFile = null; File zipFile = null;
if (dto.attachedFileSendFlg) {
if (taskReportDto.attachedFileSendFlg) {
String fileName = null; String fileName = null;
zipFile = createAttachedFileForSend(operationId, taskReportDto.taskKey, taskReportSendDto.taskReportSendId, false, 0, ""); zipFile = createAttachedFile(operationId, dto.taskKey, true);
if (zipFile != null) { if (zipFile != null) {
fileName = FileUtil.getFilenameWithoutExt(zipFile.getName()); fileName = FileUtil.getFilenameWithoutExt(zipFile.getName());
} }
taskReportDto.localAttachedFileName = fileName != null ? SecurityUtil.getMd5Hash(fileName) : null; dto.localAttachedFileName = fileName != null ? SecurityUtil.getMd5Hash(fileName) : null;
} }
try { AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).sendTaskData
AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).sendTaskData( (cache.getMemberInfo().sid, String.valueOf(operationId), dto.taskKey, dto.delFlg ? "1" : "0", String.valueOf(0), dto.taskHotSpotInfo, dto.jsonData, zipFile, dto.attachedFileSendFlg, null);
cache.getMemberInfo().sid,
String.valueOf(operationId), if (zipFile != null) {
taskReportDto.taskKey, zipFile.delete();
taskReportDto.delFlg ? "1" : "0", String.valueOf(1), }
taskReportDto.taskHotSpotInfo, if (dto.delFlg) {
taskReportSendDto.jsonData, // 物理削除
zipFile, mTaskDao.deleteTaskData(dto.taskKey, true);
taskReportDto.attachedFileSendFlg, } else {
taskReportSendDto.saveDate dto.dataSendFlg = false;
); dto.attachedFileSendFlg = false;
progressCallback.callback(new Integer(progress)); mTaskReportDao.update(dto);
mTaskReportSendDao.deleteBySendId(taskReportSendDto.taskReportSendId);
FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, taskReportSendDto.taskReportSendId));
} catch (Exception ex) {
throw ex;
} finally {
if (zipFile != null) {
zipFile.delete();
}
} }
progressCallback.callback(new Integer(progress));
} }
} else {
OperationDto operationDto = mOperationDao.getOperation(operationId);
if (taskReportDto.delFlg) { int allSendCount = mTaskReportSendDao.getSendableTaskReportSendDataCount(operationId, taskKey);
// 物理削除 int progress = maxProgress / allSendCount;
mTaskDao.deleteTaskData(taskReportDto.taskKey, false);
} else { for (TaskReportDto taskReportDto : taskReportDtoList) {
if (operationDto.reportUpdateType == Constant.OperationUpdateType.HISTORY_ADD) { List<TaskReportSendDto> taskReportSendDtoList = mTaskReportSendDao.getSendableTaskReportSendData(taskReportDto.taskKey);
taskReportDto.jsonData = ""; int lastTaskReportSendId = mTaskReportSendDao.getLastTaskReportSendId(taskReportDto.taskKey);
for (TaskReportSendDto taskReportSendDto : taskReportSendDtoList) {
// 履歴なし:元のattachedFileSendFlg
// 履歴追加:古い履歴はtrue
// 履歴更新:true、ファイルに変更が無くてもzipファイル作成
if (taskReportSendDto.taskReportSendId < lastTaskReportSendId || operationDto.reportUpdateType == Constant.OperationUpdateType.HISTORY_UPDATE) {
taskReportDto.attachedFileSendFlg = true;
}
File zipFile = null;
if (taskReportDto.attachedFileSendFlg) {
String fileName = null;
zipFile = createAttachedFileForSend(operationId, taskReportDto.taskKey, taskReportSendDto.taskReportSendId, false, 0, "");
if (zipFile != null) {
fileName = FileUtil.getFilenameWithoutExt(zipFile.getName());
}
taskReportDto.localAttachedFileName = fileName != null ? SecurityUtil.getMd5Hash(fileName) : null;
}
try {
AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).sendTaskData(
cache.getMemberInfo().sid,
String.valueOf(operationId),
taskReportDto.taskKey,
taskReportDto.delFlg ? "1" : "0", String.valueOf(1),
taskReportDto.taskHotSpotInfo,
taskReportSendDto.jsonData,
zipFile,
taskReportDto.attachedFileSendFlg,
taskReportSendDto.saveDate
);
progressCallback.callback(new Integer(progress));
mTaskReportSendDao.deleteBySendId(taskReportSendDto.taskReportSendId);
FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, taskReportSendDto.taskReportSendId));
} catch (Exception ex) {
throw ex;
} finally {
if (zipFile != null) {
zipFile.delete();
}
}
} }
taskReportDto.dataSendFlg = false; if (taskReportDto.delFlg) {
taskReportDto.attachedFileSendFlg = false; // 物理削除
// 0305 start mTaskDao.deleteTaskData(taskReportDto.taskKey, false);
taskReportDto.reportorFlag = true; } else {
// 0305 end if (operationDto.reportUpdateType == Constant.OperationUpdateType.HISTORY_ADD) {
mTaskReportDao.update(taskReportDto); taskReportDto.jsonData = "";
}
taskReportDto.dataSendFlg = false;
taskReportDto.attachedFileSendFlg = false;
// #32782 指示者テーブル関連削除 start
taskReportDto.reporterFlag = true;
// #32782 指示者テーブル関連削除 end
mTaskReportDao.update(taskReportDto);
}
} }
} }
// #32782 指示者テーブル関連削除 end
} }
} }
......
...@@ -143,9 +143,9 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -143,9 +143,9 @@ public class OperationListActivity extends ABVUIActivity {
private Dialog mPanoEntryDialog; private Dialog mPanoEntryDialog;
private OperationContentDao mOperationContentDao = AbstractDao.getDao(OperationContentDao.class); private OperationContentDao mOperationContentDao = AbstractDao.getDao(OperationContentDao.class);
// 0301 start // #32782 指示者テーブル関連削除 start
// private TaskDirectionsDao mTaskDirectionsDao = AbstractDao.getDao(TaskDirectionsDao.class); // private TaskDirectionsDao mTaskDirectionsDao = AbstractDao.getDao(TaskDirectionsDao.class);
// 0301 end // #32782 指示者テーブル関連削除 end
private TaskReportDao mTaskReportDao = AbstractDao.getDao(TaskReportDao.class); private TaskReportDao mTaskReportDao = AbstractDao.getDao(TaskReportDao.class);
private RoutineTaskReportDao mRoutineTaskReportDao = AbstractDao.getDao(RoutineTaskReportDao.class); private RoutineTaskReportDao mRoutineTaskReportDao = AbstractDao.getDao(RoutineTaskReportDao.class);
private OperationLogic mOperationLogic = AbstractLogic.getLogic(OperationLogic.class); private OperationLogic mOperationLogic = AbstractLogic.getLogic(OperationLogic.class);
...@@ -1044,17 +1044,16 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1044,17 +1044,16 @@ public class OperationListActivity extends ABVUIActivity {
progress = 40 / json.taskDtoList.size(); progress = 40 / json.taskDtoList.size();
} }
// 0305 start // #32782 指示者テーブル関連削除 start
// JSONObject taskDirectionJson;
JSONObject taskReportJson; JSONObject taskReportJson;
for (TaskDto taskDto : json.taskDtoList) { for (TaskDto taskDto : json.taskDtoList) {
String directionsAttachedFileName = taskDto.taskDirectionsDto.attachedFileName; String directionsAttachedFileName = taskDto.taskDirectionsDto.attachedFileName;
String reportAttachedFileName = taskDto.taskReportDto.attachedFileName; String reportAttachedFileName = taskDto.taskReportDto.attachedFileName;
// 0305 start // #32782 指示者テーブル関連削除 start
taskReportJson = new JSONObject(taskDto.taskDirectionsDto.jsonData); taskReportJson = new JSONObject(taskDto.taskDirectionsDto.jsonData);
taskReportJson.put(ABookKeys.TASK_STATUS, taskDto.taskStatus); taskReportJson.put(ABookKeys.TASK_STATUS, taskDto.taskStatus);
// 0305 end // #32782 指示者テーブル関連削除 end
int localTaskIndex = localTaskList.indexOf(taskDto); int localTaskIndex = localTaskList.indexOf(taskDto);
if (localTaskIndex >= 0) { if (localTaskIndex >= 0) {
...@@ -1065,17 +1064,17 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1065,17 +1064,17 @@ public class OperationListActivity extends ABVUIActivity {
return null; return null;
} }
// 0305 start // #32782 指示者テーブル関連削除 start
// 作業更新 // 作業更新
mOperationLogic.updateTaskDirections(taskDto.taskKey, taskDto.operationId, operationContentDto.contentId, mOperationLogic.updateTaskReport(taskDto.taskKey, taskDto.operationId, operationContentDto.contentId,
taskReportJson, taskDto.taskHotSpotInfo, directionsAttachedFileName, false, false); taskReportJson, directionsAttachedFileName, false, false, taskDto.taskHotSpotInfo);
// 0305 end
localTaskList.remove(taskDto); localTaskList.remove(taskDto);
// 報告データが存在すると作業報告を更新する // 報告データが存在すると作業報告を更新する
if (taskDto.taskReportDto.jsonData != null) { if (taskDto.taskReportDto.jsonData != null) {
mOperationLogic.updateTaskReport(taskDto.taskKey, taskDto.operationId, operationContentDto.contentId, mOperationLogic.updateTaskReport(taskDto.taskKey, taskDto.operationId, operationContentDto.contentId,
new JSONObject(taskDto.taskReportDto.jsonData), reportAttachedFileName, false, false); taskReportJson, reportAttachedFileName, false, false, taskDto.taskHotSpotInfo);
} }
// #32782 指示者テーブル関連削除 end
} else { } else {
// 添付ファイルが存在する場合、取得して解凍する。 // 添付ファイルが存在する場合、取得して解凍する。
refreshTaskFile(operationId, operationContentDto.contentId, taskDto.taskId, taskDto.taskKey, directionsAttachedFileName, reportAttachedFileName); refreshTaskFile(operationId, operationContentDto.contentId, taskDto.taskId, taskDto.taskKey, directionsAttachedFileName, reportAttachedFileName);
...@@ -1083,19 +1082,19 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1083,19 +1082,19 @@ public class OperationListActivity extends ABVUIActivity {
return null; return null;
} }
// 0301 start // #32782 指示者テーブル関連削除 start
// 作業登録 // 作業登録
mOperationLogic.insertTaskDirections(taskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId, mOperationLogic.insertTaskReport(taskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId,
taskReportJson, taskDto.taskHotSpotInfo, directionsAttachedFileName, false, false); taskReportJson, directionsAttachedFileName, false, false, taskDto.taskHotSpotInfo);
// 0305 end
if (taskDto.taskReportDto.jsonData != null) { if (taskDto.taskReportDto.jsonData != null) {
mOperationLogic.insertTaskReport(taskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId, mOperationLogic.insertTaskReport(taskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId,
new JSONObject(taskDto.taskReportDto.jsonData), reportAttachedFileName, false, false); taskReportJson, reportAttachedFileName, false, false, taskDto.taskHotSpotInfo);
} }
// #32782 指示者テーブル関連削除 end
} }
progressCallback.callback(new Integer(progress)); progressCallback.callback(new Integer(progress));
} }
// 0305 end // #32782 指示者テーブル関連削除 end
// サーバーから取得した作業情報がローカルに存在しないので削除する // サーバーから取得した作業情報がローカルに存在しないので削除する
for (TaskDto taskDto : localTaskList) { for (TaskDto taskDto : localTaskList) {
...@@ -1115,10 +1114,9 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1115,10 +1114,9 @@ public class OperationListActivity extends ABVUIActivity {
// 既存の添付ディレクトリ削除 // 既存の添付ディレクトリ削除
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey)); FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
// 0305 start // #32782 指示者テーブル関連削除 start
// String directionsLocalAttachedFileName = mTaskDirectionsDao.getTaskDirectionsAttachedFileName(taskKey);
String directionsLocalAttachedFileName = mTaskReportDao.getTaskReportAttachedFileName(taskKey); String directionsLocalAttachedFileName = mTaskReportDao.getTaskReportAttachedFileName(taskKey);
// 0305 end // #32782 指示者テーブル関連削除 end
String reportLocalAttachedFileName = mTaskReportDao.getTaskReportAttachedFileName(taskKey); String reportLocalAttachedFileName = mTaskReportDao.getTaskReportAttachedFileName(taskKey);
int count = 0; int count = 0;
boolean getDirectionsFileFlg = directionsAttachedFileName != null && !directionsAttachedFileName.equals(directionsLocalAttachedFileName); boolean getDirectionsFileFlg = directionsAttachedFileName != null && !directionsAttachedFileName.equals(directionsLocalAttachedFileName);
......
...@@ -66,78 +66,92 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -66,78 +66,92 @@ public class ABookCheckWebViewHelper extends ABookHelper {
public void doABookCheckParam(ABVContentViewActivity context, String cmd, String taskKey, int reportUpdateType, Map<String, String> param, long operationId, String contentPath, long contentId, boolean routineTaskReportFlg, Callback finishCallback) throws IOException { public void doABookCheckParam(ABVContentViewActivity context, String cmd, String taskKey, int reportUpdateType, Map<String, String> param, long operationId, String contentPath, long contentId, boolean routineTaskReportFlg, Callback finishCallback) throws IOException {
int taskReportSendId = 0; int taskReportSendId = 0;
mFinishCallback = finishCallback; mFinishCallback = finishCallback;
int mOperationAuthLevel = ABVDataCache.getInstance().getMemberInfo().operationAuthLevel;
switch (cmd) { switch (cmd) {
case ABookKeys.CMD_INSERT_TASK_DIRECTIONS: case ABookKeys.CMD_INSERT_TASK_DIRECTIONS:
insertOrUpdateTaskDirections(taskKey, operationId, contentId, param, contentPath, true); // #32782 指示者テーブル関連削除 start
copyTaskAttachedMovie(operationId, contentId, taskKey); // TODO TASK_DIRECTIONS の削除
sendTaskDirectionsData(context, operationId, taskKey);
break;
case ABookKeys.CMD_UPDATE_TASK_DIRECTIONS:
insertOrUpdateTaskDirections(taskKey, operationId, contentId, param, contentPath, false);
copyTaskAttachedMovie(operationId, contentId, taskKey);
sendTaskDirectionsData(context, operationId, taskKey);
break;
case ABookKeys.CMD_DELETE_TASK_DIRECTIONS:
mOperationLogic.deleteTaskDirections(operationId, contentId, taskKey);
mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, true);
copyTaskAttachedMovie(operationId, contentId, taskKey);
sendTaskDirectionsData(context, operationId, taskKey);
break;
case ABookKeys.CMD_MOVE_HOT_SPOT:
mOperationLogic.updateTaskHotspot(taskKey, param);
mOperationLogic.createHopSpotJson(operationId, contentPath);
break;
case ABookKeys.CMD_INSERT_TASK_REPORT: case ABookKeys.CMD_INSERT_TASK_REPORT:
insertOrUpdateTaskReport(taskKey, reportUpdateType, operationId, contentId, param, contentPath, true, routineTaskReportFlg); insertOrUpdateTaskReport(taskKey, reportUpdateType, operationId, contentId, param, contentPath, true, routineTaskReportFlg);
sendTaskReportData(context, operationId, taskKey, reportUpdateType); if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
copyTaskAttachedMovie(operationId, contentId, taskKey);
sendTaskReportData(context, operationId, taskKey, -1, true);
} else {
sendTaskReportData(context, operationId, taskKey, reportUpdateType, false);
}
// #32782 指示者テーブル関連削除 end
break; break;
// TODO TASK_DIRECTIONS の削除
case ABookKeys.CMD_UPDATE_TASK_DIRECTIONS:
case ABookKeys.CMD_UPDATE_TASK_REPORT: case ABookKeys.CMD_UPDATE_TASK_REPORT:
insertOrUpdateTaskReport(taskKey, reportUpdateType, operationId, contentId, param, contentPath, false, routineTaskReportFlg); insertOrUpdateTaskReport(taskKey, reportUpdateType, operationId, contentId, param, contentPath, false, routineTaskReportFlg);
sendTaskReportData(context, operationId, taskKey, reportUpdateType);
if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
copyTaskAttachedMovie(operationId, contentId, taskKey);
sendTaskReportData(context, operationId, taskKey, -1, true);
} else {
sendTaskReportData(context, operationId, taskKey, reportUpdateType, false);
}
break; break;
// #32782 指示者テーブル関連削除 start
case ABookKeys.CMD_DELETE_TASK_DIRECTIONS:
// TODO TASK_DIRECTIONS の削除
case ABookKeys.CMD_DELETE_TASK_REPORT: case ABookKeys.CMD_DELETE_TASK_REPORT:
int taskReportId = 0; int taskReportId = 0;
String reportStartDate = ""; String reportStartDate = "";
boolean sendTaskReportDataFlg = false; boolean sendTaskReportDataFlg = false;
if (routineTaskReportFlg) { if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
taskReportId = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_ID));
reportStartDate = param.get(ABookKeys.REPORT_START_DATE);
reportStartDate = reportStartDate.replace("T", " ");
mOperationLogic.deleteRoutineTaskReport(operationId, contentId, taskKey, taskReportId, reportStartDate);
mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, false);
copyRoutineTaskReportAttachedMovie(operationId, contentId, taskKey, taskReportId, reportStartDate);
RoutineTaskReportDto routineTaskTaskReportDto = mOperationLogic.getRoutineTaskReportUtc(taskKey, taskReportId, reportStartDate);
if(routineTaskTaskReportDto != null && reportUpdateType != Constant.OperationUpdateType.HISTORY_ADD) {
sendTaskReportDataFlg = true;
}
} else {
mOperationLogic.deleteTaskReport(operationId, contentId, taskKey); mOperationLogic.deleteTaskReport(operationId, contentId, taskKey);
mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, false); mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, false);
copyTaskAttachedMovie(operationId, contentId, taskKey); copyTaskAttachedMovie(operationId, contentId, taskKey);
sendTaskReportData(context, operationId, taskKey, -1, true);
} else {
if (routineTaskReportFlg) {
taskReportId = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_ID));
reportStartDate = param.get(ABookKeys.REPORT_START_DATE);
reportStartDate = reportStartDate.replace("T", " ");
mOperationLogic.deleteRoutineTaskReport(operationId, contentId, taskKey, taskReportId, reportStartDate);
mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, false);
copyRoutineTaskReportAttachedMovie(operationId, contentId, taskKey, taskReportId, reportStartDate);
RoutineTaskReportDto routineTaskTaskReportDto = mOperationLogic.getRoutineTaskReportUtc(taskKey, taskReportId, reportStartDate);
if (routineTaskTaskReportDto != null && reportUpdateType != Constant.OperationUpdateType.HISTORY_ADD) {
sendTaskReportDataFlg = true;
}
} else {
mOperationLogic.deleteTaskReport(operationId, contentId, taskKey);
mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, false);
copyTaskAttachedMovie(operationId, contentId, taskKey);
TaskReportDto taskReportDto = mOperationLogic.getTaskReport(taskKey); TaskReportDto taskReportDto = mOperationLogic.getTaskReport(taskKey);
if(taskReportDto != null && reportUpdateType != Constant.OperationUpdateType.HISTORY_ADD) { if (taskReportDto != null && reportUpdateType != Constant.OperationUpdateType.HISTORY_ADD) {
sendTaskReportDataFlg = true; sendTaskReportDataFlg = true;
}
} }
}
if(sendTaskReportDataFlg) { if (sendTaskReportDataFlg) {
if (reportUpdateType == Constant.OperationUpdateType.HISTORY_NO) { if (reportUpdateType == Constant.OperationUpdateType.HISTORY_NO) {
taskReportSendId = mOperationLogic.getLastTaskReportSendId(taskKey); taskReportSendId = mOperationLogic.getLastTaskReportSendId(taskKey);
mOperationLogic.updateTaskReportSend(taskKey, taskReportId, reportStartDate, null, true); mOperationLogic.updateTaskReportSend(taskKey, taskReportId, reportStartDate, null, true);
deleteReportTaskSendFiles(operationId, taskKey, taskReportSendId); deleteReportTaskSendFiles(operationId, taskKey, taskReportSendId);
} else if (reportUpdateType == Constant.OperationUpdateType.HISTORY_UPDATE) { } else if (reportUpdateType == Constant.OperationUpdateType.HISTORY_UPDATE) {
mOperationLogic.insertTaskReportSend(taskKey, taskReportId, reportStartDate, null, true); mOperationLogic.insertTaskReportSend(taskKey, taskReportId, reportStartDate, null, true);
} }
sendTaskReportData(context, operationId, taskKey, reportUpdateType); sendTaskReportData(context, operationId, taskKey, reportUpdateType, false);
} else { } else {
mFinishCallback.callback(false); mFinishCallback.callback(false);
}
} }
break; break;
// #32782 指示者テーブル関連削除 end
case ABookKeys.CMD_MOVE_HOT_SPOT:
mOperationLogic.updateTaskHotspot(taskKey, param);
mOperationLogic.createHopSpotJson(operationId, contentPath);
break;
case ABookKeys.CMD_CANCEL_TASK_DIRECTIONS: case ABookKeys.CMD_CANCEL_TASK_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));
...@@ -154,9 +168,9 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -154,9 +168,9 @@ public class ABookCheckWebViewHelper extends ABookHelper {
* @param taskKey タスクキー * @param taskKey タスクキー
*/ */
private void sendTaskDirectionsData(final ABVContentViewActivity context, final long operationId, final String taskKey) { private void sendTaskDirectionsData(final ABVContentViewActivity context, final long operationId, final String taskKey) {
Logger.d(TAG, "[sendTaskDirectionsData] operationId=%s, taskKey=%s", operationId, taskKey); // #32782 指示者テーブル関連削除 start
//作業指示送信時には「reportUpdateType」値が必要ではないので、「-1」に設定 // TODO Delete mothod
sendTaskData(context, operationId, taskKey, -1, true); // #32782 指示者テーブル関連削除 end
} }
/** /**
...@@ -166,9 +180,9 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -166,9 +180,9 @@ public class ABookCheckWebViewHelper extends ABookHelper {
* @param taskKey タスクキー * @param taskKey タスクキー
* @param reportUpdateType 作業履歴タイプ * @param reportUpdateType 作業履歴タイプ
*/ */
private void sendTaskReportData(final ABVContentViewActivity context, final long operationId, final String taskKey, final int reportUpdateType) { private void sendTaskReportData(final ABVContentViewActivity context, final long operationId, final String taskKey, final int reportUpdateType, final boolean isDirection) {
Logger.d(TAG, "[sendTaskReportData] operationId=%s, taskKey=%s", operationId, taskKey); Logger.d(TAG, "[sendTaskReportData] operationId=%s, taskKey=%s", operationId, taskKey);
sendTaskData(context, operationId, taskKey, reportUpdateType, false); sendTaskData(context, operationId, taskKey, reportUpdateType, isDirection);
} }
/** /**
...@@ -207,7 +221,9 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -207,7 +221,9 @@ public class ABookCheckWebViewHelper extends ABookHelper {
boolean isError = false; boolean isError = false;
try { try {
if (isDirections) { if (isDirections) {
mOperationLogic.sendTaskDirectionsData(operationId, taskKey, progressCallback); // #32782 指示者テーブル関連削除 start
mOperationLogic.sendTaskReportSendData(operationId, taskKey, progressCallback);
// #32782 指示者テーブル関連削除 end
mOperationLogic.updateSyncOperation(operationId, true); mOperationLogic.updateSyncOperation(operationId, true);
} else { } else {
OperationDto operationDto = mOperationLogic.getOperation(operationId); OperationDto operationDto = mOperationLogic.getOperation(operationId);
...@@ -327,76 +343,93 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -327,76 +343,93 @@ public class ABookCheckWebViewHelper extends ABookHelper {
* @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 insertOrUpdateTaskDirections(String taskKey, long operationId, long contentId, Map<String, String> param, String contentPath, boolean insertFlg) throws IOException {
boolean attachedChangeFlag = param.get(ABookKeys.ATTACHED_CHANGE_FLAG).equals("1") ? true : false; // #32782 指示者テーブル関連削除 start
String taskDirections = param.get(ABookKeys.TASK_DIRECTIONS); // TODO Delete method
JSONObject taskDirectionsJson = new JSONObject(taskDirections); // #32782 指示者テーブル関連削除 end
String taskHotSpotInfo = param.get(ABookKeys.HOT_SPOT);
if (insertFlg) {
mOperationLogic.insertTaskDirections(taskKey, operationId, contentId, taskDirectionsJson, taskHotSpotInfo, null, attachedChangeFlag, true);
mOperationLogic.createJsonForOperationContent(operationId, 0, contentPath, true);
} else {
mOperationLogic.updateTaskDirections(taskKey, operationId, contentId, taskDirectionsJson, taskHotSpotInfo, null, attachedChangeFlag, true);
mOperationLogic.createJsonForOperationContent(operationId, 0, contentPath, true);
}
} }
private void insertOrUpdateTaskReport(String taskKey, int reportUpdateType, long operationId, long contentId, Map<String, String> param, String contentPath, boolean insertFlg, boolean routineTaskReportFlg) throws IOException { private void insertOrUpdateTaskReport(String taskKey, int reportUpdateType, long operationId, long contentId, Map<String, String> param, String contentPath, boolean insertFlg, boolean routineTaskReportFlg) throws IOException {
int taskReportSendId = 0; int taskReportSendId = 0;
// #32782 指示者テーブル関連削除 start
// 指示者か報告者か判断
int mOperationAuthLevel = ABVDataCache.getInstance().getMemberInfo().operationAuthLevel;
boolean attachedChangeFlag = param.get(ABookKeys.ATTACHED_CHANGE_FLAG).equals("1") ? true : false; boolean attachedChangeFlag = param.get(ABookKeys.ATTACHED_CHANGE_FLAG).equals("1") ? true : false;
String taskReport = param.get(ABookKeys.TASK_REPORT); String taskReport = param.get(ABookKeys.TASK_REPORT);
// TODO この処理後、削除
if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
taskReport = param.get(ABookKeys.TASK_DIRECTIONS);
}
JSONObject taskReportJson = new JSONObject(taskReport); JSONObject taskReportJson = new JSONObject(taskReport);
int taskReportId = 0;
String reportStartDate = "";
if (routineTaskReportFlg) { String taskHotSpotInfo = null;
taskReportId = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_ID)); if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
reportStartDate = param.get(ABookKeys.REPORT_START_DATE); taskHotSpotInfo = param.get(ABookKeys.HOT_SPOT);
reportStartDate = reportStartDate.replace("T", " "); }
//reportStartDate = DateTimeUtil.toString(DateTimeUtil.toDate(reportStartDate, "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen), DateTimeFormat.yyyyMMddHHmmss_hyphen); // #32782 指示者テーブル関連削除 end
RoutineTaskReportDto routineTaskTaskReportDto = mOperationLogic.getRoutineTaskReportUtc(taskKey, taskReportId, reportStartDate); int taskReportId = 0;
routineTaskTaskReportDto.jsonData = taskReport; String reportStartDate = "";
mOperationLogic.updateRoutineTaskReport(operationId, contentId, routineTaskTaskReportDto, attachedChangeFlag, true, insertFlg, true); // 指示者の場合下記の処理を行わない
} else { if (mOperationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
if (insertFlg) { if (insertFlg) {
mOperationLogic.insertTaskReport(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true); mOperationLogic.insertTaskReport(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true, taskHotSpotInfo);
mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, false);
} else { } else {
mOperationLogic.updateTaskReport(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true); mOperationLogic.updateTaskReport(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true, taskHotSpotInfo);
mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, false);
} }
}
if (routineTaskReportFlg) {
mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, false);
copyRoutineTaskReportAttachedMovie(operationId, contentId, taskKey, taskReportId, reportStartDate);
} else { } else {
mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, false); if (routineTaskReportFlg) {
copyTaskAttachedMovie(operationId, contentId, taskKey); 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);
if (reportUpdateType == Constant.OperationUpdateType.HISTORY_NO) { RoutineTaskReportDto routineTaskTaskReportDto = mOperationLogic.getRoutineTaskReportUtc(taskKey, taskReportId, reportStartDate);
//データ無い場合は中でinsertされる routineTaskTaskReportDto.jsonData = taskReport;
taskReportSendId = mOperationLogic.updateTaskReportSend(taskKey, taskReportId, reportStartDate, taskReportJson, false);
}else { mOperationLogic.updateRoutineTaskReport(operationId, contentId, routineTaskTaskReportDto, attachedChangeFlag, true, insertFlg, true);
taskReportSendId = mOperationLogic.insertTaskReportSend(taskKey, taskReportId, reportStartDate, taskReportJson, false); } else {
} if (insertFlg) {
mOperationLogic.insertTaskReport(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true, taskHotSpotInfo);
} else {
mOperationLogic.updateTaskReport(taskKey, operationId, contentId, taskReportJson, null, attachedChangeFlag, true, taskHotSpotInfo);
}
}
if (reportUpdateType == Constant.OperationUpdateType.HISTORY_ADD) {
if (routineTaskReportFlg) { if (routineTaskReportFlg) {
mOperationLogic.initialRoutineTaskReport(operationId, contentId, taskKey, taskReportId, reportStartDate); mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, false);
mOperationLogic.createRoutineTaskReportJson(operationId, contentPath); copyRoutineTaskReportAttachedMovie(operationId, contentId, taskKey, taskReportId, reportStartDate);
} else { } else {
mOperationLogic.initialTaskReport(operationId, contentId, taskKey); mOperationLogic.createJsonForOperationContent(operationId, reportUpdateType, contentPath, false);
mOperationLogic.createTaskReportJson(operationId, contentPath); copyTaskAttachedMovie(operationId, contentId, taskKey);
} }
}
copyReportTaskSendFiles(operationId, taskKey, taskReportSendId, routineTaskReportFlg, taskReportId, reportStartDate); if (reportUpdateType == Constant.OperationUpdateType.HISTORY_NO) {
//データ無い場合は中でinsertされる
taskReportSendId = mOperationLogic.updateTaskReportSend(taskKey, taskReportId, reportStartDate, taskReportJson, false);
} else {
taskReportSendId = mOperationLogic.insertTaskReportSend(taskKey, taskReportId, reportStartDate, taskReportJson, false);
}
if (reportUpdateType == Constant.OperationUpdateType.HISTORY_ADD) { if (reportUpdateType == Constant.OperationUpdateType.HISTORY_ADD) {
// 作業報告のディレクトリ削除 if (routineTaskReportFlg) {
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey)); mOperationLogic.initialRoutineTaskReport(operationId, contentId, taskKey, taskReportId, reportStartDate);
FileUtil.delete(ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, false)); mOperationLogic.createRoutineTaskReportJson(operationId, contentPath);
} else {
mOperationLogic.initialTaskReport(operationId, contentId, taskKey);
mOperationLogic.createTaskReportJson(operationId, contentPath);
}
}
copyReportTaskSendFiles(operationId, taskKey, taskReportSendId, routineTaskReportFlg, taskReportId, reportStartDate);
if (reportUpdateType == Constant.OperationUpdateType.HISTORY_ADD) {
// 作業報告のディレクトリ削除
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
FileUtil.delete(ABVEnvironment.getInstance().getOperationDirectionOrReportDirPath(operationId, taskKey, false));
}
} }
} }
......
...@@ -89,6 +89,7 @@ import jp.agentec.abook.abv.bl.acms.client.json.content.PageInfoJSON; ...@@ -89,6 +89,7 @@ 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;
...@@ -5184,25 +5185,30 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5184,25 +5185,30 @@ public class ContentViewActivity extends ABVContentViewActivity {
switch(cmd){ switch(cmd){
case ABookKeys.CMD_INSERT_TASK_DIRECTIONS: case ABookKeys.CMD_INSERT_TASK_DIRECTIONS:
case ABookKeys.CMD_UPDATE_TASK_DIRECTIONS: case ABookKeys.CMD_UPDATE_TASK_DIRECTIONS:
JSONObject hotspot = new JSONObject(checkParam.get(ABookKeys.HOT_SPOT)); // #32782 指示者テーブル関連削除 start
taskCode = hotspot.getString(ABookKeys.TASK_CODE); case ABookKeys.CMD_INSERT_TASK_REPORT:
case ABookKeys.CMD_UPDATE_TASK_REPORT:
operationTaskLayout.setIconStatus(taskKey, true); case ABookKeys.CMD_DELETE_TASK_REPORT:
operationTaskLayout.currentTaskDto.taskKey = taskKey; if (ABVDataCache.getInstance().getMemberInfo().operationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
operationTaskLayout.currentTaskDto.taskCode = taskCode; JSONObject hotspot = new JSONObject(checkParam.get(ABookKeys.HOT_SPOT));
operationTaskLayout.addOperationTaskIcon(operationTaskLayout.currentLayout, operationTaskLayout.currentTaskDto);
//hideOperationTaskLayout(); taskCode = hotspot.getString(ABookKeys.TASK_CODE);
operationTaskLayout.setIconStatus(taskKey, true);
operationTaskLayout.currentTaskDto.taskKey = taskKey;
operationTaskLayout.currentTaskDto.taskCode = taskCode;
operationTaskLayout.addOperationTaskIcon(operationTaskLayout.currentLayout, operationTaskLayout.currentTaskDto);
//hideOperationTaskLayout();
} else {
operationTaskLayout.setIconStatus(taskKey, false);
}
// #32782 指示者テーブル関連削除 end
break; break;
case ABookKeys.CMD_DELETE_TASK_DIRECTIONS: case ABookKeys.CMD_DELETE_TASK_DIRECTIONS:
operationTaskLayout.setIconStatus(taskKey, true); operationTaskLayout.setIconStatus(taskKey, true);
//hideOperationTaskLayout(); //hideOperationTaskLayout();
break; break;
case ABookKeys.CMD_INSERT_TASK_REPORT:
case ABookKeys.CMD_UPDATE_TASK_REPORT:
case ABookKeys.CMD_DELETE_TASK_REPORT:
operationTaskLayout.setIconStatus(taskKey, false);
//hideOperationTaskLayout();
break;
default: default:
operationTaskLayout.setIconStatus(taskKey, false); operationTaskLayout.setIconStatus(taskKey, false);
break; break;
......
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