Commit b365f57a by Jeong Gilmo

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

parent fc9484dd
......@@ -28,9 +28,15 @@ public class OperationDataJSON extends AcmsCommonJSON {
public static final String TaskCode = "taskCode";
public static final String TaskStatus = "taskStatus";
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 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 Task = "task";
......@@ -50,10 +56,9 @@ public class OperationDataJSON extends AcmsCommonJSON {
for (int i = 0; i < taskList.length(); i++) {
JSONObject taskJson = taskList.getJSONObject(i);
TaskDto dto = new TaskDto();
// 0305 start
// dto.taskDirectionsDto = new TaskDirectionsDto();
// #32782 指示者テーブル関連削除 start
dto.taskDirectionsDto = new TaskReportDto();
// 0305 end
// #32782 指示者テーブル関連削除 end
dto.taskReportDto = new TaskReportDto();
dto.operationId = taskJson.getLong(OperationId);
......
......@@ -41,10 +41,9 @@ public class RoutineTaskDataJSON extends OperationDataJSON {
for (int i = 0; i < taskList.length(); i++) {
JSONObject taskJson = taskList.getJSONObject(i);
TaskDto dto = new TaskDto();
// 0305 start
// dto.taskDirectionsDto = new TaskDirectionsDto();
// #32782 指示者テーブル関連削除 start
dto.taskDirectionsDto = new TaskReportDto();
// 0305 end
// #32782 指示者テーブル関連削除 end
dto.taskReportDto = new TaskReportDto();
dto.operationId = taskJson.getLong(OperationId);
......
......@@ -17,10 +17,13 @@ public class ABookKeys {
// ABOOKCHECK SCHEME
public static final String ABOOK_CHECK_API = "abookcheck-api";
// #32782 指示者テーブル関連削除 start
// TODO TaskDirections 削除処理が必要
public static final String CMD_INSERT_TASK_DIRECTIONS = "insertTaskDirections";
public static final String CMD_UPDATE_TASK_DIRECTIONS = "updateTaskDirections";
public static final String CMD_DELETE_TASK_DIRECTIONS = "deleteTaskDirections";
public static final String CMD_CANCEL_TASK_DIRECTIONS = "cancelTaskDirections";
// #32782 指示者テーブル関連削除 end
public static final String CMD_MOVE_HOT_SPOT = "moveHotspot";
public static final String CMD_SHOW_DIRECTION_OZD = "showDirectionOzd";
public static final String CMD_PREVIEW_DIRECTION_OZD = "previewDirectionOzd";
......@@ -47,8 +50,11 @@ public class ABookKeys {
public static final String READ_ONLY_FLG = "readOnlyFlg";
public static final String DIRECTION_FLG = "directionFlg";
public static final String ATTACHED_CHANGE_FLAG = "attachedChangeFlag";
public static final String TASK_DIRECTIONS = "taskDirections";
public static final String TASK_DIRECTIONS_SUGGEST = "taskDirectionsSuggest";
// #32782 指示者テーブル関連削除 start
// 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_REPORT = "taskReport";
public static final String TASK_REPORT_SUGGEST = "taskReportSuggest";
......
......@@ -91,10 +91,10 @@ public class ABVDataOpenHelper {
iTableScripts.add(new TOperation());
iTableScripts.add(new ROperationContent());
iTableScripts.add(new TTask());
// 0305 start
// #32782 指示者テーブル関連削除 start
// iTableScripts.add(new TTaskDirections());
// iTableScripts.add(new TTaskDirectionsItems());
// 0305 end
// #32782 指示者テーブル関連削除 end
iTableScripts.add(new TTaskReport());
iTableScripts.add(new TTaskReportSend());
iTableScripts.add(new TTaskReportItems());
......
......@@ -204,10 +204,10 @@ public class OperationDao extends AbstractDao {
delete("r_project_content", null, null);
delete("t_project", null, null);
delete("t_task", null, null);
// 0305 start
// #32782 指示者テーブル関連削除 start
// delete("t_task_directions", null, null);
// delete("t_task_directions_items", null, null);
// 0305 end
// #32782 指示者テーブル関連削除 end
delete("t_task_report", null, null);
delete("t_task_report_send", null, null);
delete("t_task_report_items", null, null);
......
......@@ -100,12 +100,9 @@ public class TaskDao extends AbstractDao {
if (directionFlg) {
delete("t_task", "task_key=?", keyValues);
// 0305 start
// delete("t_task_directions", "task_key=?", keyValues);
// delete("t_task_directions_items", "task_key=?", keyValues);
// #32782 指示者テーブル関連削除
delete("t_task_report", "task_key=?", keyValues);
delete("t_task_report_items", "task_key=?", keyValues);
// 0305 end
} else {
delete("t_task_report", "task_key=?", keyValues);
delete("t_task_report_items", "task_key=?", keyValues);
......@@ -118,10 +115,7 @@ public class TaskDao extends AbstractDao {
*/
public void delete(TaskDto dto) {
delete("t_task", "task_key=?", dto.getKeyValues());
// 0305 start
// delete("t_task_directions", "task_key=?", dto.getKeyValues());
// delete("t_task_directions_items", "task_key=?", dto.getKeyValues());
// 0305 end
// #32782 指示者テーブル関連削除
delete("t_task_report", "task_key=?", dto.getKeyValues());
delete("t_task_report_items", "task_key=?", dto.getKeyValues());
delete("t_inspect_task_report", "task_key=?", new String[] { dto.taskKey });
......
......@@ -53,12 +53,12 @@ public class TaskReportDao extends AbstractDao {
if (column != -1) {
dto.delFlg = toBool(cursor.getInt(column));
}
// 0305 start
// #32782 指示者テーブル関連削除 start
column = cursor.getColumnIndex("reportor_flag");
if (column != -1) {
dto.reportorFlag = toBool(cursor.getInt(column));
dto.reporterFlag = toBool(cursor.getInt(column));
}
// 0305 end
// #32782 指示者テーブル関連削除 end
return dto;
}
......@@ -70,12 +70,12 @@ public class TaskReportDao extends AbstractDao {
+ "attached_file_name, "
+ "local_attached_file_name, "
+ "attached_file_send_flg, "
// 0301 start
+ "reportor_flag, "
// 0301 end
+ "data_send_flg) "
+ "data_send_flg, "
// #32782 指示者テーブル関連削除 start
+ "reporter_flag) "
// #32782 指示者テーブル関連削除 end
+ "values "
+ "(?,?,?,?,?,?)",
+ "(?,?,?,?,?,?,?)",
dto.getInsertValues());
}
......@@ -103,9 +103,9 @@ public class TaskReportDao extends AbstractDao {
+ "local_attached_file_name=?, "
+ "attached_file_send_flg=?, "
+ "data_send_flg=?, "
// 0301 start
+ "reportor_flag=? "
// 0301 end
// #32782 指示者テーブル関連削除 start
+ "reporter_flag=? "
// #32782 指示者テーブル関連削除 end
+ "where task_key=?",
dto.getUpdateValues());
return count > 0;
......@@ -133,7 +133,7 @@ public class TaskReportDao extends AbstractDao {
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();
sb.append(" select * ");
sb.append(" from t_task_report ttr ");
......@@ -143,10 +143,10 @@ public class TaskReportDao extends AbstractDao {
sb.append(" WHERE ttr.data_send_flg = 1");
sb.append(" AND tt.project_id = ?");
sb.append(" AND tt.task_key = ?");
// 0305 start
sb.append(" AND ttr.reportor_flag = ?");
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId, "" + taskKey, "" + reportorFlag}, TaskReportDto.class);
// 0305 end
// #32782 指示者テーブル関連削除 start
sb.append(" AND ttr.repertor_flag = ?");
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId, "" + taskKey, "" + reporterFlag}, TaskReportDto.class);
// #32782 指示者テーブル関連削除 end
}
public String getTaskReportAttachedFileName(String taskKey) {
......
......@@ -28,9 +28,9 @@ public class TTaskReport extends SQLiteTableScript {
sql.append(" , local_attached_file_name TEXT ");
sql.append(" , attached_file_send_flg BOOLEAN DEFAULT 0 ");
sql.append(" , data_send_flg BOOLEAN DEFAULT 0 ");
// 0305 start
sql.append(" , reportor_flag BOOLEAN DEFAULT 0 ");
// 0305 end
// #32782 指示者テーブル関連削除 start
sql.append(" , reporter_flag BOOLEAN DEFAULT 0 ");
// #32782 指示者テーブル関連削除 end
sql.append(" ) ");
ddl.add(sql.toString());
......
......@@ -16,11 +16,11 @@ public class TaskDto extends AbstractDto {
public String taskHotSpotInfo;
public boolean delFlg;
// 0305 start
// public TaskDirectionsDto taskDirectionsDto;
// #32782 指示者テーブル関連削除 start
// TODO TaskDirectionDto から TaskReportDto に変更、taskDirectionsDto 名を変更必要
public TaskReportDto taskDirectionsDto;
// #32782 指示者テーブル関連削除 end
public TaskReportDto taskReportDto;
// 0305 end
public int taskReportId;
public List<RoutineTaskReportDto> RoutineTaskReportList;
......
......@@ -15,24 +15,22 @@ public class TaskReportDto extends AbstractDto {
public String taskHotSpotInfo;
public boolean delFlg;
// 0301 start
public boolean reportorFlag;
// 0301 end
// #32782 指示者テーブル関連削除 start
public boolean reporterFlag;
// #32782 指示者テーブル関連削除 end
@Override
public Object[] getInsertValues() {
// 0301 start
return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, reportorFlag };
// return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg };
// 0301 end
// #32782 指示者テーブル関連削除 start
return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, reporterFlag };
// #32782 指示者テーブル関連削除 end
}
@Override
public Object[] getUpdateValues() {
// 0301 start
return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, reportorFlag, taskKey };
// return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskKey };
// 0301 end
// #32782 指示者テーブル関連削除 start
return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, reporterFlag, taskKey };
// #32782 指示者テーブル関連削除 end
}
@Override
......
......@@ -143,9 +143,9 @@ public class OperationListActivity extends ABVUIActivity {
private Dialog mPanoEntryDialog;
private OperationContentDao mOperationContentDao = AbstractDao.getDao(OperationContentDao.class);
// 0301 start
// #32782 指示者テーブル関連削除 start
// private TaskDirectionsDao mTaskDirectionsDao = AbstractDao.getDao(TaskDirectionsDao.class);
// 0301 end
// #32782 指示者テーブル関連削除 end
private TaskReportDao mTaskReportDao = AbstractDao.getDao(TaskReportDao.class);
private RoutineTaskReportDao mRoutineTaskReportDao = AbstractDao.getDao(RoutineTaskReportDao.class);
private OperationLogic mOperationLogic = AbstractLogic.getLogic(OperationLogic.class);
......@@ -1044,17 +1044,16 @@ public class OperationListActivity extends ABVUIActivity {
progress = 40 / json.taskDtoList.size();
}
// 0305 start
// JSONObject taskDirectionJson;
// #32782 指示者テーブル関連削除 start
JSONObject taskReportJson;
for (TaskDto taskDto : json.taskDtoList) {
String directionsAttachedFileName = taskDto.taskDirectionsDto.attachedFileName;
String reportAttachedFileName = taskDto.taskReportDto.attachedFileName;
// 0305 start
// #32782 指示者テーブル関連削除 start
taskReportJson = new JSONObject(taskDto.taskDirectionsDto.jsonData);
taskReportJson.put(ABookKeys.TASK_STATUS, taskDto.taskStatus);
// 0305 end
// #32782 指示者テーブル関連削除 end
int localTaskIndex = localTaskList.indexOf(taskDto);
if (localTaskIndex >= 0) {
......@@ -1065,17 +1064,17 @@ public class OperationListActivity extends ABVUIActivity {
return null;
}
// 0305 start
// #32782 指示者テーブル関連削除 start
// 作業更新
mOperationLogic.updateTaskDirections(taskDto.taskKey, taskDto.operationId, operationContentDto.contentId,
taskReportJson, taskDto.taskHotSpotInfo, directionsAttachedFileName, false, false);
// 0305 end
mOperationLogic.updateTaskReport(taskDto.taskKey, taskDto.operationId, operationContentDto.contentId,
taskReportJson, directionsAttachedFileName, false, false, taskDto.taskHotSpotInfo);
localTaskList.remove(taskDto);
// 報告データが存在すると作業報告を更新する
if (taskDto.taskReportDto.jsonData != null) {
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 {
// 添付ファイルが存在する場合、取得して解凍する。
refreshTaskFile(operationId, operationContentDto.contentId, taskDto.taskId, taskDto.taskKey, directionsAttachedFileName, reportAttachedFileName);
......@@ -1083,19 +1082,19 @@ public class OperationListActivity extends ABVUIActivity {
return null;
}
// 0301 start
// #32782 指示者テーブル関連削除 start
// 作業登録
mOperationLogic.insertTaskDirections(taskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId,
taskReportJson, taskDto.taskHotSpotInfo, directionsAttachedFileName, false, false);
// 0305 end
mOperationLogic.insertTaskReport(taskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId,
taskReportJson, directionsAttachedFileName, false, false, taskDto.taskHotSpotInfo);
if (taskDto.taskReportDto.jsonData != null) {
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));
}
// 0305 end
// #32782 指示者テーブル関連削除 end
// サーバーから取得した作業情報がローカルに存在しないので削除する
for (TaskDto taskDto : localTaskList) {
......@@ -1115,10 +1114,9 @@ public class OperationListActivity extends ABVUIActivity {
// 既存の添付ディレクトリ削除
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
// 0305 start
// String directionsLocalAttachedFileName = mTaskDirectionsDao.getTaskDirectionsAttachedFileName(taskKey);
// #32782 指示者テーブル関連削除 start
String directionsLocalAttachedFileName = mTaskReportDao.getTaskReportAttachedFileName(taskKey);
// 0305 end
// #32782 指示者テーブル関連削除 end
String reportLocalAttachedFileName = mTaskReportDao.getTaskReportAttachedFileName(taskKey);
int count = 0;
boolean getDirectionsFileFlg = directionsAttachedFileName != null && !directionsAttachedFileName.equals(directionsLocalAttachedFileName);
......
......@@ -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.PageObjectJSON;
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.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.CommonExecutor;
......@@ -5184,25 +5185,30 @@ public class ContentViewActivity extends ABVContentViewActivity {
switch(cmd){
case ABookKeys.CMD_INSERT_TASK_DIRECTIONS:
case ABookKeys.CMD_UPDATE_TASK_DIRECTIONS:
JSONObject hotspot = new JSONObject(checkParam.get(ABookKeys.HOT_SPOT));
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();
// #32782 指示者テーブル関連削除 start
case ABookKeys.CMD_INSERT_TASK_REPORT:
case ABookKeys.CMD_UPDATE_TASK_REPORT:
case ABookKeys.CMD_DELETE_TASK_REPORT:
if (ABVDataCache.getInstance().getMemberInfo().operationAuthLevel == OperationAuthLevel.OPERATION_INSTRUCTOR) {
JSONObject hotspot = new JSONObject(checkParam.get(ABookKeys.HOT_SPOT));
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;
case ABookKeys.CMD_DELETE_TASK_DIRECTIONS:
operationTaskLayout.setIconStatus(taskKey, true);
//hideOperationTaskLayout();
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:
operationTaskLayout.setIconStatus(taskKey, false);
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