Commit 21004d02 by Jeong Gilmo

#32782 - 指示者テーブル関連削除(TaskDirections, TaskDirectionsItems)

parent 4dfce160
...@@ -50,7 +50,10 @@ public class OperationDataJSON extends AcmsCommonJSON { ...@@ -50,7 +50,10 @@ 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();
dto.taskDirectionsDto = new TaskDirectionsDto(); // 0305 start
// dto.taskDirectionsDto = new TaskDirectionsDto();
dto.taskDirectionsDto = new TaskReportDto();
// 0305 end
dto.taskReportDto = new TaskReportDto(); dto.taskReportDto = new TaskReportDto();
dto.operationId = taskJson.getLong(OperationId); dto.operationId = taskJson.getLong(OperationId);
......
...@@ -41,7 +41,10 @@ public class RoutineTaskDataJSON extends OperationDataJSON { ...@@ -41,7 +41,10 @@ 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();
dto.taskDirectionsDto = new TaskDirectionsDto(); // 0305 start
// dto.taskDirectionsDto = new TaskDirectionsDto();
dto.taskDirectionsDto = new TaskReportDto();
// 0305 end
dto.taskReportDto = new TaskReportDto(); dto.taskReportDto = new TaskReportDto();
dto.operationId = taskJson.getLong(OperationId); dto.operationId = taskJson.getLong(OperationId);
......
...@@ -91,8 +91,10 @@ public class ABVDataOpenHelper { ...@@ -91,8 +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());
iTableScripts.add(new TTaskDirections()); // 0305 start
iTableScripts.add(new TTaskDirectionsItems()); // iTableScripts.add(new TTaskDirections());
// iTableScripts.add(new TTaskDirectionsItems());
// 0305 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,8 +204,10 @@ public class OperationDao extends AbstractDao { ...@@ -204,8 +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);
delete("t_task_directions", null, null); // 0305 start
delete("t_task_directions_items", null, null); // delete("t_task_directions", null, null);
// delete("t_task_directions_items", null, null);
// 0305 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,8 +100,12 @@ public class TaskDao extends AbstractDao { ...@@ -100,8 +100,12 @@ public class TaskDao extends AbstractDao {
if (directionFlg) { if (directionFlg) {
delete("t_task", "task_key=?", keyValues); delete("t_task", "task_key=?", keyValues);
delete("t_task_directions", "task_key=?", keyValues); // 0305 start
delete("t_task_directions_items", "task_key=?", keyValues); // 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_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);
...@@ -114,8 +118,10 @@ public class TaskDao extends AbstractDao { ...@@ -114,8 +118,10 @@ 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());
delete("t_task_directions", "task_key=?", dto.getKeyValues()); // 0305 start
delete("t_task_directions_items", "task_key=?", dto.getKeyValues()); // 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 });
......
...@@ -11,7 +11,10 @@ import jp.agentec.abook.abv.bl.dto.TaskDirectionsDto; ...@@ -11,7 +11,10 @@ import jp.agentec.abook.abv.bl.dto.TaskDirectionsDto;
public class TaskDirectionsDao extends AbstractDao { public class TaskDirectionsDao extends AbstractDao {
private static final String TAG = "TaskDirectionsDao"; // 0305 start
// private static final String TAG = "TaskDirectionsDao";
private static final String TAG = "TaskReportDao";
// 0305 end
/*package*/ TaskDirectionsDao() { /*package*/ TaskDirectionsDao() {
} }
...@@ -58,7 +61,10 @@ public class TaskDirectionsDao extends AbstractDao { ...@@ -58,7 +61,10 @@ public class TaskDirectionsDao extends AbstractDao {
public void insert(TaskDirectionsDto dto) { public void insert(TaskDirectionsDto dto) {
insert("insert into t_task_directions " // 0305 start
// insert("insert into t_task_directions "
// 0305 end
insert("insert into t_task_report "
+ "(task_key, " + "(task_key, "
+ "json_data, " + "json_data, "
+ "attached_file_name, " + "attached_file_name, "
...@@ -73,7 +79,10 @@ public class TaskDirectionsDao extends AbstractDao { ...@@ -73,7 +79,10 @@ public class TaskDirectionsDao extends AbstractDao {
public List<TaskDirectionsDto> getTaskDirectionsByOperationId(Long operationId) { public List<TaskDirectionsDto> getTaskDirectionsByOperationId(Long operationId) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(" select ttd.* "); sb.append(" select ttd.* ");
sb.append(" from t_task_directions ttd "); // 0305 start
// sb.append(" from t_task_directions ttd ");
sb.append(" from t_task_report ttd ");
// 0305 end
sb.append(" inner join "); sb.append(" inner join ");
sb.append(" t_task tt "); sb.append(" t_task tt ");
sb.append(" ON tt.task_key == ttd.task_key "); sb.append(" ON tt.task_key == ttd.task_key ");
...@@ -83,15 +92,24 @@ public class TaskDirectionsDao extends AbstractDao { ...@@ -83,15 +92,24 @@ public class TaskDirectionsDao extends AbstractDao {
} }
public TaskDirectionsDto getTaskDirections(String taskKey) { public TaskDirectionsDto getTaskDirections(String taskKey) {
return rawQueryGetDto("select * from t_task_directions where task_key=?", new String[]{"" + taskKey}, TaskDirectionsDto.class); // 0305 start
// return rawQueryGetDto("select * from t_task_directions where task_key=?", new String[]{"" + taskKey}, TaskDirectionsDto.class);
return rawQueryGetDto("select * from t_task_report where task_key=?", new String[]{"" + taskKey}, TaskDirectionsDto.class);
// 0305 end
} }
public String getTaskDirectionsAttachedFileName(String taskKey) { public String getTaskDirectionsAttachedFileName(String taskKey) {
return rawQueryGetString("select local_attached_file_name from t_task_directions where task_key=?", new String[]{"" + taskKey}); // 0305 start
// return rawQueryGetString("select local_attached_file_name from t_task_directions where task_key=?", new String[]{"" + taskKey});
return rawQueryGetString("select local_attached_file_name from t_task_report where task_key=?", new String[]{"" + taskKey});
// 0305 end
} }
public boolean update(TaskDirectionsDto dto) { public boolean update(TaskDirectionsDto dto) {
long count = update("update t_task_directions " // 0305 start
// long count = update("update t_task_directions "
// 0305 end
long count = update("update t_task_report "
+ "set " + "set "
+ "json_data=?, " + "json_data=?, "
+ "attached_file_name=?, " + "attached_file_name=?, "
...@@ -110,7 +128,10 @@ public class TaskDirectionsDao extends AbstractDao { ...@@ -110,7 +128,10 @@ public class TaskDirectionsDao extends AbstractDao {
public List<TaskDirectionsDto> getSendableTaskData(Long operationId) { public List<TaskDirectionsDto> getSendableTaskData(Long operationId) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(" select * "); sb.append(" select * ");
sb.append(" from t_task_directions ttd "); // 0305 start
// sb.append(" from t_task_directions ttd ");
sb.append(" from t_task_report ttd ");
// 0305 end
sb.append(" inner join "); sb.append(" inner join ");
sb.append(" t_task tt "); sb.append(" t_task tt ");
sb.append(" ON tt.task_key == ttd.task_key "); sb.append(" ON tt.task_key == ttd.task_key ");
...@@ -122,7 +143,10 @@ public class TaskDirectionsDao extends AbstractDao { ...@@ -122,7 +143,10 @@ public class TaskDirectionsDao extends AbstractDao {
public List<TaskDirectionsDto> getSendableTaskData(Long operationId, String taskKey) { public List<TaskDirectionsDto> getSendableTaskData(Long operationId, String taskKey) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(" select * "); sb.append(" select * ");
sb.append(" from t_task_directions ttd "); // 0305 start
// sb.append(" from t_task_directions ttd ");
sb.append(" from t_task_report ttd ");
// 0305 end
sb.append(" inner join "); sb.append(" inner join ");
sb.append(" t_task tt "); sb.append(" t_task tt ");
sb.append(" ON tt.task_key == ttd.task_key "); sb.append(" ON tt.task_key == ttd.task_key ");
......
...@@ -35,17 +35,26 @@ public class TaskDirectionsItemsDao extends AbstractDao { ...@@ -35,17 +35,26 @@ public class TaskDirectionsItemsDao extends AbstractDao {
} }
public void insertTaskDirectionsItems(TaskDirectionsItemsDto dto) { public void insertTaskDirectionsItems(TaskDirectionsItemsDto dto) {
insert("insert into t_task_directions_items (task_key, item_key, input_value) values (?,?,?)", dto.getInsertValues()); // 0305 start
// insert("insert into t_task_directions_items (task_key, item_key, input_value) values (?,?,?)", dto.getInsertValues());
insert("insert into t_task_report_items (task_key, item_key, input_value) values (?,?,?)", dto.getInsertValues());
// 0305 end
} }
public List<TaskDirectionsItemsDto> getTaskDirectionsItemByTaskKey(String taskKey) { public List<TaskDirectionsItemsDto> getTaskDirectionsItemByTaskKey(String taskKey) {
return rawQueryGetDtoList("select * from t_task_directions_items where task_key=?", new String[]{"" + taskKey}, TaskDirectionsItemsDto.class); // 0305 start
// return rawQueryGetDtoList("select * from t_task_directions_items where task_key=?", new String[]{"" + taskKey}, TaskDirectionsItemsDto.class);
return rawQueryGetDtoList("select * from t_task_report_items where task_key=?", new String[]{"" + taskKey}, TaskDirectionsItemsDto.class);
// 0305 end
} }
public List<TaskDirectionsItemsDto> getTaskDirectionsItemByOperationId(Long operationId) { public List<TaskDirectionsItemsDto> getTaskDirectionsItemByOperationId(Long operationId) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(" select distinct ttdi.* "); sb.append(" select distinct ttdi.* ");
sb.append(" from t_task_directions_items ttdi "); // 0305 start
// sb.append(" from t_task_directions_items ttdi ");
sb.append(" from t_task_report_items ttdi ");
// 0305 end
sb.append(" inner join "); sb.append(" inner join ");
sb.append(" t_task tt "); sb.append(" t_task tt ");
sb.append(" ON tt.task_key == ttdi.task_key "); sb.append(" ON tt.task_key == ttdi.task_key ");
...@@ -55,7 +64,10 @@ public class TaskDirectionsItemsDao extends AbstractDao { ...@@ -55,7 +64,10 @@ public class TaskDirectionsItemsDao extends AbstractDao {
} }
public boolean updateTaskDirectionsItems(TaskDirectionsItemsDto dto) { public boolean updateTaskDirectionsItems(TaskDirectionsItemsDto dto) {
long count = update("update t_task_directions_items set input_value=? where item_key=? and task_key=? ", dto.getUpdateValues()); // 0305 start
// long count = update("update t_task_directions_items set input_value=? where item_key=? and task_key=? ", dto.getUpdateValues());
long count = update("update t_task_report_items set input_value=? where item_key=? and task_key=? ", dto.getUpdateValues());
// 0305 end
return (count > 0); return (count > 0);
} }
} }
\ No newline at end of file
...@@ -53,6 +53,12 @@ public class TaskReportDao extends AbstractDao { ...@@ -53,6 +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
column = cursor.getColumnIndex("reportor_flag");
if (column != -1) {
dto.reportorFlag = toBool(cursor.getInt(column));
}
// 0305 end
return dto; return dto;
} }
...@@ -64,6 +70,9 @@ public class TaskReportDao extends AbstractDao { ...@@ -64,6 +70,9 @@ 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
+ "reportor_flag, "
// 0301 end
+ "data_send_flg) " + "data_send_flg) "
+ "values " + "values "
+ "(?,?,?,?,?,?,?)", + "(?,?,?,?,?,?,?)",
...@@ -93,7 +102,10 @@ public class TaskReportDao extends AbstractDao { ...@@ -93,7 +102,10 @@ 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=?, "
+ "data_send_flg=? " + "data_send_flg=?, "
// 0301 start
+ "reportor_flag=? "
// 0301 end
+ "where task_key=?", + "where task_key=?",
dto.getUpdateValues()); dto.getUpdateValues());
return count > 0; return count > 0;
...@@ -121,7 +133,7 @@ public class TaskReportDao extends AbstractDao { ...@@ -121,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) { public List<TaskReportDto> getSendableTaskData(Long operationId, String taskKey, boolean reportorFlag) {
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 ");
...@@ -131,7 +143,10 @@ public class TaskReportDao extends AbstractDao { ...@@ -131,7 +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 = ?");
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId, "" + taskKey}, TaskReportDto.class); // 0305 start
sb.append(" AND ttr.reportor_flag = ?");
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId, "" + taskKey, "" + reportorFlag}, TaskReportDto.class);
// 0305 end
} }
public String getTaskReportAttachedFileName(String taskKey) { public String getTaskReportAttachedFileName(String taskKey) {
......
...@@ -21,7 +21,10 @@ public class TTaskDirections extends SQLiteTableScript { ...@@ -21,7 +21,10 @@ public class TTaskDirections extends SQLiteTableScript {
List<String> ddl = new ArrayList<String>(); List<String> ddl = new ArrayList<String>();
StringBuffer sql = new StringBuffer(); StringBuffer sql = new StringBuffer();
sql.append(" CREATE TABLE t_task_directions ( "); // 0305 start
// sql.append(" CREATE TABLE t_task_directions ( ");
sql.append(" CREATE TABLE t_task_report ( ");
// 0305 end
sql.append(" task_key TEXT NOT NULL "); sql.append(" task_key TEXT NOT NULL ");
sql.append(" , json_data TEXT NOT NULL "); sql.append(" , json_data TEXT NOT NULL ");
sql.append(" , attached_file_name TEXT "); sql.append(" , attached_file_name TEXT ");
......
...@@ -21,7 +21,10 @@ public class TTaskDirectionsItems extends SQLiteTableScript { ...@@ -21,7 +21,10 @@ public class TTaskDirectionsItems extends SQLiteTableScript {
List<String> ddl = new ArrayList<String>(); List<String> ddl = new ArrayList<String>();
StringBuffer sql = new StringBuffer(); StringBuffer sql = new StringBuffer();
sql.append(" CREATE TABLE t_task_directions_items ( "); // 0305 start
// sql.append(" CREATE TABLE t_task_directions_items ( ");
sql.append(" CREATE TABLE t_task_report_items ( ");
// 0305 end
sql.append(" task_key TEXT NOT NULL "); sql.append(" task_key TEXT NOT NULL ");
sql.append(" , item_key VARCHAR(64) "); sql.append(" , item_key VARCHAR(64) ");
sql.append(" , input_value VARCHAR(64) "); sql.append(" , input_value VARCHAR(64) ");
......
...@@ -28,6 +28,9 @@ public class TTaskReport extends SQLiteTableScript { ...@@ -28,6 +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
sql.append(" , reportor_flag BOOLEAN DEFAULT 0 ");
// 0305 end
sql.append(" ) "); sql.append(" ) ");
ddl.add(sql.toString()); ddl.add(sql.toString());
......
...@@ -16,8 +16,11 @@ public class TaskDto extends AbstractDto { ...@@ -16,8 +16,11 @@ public class TaskDto extends AbstractDto {
public String taskHotSpotInfo; public String taskHotSpotInfo;
public boolean delFlg; public boolean delFlg;
public TaskDirectionsDto taskDirectionsDto; // 0305 start
// public TaskDirectionsDto taskDirectionsDto;
public TaskReportDto taskDirectionsDto;
public TaskReportDto taskReportDto; public TaskReportDto taskReportDto;
// 0305 end
public int taskReportId; public int taskReportId;
public List<RoutineTaskReportDto> RoutineTaskReportList; public List<RoutineTaskReportDto> RoutineTaskReportList;
......
...@@ -15,14 +15,24 @@ public class TaskReportDto extends AbstractDto { ...@@ -15,14 +15,24 @@ public class TaskReportDto extends AbstractDto {
public String taskHotSpotInfo; public String taskHotSpotInfo;
public boolean delFlg; public boolean delFlg;
// 0301 start
public boolean reportorFlag;
// 0301 end
@Override @Override
public Object[] getInsertValues() { public Object[] getInsertValues() {
return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg }; // 0301 start
return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, reportorFlag };
// return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg };
// 0301 end
} }
@Override @Override
public Object[] getUpdateValues() { public Object[] getUpdateValues() {
return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskKey }; // 0301 start
return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, reportorFlag, taskKey };
// return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskKey };
// 0301 end
} }
@Override @Override
......
...@@ -143,7 +143,9 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -143,7 +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);
private TaskDirectionsDao mTaskDirectionsDao = AbstractDao.getDao(TaskDirectionsDao.class); // 0301 start
// private TaskDirectionsDao mTaskDirectionsDao = AbstractDao.getDao(TaskDirectionsDao.class);
// 0301 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);
...@@ -1033,6 +1035,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1033,6 +1035,7 @@ public class OperationListActivity extends ABVUIActivity {
} }
lastEditDate = json.lastEditDate; lastEditDate = json.lastEditDate;
} else { } else {
// TODO
OperationDataJSON json = AcmsClient.getInstance(ABVDataCache.getInstance().getUrlPath(), ABVEnvironment.getInstance().networkAdapter).getOpereationData(param); OperationDataJSON json = AcmsClient.getInstance(ABVDataCache.getInstance().getUrlPath(), ABVEnvironment.getInstance().networkAdapter).getOpereationData(param);
//プログレスを40%進行させるための計算 //プログレスを40%進行させるための計算
...@@ -1041,13 +1044,17 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1041,13 +1044,17 @@ public class OperationListActivity extends ABVUIActivity {
progress = 40 / json.taskDtoList.size(); progress = 40 / json.taskDtoList.size();
} }
JSONObject taskDirectionJson; // 0305 start
// JSONObject taskDirectionJson;
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;
taskDirectionJson = new JSONObject(taskDto.taskDirectionsDto.jsonData); // 0305 start
taskDirectionJson.put(ABookKeys.TASK_STATUS, taskDto.taskStatus); taskReportJson = new JSONObject(taskDto.taskDirectionsDto.jsonData);
taskReportJson.put(ABookKeys.TASK_STATUS, taskDto.taskStatus);
// 0305 end
int localTaskIndex = localTaskList.indexOf(taskDto); int localTaskIndex = localTaskList.indexOf(taskDto);
if (localTaskIndex >= 0) { if (localTaskIndex >= 0) {
...@@ -1058,9 +1065,11 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1058,9 +1065,11 @@ public class OperationListActivity extends ABVUIActivity {
return null; return null;
} }
// 0305 start
// 作業更新 // 作業更新
mOperationLogic.updateTaskDirections(taskDto.taskKey, taskDto.operationId, operationContentDto.contentId, mOperationLogic.updateTaskDirections(taskDto.taskKey, taskDto.operationId, operationContentDto.contentId,
taskDirectionJson, taskDto.taskHotSpotInfo, directionsAttachedFileName, false, false); taskReportJson, taskDto.taskHotSpotInfo, directionsAttachedFileName, false, false);
// 0305 end
localTaskList.remove(taskDto); localTaskList.remove(taskDto);
// 報告データが存在すると作業報告を更新する // 報告データが存在すると作業報告を更新する
if (taskDto.taskReportDto.jsonData != null) { if (taskDto.taskReportDto.jsonData != null) {
...@@ -1074,9 +1083,11 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1074,9 +1083,11 @@ public class OperationListActivity extends ABVUIActivity {
return null; return null;
} }
// 0301 start
// 作業登録 // 作業登録
mOperationLogic.insertTaskDirections(taskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId, mOperationLogic.insertTaskDirections(taskDto.taskKey, operationContentDto.operationId, operationContentDto.contentId,
taskDirectionJson, taskDto.taskHotSpotInfo, directionsAttachedFileName, false, false); taskReportJson, taskDto.taskHotSpotInfo, directionsAttachedFileName, false, false);
// 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); new JSONObject(taskDto.taskReportDto.jsonData), reportAttachedFileName, false, false);
...@@ -1084,6 +1095,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1084,6 +1095,7 @@ public class OperationListActivity extends ABVUIActivity {
} }
progressCallback.callback(new Integer(progress)); progressCallback.callback(new Integer(progress));
} }
// 0305 end
// サーバーから取得した作業情報がローカルに存在しないので削除する // サーバーから取得した作業情報がローカルに存在しないので削除する
for (TaskDto taskDto : localTaskList) { for (TaskDto taskDto : localTaskList) {
...@@ -1103,7 +1115,10 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1103,7 +1115,10 @@ public class OperationListActivity extends ABVUIActivity {
// 既存の添付ディレクトリ削除 // 既存の添付ディレクトリ削除
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey)); FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
String directionsLocalAttachedFileName = mTaskDirectionsDao.getTaskDirectionsAttachedFileName(taskKey); // 0305 start
// String directionsLocalAttachedFileName = mTaskDirectionsDao.getTaskDirectionsAttachedFileName(taskKey);
String directionsLocalAttachedFileName = mTaskReportDao.getTaskReportAttachedFileName(taskKey);
// 0305 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);
......
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