Commit 05668f53 by Lee Jaebin

#32824 作業一覧画面改善

CMS、フォーム連携作業
バグ修正
指示・報告の登録・更新・削除処理の結合
作業一覧のデザイン変更
一時保存処理
parent 93492905
...@@ -539,10 +539,10 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -539,10 +539,10 @@ public class AcmsClient implements AcmsClientResponseListener {
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_HOT_SPOT_INFO, taskReportDto.taskHotSpotInfo)); HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_HOT_SPOT_INFO, taskReportDto.taskHotSpotInfo));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_INFO, taskReportDto.jsonData)); HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_INFO, taskReportDto.jsonData));
HttpMultipartList.add(new HttpMultipart(ABookKeys.ATTACHED_CHANGE_FLAG, taskReportDto.attachedFileSendFlg ? "1" : "0")); HttpMultipartList.add(new HttpMultipart(ABookKeys.ATTACHED_CHANGE_FLAG, taskReportDto.attachedFileSendFlg ? "1" : "0"));
HttpMultipartList.add(new HttpMultipart(ABookKeys.ROUTINE_TASK_FLAG, reportType == Constant.ReportType.Routine ? "1" : "0")); HttpMultipartList.add(new HttpMultipart(ABookKeys.ROUTINE_TASK_FLAG, reportType == Constant.ReportType.RoutineTask ? "1" : "0"));
// 定期点検用 // 定期点検用
if (reportType == Constant.ReportType.Routine) { if (reportType == Constant.ReportType.RoutineTask) {
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_ID, StringUtil.toString(taskReportDto.taskReportId))); HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_ID, StringUtil.toString(taskReportDto.taskReportId)));
HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_INFO_ID, StringUtil.toString(taskReportDto.taskReportInfoId))); HttpMultipartList.add(new HttpMultipart(ABookKeys.TASK_REPORT_INFO_ID, StringUtil.toString(taskReportDto.taskReportInfoId)));
HttpMultipartList.add(new HttpMultipart(ABookKeys.REPORT_START_DATE, DateTimeUtil.toStringForCmsGMT(taskReportDto.reportStartDate))); HttpMultipartList.add(new HttpMultipart(ABookKeys.REPORT_START_DATE, DateTimeUtil.toStringForCmsGMT(taskReportDto.reportStartDate)));
......
...@@ -88,12 +88,6 @@ public class Constant { ...@@ -88,12 +88,6 @@ public class Constant {
String REPORT_GPS = "reportGps"; String REPORT_GPS = "reportGps";
} }
public interface OperationReportType {
int REPORT_TYPE = 0;
int ROUTINE_TASK = 1;
int REPORT_RESPONSE_TYPE = 2;
}
public interface PushMessageSendType { public interface PushMessageSendType {
int InGroup = 0; int InGroup = 0;
int AllOperation = 1; int AllOperation = 1;
...@@ -141,7 +135,7 @@ public class Constant { ...@@ -141,7 +135,7 @@ public class Constant {
public interface ReportType { public interface ReportType {
int Report = 0; // 報告 int Report = 0; // 報告
int Routine = 1; // 定期点検 int RoutineTask = 1; // 定期点検
int ReportReply = 2; // 報告(回答) int ReportReply = 2; // 報告(回答)
} }
......
...@@ -243,6 +243,7 @@ public class OperationDao extends AbstractDao { ...@@ -243,6 +243,7 @@ public class OperationDao extends AbstractDao {
sql.append(" top.report_type, "); sql.append(" top.report_type, ");
sql.append(" top.report_cycle, "); sql.append(" top.report_cycle, ");
sql.append(" top.enable_report_update, "); sql.append(" top.enable_report_update, ");
sql.append(" top.enable_report_edit, ");
sql.append(" CASE "); sql.append(" CASE ");
sql.append(" WHEN report_type = 1 THEN ( "); sql.append(" WHEN report_type = 1 THEN ( ");
sql.append(" SELECT strftime('%Y/%m/%d %H:%M', datetime(ttr.report_start_date, 'localtime')) || ' ~ ' || strftime('%Y/%m/%d %H:%M', datetime(ttr.report_end_date, 'localtime')) "); sql.append(" SELECT strftime('%Y/%m/%d %H:%M', datetime(ttr.report_start_date, 'localtime')) || ' ~ ' || strftime('%Y/%m/%d %H:%M', datetime(ttr.report_end_date, 'localtime')) ");
......
...@@ -71,6 +71,16 @@ public class TaskReportDao extends AbstractDao { ...@@ -71,6 +71,16 @@ public class TaskReportDao extends AbstractDao {
dto.taskReportLevel = cursor.getInt(column); dto.taskReportLevel = cursor.getInt(column);
} }
column = cursor.getColumnIndex("task_report_id");
if (column != -1) {
dto.taskReportId = cursor.getInt(column);
}
column = cursor.getColumnIndex("task_report_info_id");
if (column != -1) {
dto.taskReportInfoId = cursor.getInt(column);
}
column = cursor.getColumnIndex("report_start_date"); column = cursor.getColumnIndex("report_start_date");
if (column != -1) { if (column != -1) {
dto.reportStartDate = DateTimeUtil.toDate(cursor.getString(column), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen); dto.reportStartDate = DateTimeUtil.toDate(cursor.getString(column), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
...@@ -81,10 +91,18 @@ public class TaskReportDao extends AbstractDao { ...@@ -81,10 +91,18 @@ public class TaskReportDao extends AbstractDao {
dto.reportEndDate = DateTimeUtil.toDate(cursor.getString(column), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen); dto.reportEndDate = DateTimeUtil.toDate(cursor.getString(column), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
} }
column = cursor.getColumnIndex("local_saved_flg");
if (column != -1) {
dto.localSavedFlg = toBool(cursor.getInt(column));
}
return dto; return dto;
} }
/**
* 報告登録処理
* @param dto
*/
public void insert(TaskReportDto dto) { public void insert(TaskReportDto dto) {
insert("insert into t_task_report " insert("insert into t_task_report "
+ "(task_key, " + "(task_key, "
...@@ -99,13 +117,46 @@ public class TaskReportDao extends AbstractDao { ...@@ -99,13 +117,46 @@ public class TaskReportDao extends AbstractDao {
+ "report_end_date, " + "report_end_date, "
+ "enable_report, " + "enable_report, "
+ "reported_flg, " + "reported_flg, "
+ "task_report_level) " + "task_report_level, "
+ "local_saved_flg ) "
+ "values " + "values "
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?)", + "(?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
dto.getInsertValues()); dto.getInsertValues());
} }
/** /**
* 報告更新処理
* @param dto
* @return
*/
public boolean update(TaskReportDto dto) {
Object[] objects;
StringBuffer sql = new StringBuffer();
sql.append("UPDATE t_task_report SET ");
sql.append("json_data=?, ");
sql.append("attached_file_name=?, ");
sql.append("local_attached_file_name=?, ");
sql.append("attached_file_send_flg=?, ");
sql.append("data_send_flg=?, ");
sql.append("report_end_date=?, ");
sql.append("enable_report=?, ");
sql.append("reported_flg=?, ");
sql.append("task_report_level=?, ");
sql.append("local_saved_flg=? ");
sql.append("WHERE task_key=? AND task_report_level=?");
if (dto.reportStartDate != null) {
sql.append(" AND datetime(report_start_date)=datetime(?)");
objects = new Object[]{dto.jsonData, dto.attachedFileName, dto.localAttachedFileName, dto.attachedFileSendFlg, dto.dataSendFlg,
dto.reportEndDate, dto.enableReport, dto.reportedFlg, dto.taskReportLevel, dto.localSavedFlg, dto.taskKey, dto.taskReportLevel, dto.reportStartDate};
} else {
objects = new Object[]{dto.jsonData, dto.attachedFileName, dto.localAttachedFileName, dto.attachedFileSendFlg, dto.dataSendFlg,
dto.reportEndDate, dto.enableReport, dto.reportedFlg, dto.taskReportLevel, dto.localSavedFlg, dto.taskKey, dto.taskReportLevel};
}
return update(sql.toString(), objects) > 0;
}
/**
* 作業IDで報告取得 * 作業IDで報告取得
* (作業報告タイプ 昇順、作業報告ID 昇順、報告開始日 昇順) * (作業報告タイプ 昇順、作業報告ID 昇順、報告開始日 昇順)
* @param operationId * @param operationId
...@@ -124,7 +175,6 @@ public class TaskReportDao extends AbstractDao { ...@@ -124,7 +175,6 @@ public class TaskReportDao extends AbstractDao {
return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskReportDto.class); return rawQueryGetDtoList(sb.toString(), new String[]{"" + operationId}, TaskReportDto.class);
} }
/** /**
* 作業キーと作業報告タイプで作業報告データ取得 * 作業キーと作業報告タイプで作業報告データ取得
* @param taskKey * @param taskKey
...@@ -144,26 +194,6 @@ public class TaskReportDao extends AbstractDao { ...@@ -144,26 +194,6 @@ public class TaskReportDao extends AbstractDao {
return rawQueryGetDtoList("select * from t_task_report where task_key=? ORDER BY task_report_id, report_start_date", new String[]{ "" + taskKey }, TaskReportDto.class); return rawQueryGetDtoList("select * from t_task_report where task_key=? ORDER BY task_report_id, report_start_date", new String[]{ "" + taskKey }, TaskReportDto.class);
} }
public boolean update(TaskReportDto dto) {
long count = update("update t_task_report "
+ "set "
+ "json_data=?, "
+ "attached_file_name=?, "
+ "local_attached_file_name=?, "
+ "attached_file_send_flg=?, "
+ "data_send_flg=?, "
+ "task_report_id=?, "
+ "task_report_info_id=?, "
+ "report_start_date=?, "
+ "report_end_date=?, "
+ "enable_report=?, "
+ "reported_flg=?, "
+ "task_report_level=? "
+ "where task_key=? AND task_report_level=?",
dto.getUpdateValues());
return count > 0;
}
/** /**
* 送信フラグのあるデータが存在するか * 送信フラグのあるデータが存在するか
* *
...@@ -244,26 +274,6 @@ public class TaskReportDao extends AbstractDao { ...@@ -244,26 +274,6 @@ public class TaskReportDao extends AbstractDao {
} }
/** /**
* 定期点検用の報告更新
* @param dto
* @return
*/
public boolean updateRoutineTask(TaskReportDto dto) {
long count = update("update t_task_report "
+ "set "
+ "report_end_date=?, "
+ "attached_file_name=?, "
+ "local_attached_file_name=?, "
+ "json_data=?, "
+ "data_send_flg=?, "
+ "attached_file_send_flg=? "
+ "reported_flg=? "
+ "where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?)",
new Object[]{dto.reportEndDate, dto.attachedFileName, dto.localAttachedFileName, dto.jsonData, dto.dataSendFlg, dto.attachedFileSendFlg, dto.reportedFlg, dto.taskKey, dto.taskReportId, dto.reportStartDate});
return count > 0;
}
/**
* テーブル物理削除 * テーブル物理削除
* @param dto * @param dto
*/ */
...@@ -276,7 +286,7 @@ public class TaskReportDao extends AbstractDao { ...@@ -276,7 +286,7 @@ public class TaskReportDao extends AbstractDao {
* @param dto * @param dto
*/ */
public void deleteRoutineTaskReport(TaskReportDto dto) { public void deleteRoutineTaskReport(TaskReportDto dto) {
delete("t_task_report", "task_key=? and task_report_level=? task_report_id=? and datetime(report_start_date)=datetime(?, 'utc')", new String[] { dto.taskKey, "" + dto.taskReportLevel, "" + dto.taskReportId, DateTimeUtil.toString(dto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen) }); delete("t_task_report", "task_key=? AND task_report_level=? AND task_report_id=? AND datetime(report_start_date)=datetime(?, 'utc')", new String[] { dto.taskKey, "" + dto.taskReportLevel, "" + dto.taskReportId, DateTimeUtil.toString(dto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen) });
} }
/** /**
...@@ -346,11 +356,13 @@ public class TaskReportDao extends AbstractDao { ...@@ -346,11 +356,13 @@ public class TaskReportDao extends AbstractDao {
} }
/** /**
* 作業キーで作業時間が存在する作業報告データ取得(定期点検) * 定期点検報告のデータ取得
* @param taskKey * @param taskKey
* @param taskReportId
* @param reportStartDate
* @return * @return
*/ */
public List<TaskReportDto> getNotNullStartDateTaskReportByTaskKey(String taskKey) { public TaskReportDto getRoutineTaskReport(String taskKey, int taskReportId, String reportStartDate) {
return rawQueryGetDtoList("select * from t_task_report where task_key=? AND report_start_date IS NOT NULL", new String[]{ taskKey }, TaskReportDto.class); return rawQueryGetDto("select * from t_task_report where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?)", new String[]{ taskKey, "" + taskReportId, reportStartDate }, TaskReportDto.class);
} }
} }
...@@ -35,6 +35,7 @@ public class TTaskReport extends SQLiteTableScript { ...@@ -35,6 +35,7 @@ public class TTaskReport extends SQLiteTableScript {
sql.append(" , enable_report SMALLINT NOT NULL DEFAULT 0 "); sql.append(" , enable_report SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , task_report_level SMALLINT NOT NULL DEFAULT 0 "); sql.append(" , task_report_level SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , reported_flg BOOLEAN DEFAULT 0 "); sql.append(" , reported_flg BOOLEAN DEFAULT 0 ");
sql.append(" , local_saved_flg BOOLEAN DEFAULT 0 ");
sql.append(" ) "); sql.append(" ) ");
ddl.add(sql.toString()); ddl.add(sql.toString());
......
...@@ -24,17 +24,17 @@ public class TaskReportDto extends AbstractDto { ...@@ -24,17 +24,17 @@ public class TaskReportDto extends AbstractDto {
public Date reportEndDate; // 作業終了日 public Date reportEndDate; // 作業終了日
public int enableReport; // 報告可能区分 public int enableReport; // 報告可能区分
public String attachedFileName; public String attachedFileName;
public String taskReportInfo;
public boolean reportedFlg; // 定期点検用 public boolean reportedFlg; // 定期点検用
public boolean localSavedFlg; // 一時保存用
@Override @Override
public Object[] getInsertValues() { public Object[] getInsertValues() {
return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskReportId, taskReportInfoId, reportStartDate, reportEndDate, enableReport, reportedFlg, taskReportLevel}; return new Object[] { taskKey, jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskReportId, taskReportInfoId, reportStartDate, reportEndDate, enableReport, reportedFlg, taskReportLevel, localSavedFlg};
} }
@Override @Override
public Object[] getUpdateValues() { public Object[] getUpdateValues() {
return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, taskReportId, taskReportInfoId, reportStartDate, reportEndDate, enableReport, reportedFlg, taskReportLevel, taskKey, taskReportLevel }; return new Object[] { jsonData, attachedFileName, localAttachedFileName, attachedFileSendFlg, dataSendFlg, reportEndDate, enableReport, reportedFlg, taskReportLevel, localSavedFlg, taskKey, taskReportLevel , reportStartDate };
} }
@Override @Override
......
...@@ -244,15 +244,20 @@ public class OperationLogic extends AbstractLogic { ...@@ -244,15 +244,20 @@ public class OperationLogic extends AbstractLogic {
} }
/** /**
* 作業指示の登録 * 報告データ登録
*
* @param taskKey * @param taskKey
* @param operationId * @param operationId
* @param contentId
* @param reportLevel
* @param enableReport
* @param taskReportJson
* @param localAttachedFileName
* @param attachedChangeFlag * @param attachedChangeFlag
* @param dataSendFlg * @param dataSendFlg
* @param localSavedFlg
* @throws IOException * @throws IOException
*/ */
public void insertTaskReport(String taskKey, long operationId, long contentId, int reportLevel, int enableReport, JSONObject taskReportJson, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg) throws IOException { public void insertTaskReport(String taskKey, long operationId, long contentId, int reportLevel, int enableReport, JSONObject taskReportJson, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg, boolean localSavedFlg) throws IOException {
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey); TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
if (taskDto == null) { if (taskDto == null) {
//TODO error //TODO error
...@@ -270,7 +275,9 @@ public class OperationLogic extends AbstractLogic { ...@@ -270,7 +275,9 @@ public class OperationLogic extends AbstractLogic {
// taskJsonがnullの場合、jsonDataに空でセット // taskJsonがnullの場合、jsonDataに空でセット
taskReportDto.jsonData = ""; taskReportDto.jsonData = "";
} }
// 一時保存のフラグ
taskReportDto.localSavedFlg = localSavedFlg;
// 送信フラグ
taskReportDto.dataSendFlg = dataSendFlg; taskReportDto.dataSendFlg = dataSendFlg;
taskReportDto.attachedFileSendFlg = attachedChangeFlag; taskReportDto.attachedFileSendFlg = attachedChangeFlag;
// 作業報告 // 作業報告
...@@ -306,22 +313,33 @@ public class OperationLogic extends AbstractLogic { ...@@ -306,22 +313,33 @@ public class OperationLogic extends AbstractLogic {
* 作業報告を更新 * 作業報告を更新
* @param taskKey * @param taskKey
* @param operationId * @param operationId
* @param contentId
* @param taskReportLevel
* @param enableReport
* @param taskReportJson * @param taskReportJson
* @param localAttachedFileName * @param localAttachedFileName
* @param attachedChangeFlag * @param attachedChangeFlag
* @param dataSendFlg * @param dataSendFlg
* @param localSavedFlg
* @throws IOException * @throws IOException
*/ */
public void updateTaskReport(String taskKey, long operationId, long contentId, int taskReportLevel, int enableReport, JSONObject taskReportJson, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg) throws IOException { public void updateTaskReport(String taskKey, long operationId, long contentId, int taskReportLevel, int enableReport, JSONObject taskReportJson, String localAttachedFileName, boolean attachedChangeFlag, boolean dataSendFlg, boolean localSavedFlg) throws IOException {
TaskReportDto taskReportDto = mTaskReportDao.getTaskReport(taskKey, taskReportLevel); TaskReportDto taskReportDto = mTaskReportDao.getTaskReport(taskKey, taskReportLevel);
if (taskReportDto == null) { if (taskReportDto == null) {
//TODO error? //TODO error?
return; return;
} }
// suggest登録・更新処理 if (taskReportJson != null) {
registTaskReportItem(taskKey, taskReportLevel, taskReportJson.getJSONObject("suggest")); // suggest登録・更新処理
registTaskReportItem(taskKey, taskReportLevel, taskReportJson.getJSONObject("suggest"));
taskReportDto.jsonData = taskReportJson.toString(); taskReportDto.jsonData = taskReportJson.toString();
} else {
taskReportDto.jsonData = "";
}
// 一時保存のフラグ
taskReportDto.localSavedFlg = localSavedFlg;
// 送信フラグ
taskReportDto.dataSendFlg = dataSendFlg; taskReportDto.dataSendFlg = dataSendFlg;
// 作業報告階層 // 作業報告階層
taskReportDto.taskReportLevel = taskReportLevel; taskReportDto.taskReportLevel = taskReportLevel;
...@@ -452,11 +470,12 @@ public class OperationLogic extends AbstractLogic { ...@@ -452,11 +470,12 @@ public class OperationLogic extends AbstractLogic {
* @param reportedFlg * @param reportedFlg
* @throws IOException * @throws IOException
*/ */
public void updateRoutineTaskReport(long operationId, long contentId, TaskReportDto taskReportDto, boolean attachedChangeFlag, boolean dataSendFlg, boolean reportedFlg) throws IOException { public void updateRoutineTaskReport(long operationId, long contentId, TaskReportDto taskReportDto, boolean attachedChangeFlag, boolean dataSendFlg, boolean reportedFlg, boolean localSavedFlg) throws IOException {
taskReportDto.attachedFileSendFlg = attachedChangeFlag; taskReportDto.attachedFileSendFlg = attachedChangeFlag;
taskReportDto.dataSendFlg = dataSendFlg; taskReportDto.dataSendFlg = dataSendFlg;
taskReportDto.reportedFlg = reportedFlg; taskReportDto.reportedFlg = reportedFlg;
mTaskReportDao.updateRoutineTask(taskReportDto); taskReportDto.localSavedFlg = localSavedFlg;
mTaskReportDao.update(taskReportDto);
if (!StringUtil.isNullOrEmpty(taskReportDto.jsonData)) { if (!StringUtil.isNullOrEmpty(taskReportDto.jsonData)) {
JSONObject taskReportJson = new JSONObject(taskReportDto.jsonData); JSONObject taskReportJson = new JSONObject(taskReportDto.jsonData);
...@@ -633,7 +652,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -633,7 +652,7 @@ public class OperationLogic extends AbstractLogic {
taskReportDto.attachedFileSendFlg = false; taskReportDto.attachedFileSendFlg = false;
taskReportDto.jsonData = ""; taskReportDto.jsonData = "";
taskReportDto.reportedFlg = false; taskReportDto.reportedFlg = false;
mTaskReportDao.updateRoutineTask(taskReportDto); mTaskReportDao.update(taskReportDto);
} }
TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey); TaskDto taskDto = mTaskDao.getTaskByTaskKey(taskKey);
...@@ -892,14 +911,10 @@ public class OperationLogic extends AbstractLogic { ...@@ -892,14 +911,10 @@ public class OperationLogic extends AbstractLogic {
List<JSONObject> taskReportJsonList = new ArrayList<JSONObject>(); List<JSONObject> taskReportJsonList = new ArrayList<JSONObject>();
JSONObject taskReportJsonRoot = new JSONObject(); JSONObject taskReportJsonRoot = new JSONObject();
JSONObject taskReportJsonRow; JSONObject taskReportJsonRow;
int taskReportLevel = 0;
int taskReportId = 0;
List<TaskReportDto> routineTaskReportDtoList = mTaskReportDao.getTaskReportByOperationId(operationId); List<TaskReportDto> routineTaskReportDtoList = mTaskReportDao.getTaskReportByOperationId(operationId);
// 現在の作業タイプは定期点検の場合 // 現在の作業タイプは定期点検の場合
for (TaskReportDto dto : routineTaskReportDtoList) { for (TaskReportDto dto : routineTaskReportDtoList) {
taskReportJsonRow = new JSONObject(); taskReportJsonRow = new JSONObject();
taskReportLevel = dto.taskReportLevel;
taskReportId = dto.taskReportId;
taskReportJsonRow.put(ABookKeys.TASK_REPORT_INFO_ID, dto.taskReportInfoId); taskReportJsonRow.put(ABookKeys.TASK_REPORT_INFO_ID, dto.taskReportInfoId);
taskReportJsonRow.put(ABookKeys.REPORT_START_DATE, DateTimeUtil.toStringInTimeZone(dto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen, DateTimeUtil.getLocalTimeZone())); taskReportJsonRow.put(ABookKeys.REPORT_START_DATE, DateTimeUtil.toStringInTimeZone(dto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen, DateTimeUtil.getLocalTimeZone()));
taskReportJsonRow.put(ABookKeys.REPORT_END_DATE, DateTimeUtil.toStringInTimeZone(dto.reportEndDate, DateTimeFormat.yyyyMMddHHmmss_hyphen, DateTimeUtil.getLocalTimeZone())); taskReportJsonRow.put(ABookKeys.REPORT_END_DATE, DateTimeUtil.toStringInTimeZone(dto.reportEndDate, DateTimeFormat.yyyyMMddHHmmss_hyphen, DateTimeUtil.getLocalTimeZone()));
...@@ -913,8 +928,10 @@ public class OperationLogic extends AbstractLogic { ...@@ -913,8 +928,10 @@ public class OperationLogic extends AbstractLogic {
taskReportJsonList.add(taskReportJsonRow); taskReportJsonList.add(taskReportJsonRow);
} }
taskReportJsonRoot.put(ABookKeys.ENABLE_REPORT_UPDATE, mOperationDao.getOperation(operationId).enableReportUpdate); taskReportJsonRoot.put(ABookKeys.ENABLE_REPORT_UPDATE, mOperationDao.getOperation(operationId).enableReportUpdate);
taskReportJsonRoot.put(ABookKeys.TASK_REPORT_ID, taskReportId); TaskReportDto taskReportDto = mTaskReportDao.getLastRoutineTaskReportData(operationId);
taskReportJsonRoot.put(String.format("taskReport_%d", taskReportLevel), taskReportJsonList); // 最後のtaskReportId
taskReportJsonRoot.put(ABookKeys.TASK_REPORT_ID, taskReportDto.taskReportId);
taskReportJsonRoot.put("taskReport_0", taskReportJsonList);
Logger.d(TAG, "createRoutineTaskReportJson : " + taskReportJsonRoot.toString()); Logger.d(TAG, "createRoutineTaskReportJson : " + taskReportJsonRoot.toString());
Logger.d(TAG,contentPath + "/" + ABookKeys.TASK_REPORT + ".json"); Logger.d(TAG,contentPath + "/" + ABookKeys.TASK_REPORT + ".json");
FileUtil.createFile(contentPath + "/" + ABookKeys.TASK_REPORT + ".json", taskReportJsonRoot.toString()); FileUtil.createFile(contentPath + "/" + ABookKeys.TASK_REPORT + ".json", taskReportJsonRoot.toString());
...@@ -1124,10 +1141,13 @@ public class OperationLogic extends AbstractLogic { ...@@ -1124,10 +1141,13 @@ public class OperationLogic extends AbstractLogic {
int allSendCount = mTaskReportSendDao.getSendableTaskReportSendDataCount(operationId, taskKey); int allSendCount = mTaskReportSendDao.getSendableTaskReportSendDataCount(operationId, taskKey);
int progress = maxProgress / allSendCount; int progress = maxProgress / allSendCount;
// 送信済みsendIdをまとめて削除するため、リストに追加して最後に削除
List<Integer> removeTaskReportSendIds = new ArrayList<Integer>();
for (TaskReportDto taskReportDto : taskReportDtoList) { for (TaskReportDto taskReportDto : taskReportDtoList) {
List<TaskReportSendDto> taskReportSendDtoList; List<TaskReportSendDto> taskReportSendDtoList;
int lastTaskReportSendId; int lastTaskReportSendId;
if (operationDto.reportType == Constant.ReportType.Routine) { if (operationDto.reportType == Constant.ReportType.RoutineTask) {
// 定期点検 // 定期点検
String reportStartDateStr = DateTimeUtil.toString(taskReportDto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen); String reportStartDateStr = DateTimeUtil.toString(taskReportDto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen);
taskReportSendDtoList = mTaskReportSendDao.getSendableTaskReportSendData(taskReportDto.taskKey, taskReportDto.taskReportId, reportStartDateStr); taskReportSendDtoList = mTaskReportSendDao.getSendableTaskReportSendData(taskReportDto.taskKey, taskReportDto.taskReportId, reportStartDateStr);
...@@ -1149,7 +1169,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -1149,7 +1169,7 @@ public class OperationLogic extends AbstractLogic {
if (taskReportDto.attachedFileSendFlg) { if (taskReportDto.attachedFileSendFlg) {
String fileName = null; String fileName = null;
zipFile = createAttachedFileForSend(operationId, taskReportDto.taskKey, taskReportSendDto.taskReportSendId, operationDto.reportType == Constant.ReportType.Routine, taskReportDto.taskReportId, strReportStartDate, taskReportDto.taskReportLevel); zipFile = createAttachedFileForSend(operationId, taskReportDto.taskKey, taskReportSendDto.taskReportSendId, operationDto.reportType == Constant.ReportType.RoutineTask, taskReportDto.taskReportId, strReportStartDate, taskReportDto.taskReportLevel);
if (zipFile != null) { if (zipFile != null) {
fileName = FileUtil.getFilenameWithoutExt(zipFile.getName()); fileName = FileUtil.getFilenameWithoutExt(zipFile.getName());
} }
...@@ -1166,9 +1186,9 @@ public class OperationLogic extends AbstractLogic { ...@@ -1166,9 +1186,9 @@ public class OperationLogic extends AbstractLogic {
operationDto.reportType operationDto.reportType
); );
progressCallback.callback(new Integer(progress)); progressCallback.callback(new Integer(progress));
mTaskReportSendDao.deleteBySendId(taskReportSendDto.taskReportSendId); removeTaskReportSendIds.add(taskReportSendDto.taskReportSendId);
if (operationDto.reportType == Constant.ReportType.Routine) { if (operationDto.reportType == Constant.ReportType.RoutineTask) {
// 定期点検 // 定期点検
FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, taskReportSendDto.taskReportId, strReportStartDate, taskReportSendDto.taskReportSendId)); FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, taskReportSendDto.taskReportId, strReportStartDate, taskReportSendDto.taskReportSendId));
} else { } else {
...@@ -1197,6 +1217,10 @@ public class OperationLogic extends AbstractLogic { ...@@ -1197,6 +1217,10 @@ public class OperationLogic extends AbstractLogic {
taskReportDto.dataSendFlg = false; taskReportDto.dataSendFlg = false;
taskReportDto.attachedFileSendFlg = false; taskReportDto.attachedFileSendFlg = false;
mTaskReportDao.update(taskReportDto); mTaskReportDao.update(taskReportDto);
// 削除
for (Integer removeTaskReportSendId : removeTaskReportSendIds) {
mTaskReportSendDao.deleteBySendId(removeTaskReportSendId);
}
} }
} }
} }
...@@ -1315,10 +1339,6 @@ public class OperationLogic extends AbstractLogic { ...@@ -1315,10 +1339,6 @@ public class OperationLogic extends AbstractLogic {
mOperationDao.updateContentCreatingFlg(operationId, true); mOperationDao.updateContentCreatingFlg(operationId, true);
} }
public TaskReportDto getLastRoutineTaskReportData(long operationId) {
return mTaskReportDao.getLastRoutineTaskReportData(operationId);
}
/** /**
* 作業の添付ファイルのzip生成 * 作業の添付ファイルのzip生成
* @param operationId * @param operationId
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/icon_infomation_update_on" android:state_enabled="true" />
<item android:drawable="@drawable/icon_infomation_update_off" android:state_enabled="false" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/icon_pano_edit_on" android:state_enabled="true"/>
<item android:drawable="@drawable/icon_pano_edit_off" android:state_enabled="false" />
</selector>
\ No newline at end of file
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/list_selector_holo_light" android:background="@drawable/list_selector_holo_light"
android:descendantFocusability="blocksDescendants" android:descendantFocusability="blocksDescendants"
android:orientation="vertical"> android:padding="10dp"
android:orientation="horizontal">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -14,38 +15,34 @@ ...@@ -14,38 +15,34 @@
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="30dp"
android:layout_marginTop="10dp"
android:gravity="left" android:gravity="left"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageButton <ImageView
android:id="@+id/operation_type" android:id="@+id/report_type"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"/>
android:background="@drawable/btn_pano_edit" />
<ImageButton <ImageView
android:id="@+id/operation_report_type" android:id="@+id/operation_type"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content" />
android:background="@drawable/btn_information_update" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="30dp" android:layout_marginLeft="15dp"
android:layout_marginTop="10dp" android:layout_weight="1"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/operation_name" android:id="@+id/operation_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:text="@string/dummy_str" android:text="@string/dummy_str"
...@@ -58,6 +55,7 @@ ...@@ -58,6 +55,7 @@
android:id="@+id/operation_date" android:id="@+id/operation_date"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:text="@string/dummy_date" android:text="@string/dummy_date"
...@@ -67,27 +65,33 @@ ...@@ -67,27 +65,33 @@
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="right" android:layout_marginRight="10dp"
android:layout_marginLeft="30dp"
android:layout_marginTop="10dp"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageButton <ImageButton
android:id="@+id/btn_pano_edit" android:id="@+id/btn_pano_edit"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="10dp" android:background="@drawable/ic_edit_list"
android:background="@drawable/btn_pano_edit"
android:visibility="invisible" /> android:visibility="invisible" />
<ImageButton <ImageButton
android:id="@+id/btn_information_update" android:id="@+id/btn_sync"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/btn_information_update" /> android:layout_marginLeft="10dp"
android:background="@drawable/ic_reload_list" />
</LinearLayout> </LinearLayout>
<ImageView
android:id="@+id/item_nextLevel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_alignParentRight="true"
android:src="@drawable/ic_navigation_next_item"
android:visibility="visible" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:background="@drawable/list_selector_holo_light" android:background="@drawable/list_selector_holo_light"
android:descendantFocusability="blocksDescendants" android:descendantFocusability="blocksDescendants"
android:orientation="vertical"> android:orientation="vertical">
...@@ -10,24 +10,34 @@ ...@@ -10,24 +10,34 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:orientation="vertical"> android:orientation="horizontal">
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:orientation="vertical"> android:layout_marginTop="10dp"
android:gravity="left"
android:orientation="horizontal">
<TextView <ImageButton
android:id="@+id/operation_date" android:id="@+id/operation_type"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end" android:layout_marginRight="10dp" />
android:maxLines="2"
android:text="@string/dummy_date" <ImageButton
android:textColor="@color/operation_date" android:id="@+id/report_type"
android:textSize="@dimen/operation_normal_text_size" /> android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<TextView <TextView
android:id="@+id/operation_name" android:id="@+id/operation_name"
...@@ -42,12 +52,21 @@ ...@@ -42,12 +52,21 @@
android:textStyle="bold" android:textStyle="bold"
android:visibility="visible" /> android:visibility="visible" />
<TextView
android:id="@+id/operation_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="2"
android:text="@string/dummy_date"
android:textColor="@color/operation_date"
android:textSize="@dimen/operation_normal_text_size" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_margin="3dp" android:layout_margin="3dp"
android:orientation="horizontal"> android:orientation="horizontal">
...@@ -56,15 +75,23 @@ ...@@ -56,15 +75,23 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/btn_pano_edit" /> android:background="@drawable/ic_edit_list" />
<ImageButton <ImageButton
android:id="@+id/btn_information_update" android:id="@+id/btn_sync"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/btn_information_update" /> android:background="@drawable/ic_reload_list" />
</LinearLayout> </LinearLayout>
<ImageView
android:id="@+id/item_nextLevel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_gravity="center"
android:src="@drawable/ic_navigation_next_item"
android:visibility="visible" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -5,44 +5,42 @@ ...@@ -5,44 +5,42 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/list_selector_holo_light" android:background="@drawable/list_selector_holo_light"
android:descendantFocusability="blocksDescendants" android:descendantFocusability="blocksDescendants"
android:padding="10dp"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="200dp"
android:layout_margin="10dp"
android:background="@drawable/panel_frame" android:background="@drawable/panel_frame"
android:orientation="vertical" android:orientation="vertical">
android:paddingTop="10dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="wrap_content"
android:padding="5dp">
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent">
android:padding="5dp">
<ImageButton <ImageView
android:id="@+id/operation_type" android:id="@+id/report_type"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/btn_information_update" /> android:layout_marginLeft="5dp"
android:layout_marginRight="10dp" />
<ImageButton <ImageView
android:id="@+id/operation_report_type" android:id="@+id/operation_type"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content" />
android:layout_marginLeft="5dp"
android:background="@drawable/btn_information_update" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:padding="5dp"
android:gravity="right" android:gravity="right"
android:orientation="horizontal"> android:orientation="horizontal">
...@@ -50,15 +48,15 @@ ...@@ -50,15 +48,15 @@
android:id="@+id/btn_pano_edit" android:id="@+id/btn_pano_edit"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="invisible" android:background="@drawable/ic_edit_panel"
android:background="@drawable/btn_pano_edit" /> android:visibility="invisible" />
<ImageButton <ImageButton
android:id="@+id/btn_information_update" android:id="@+id/btn_sync"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="5dp" android:layout_marginLeft="10dp"
android:background="@drawable/btn_information_update" /> android:background="@drawable/ic_reload_panel" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
...@@ -66,14 +64,13 @@ ...@@ -66,14 +64,13 @@
android:id="@+id/view3" android:id="@+id/view3"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_weight="1"
android:background="@color/line_side" /> android:background="@color/line_side" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/operation_name" android:id="@+id/operation_name"
...@@ -86,30 +83,19 @@ ...@@ -86,30 +83,19 @@
android:textColor="@color/operation_name" android:textColor="@color/operation_name"
android:textSize="@dimen/app_large_text_size" android:textSize="@dimen/app_large_text_size"
android:textStyle="bold" /> android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/operation_date_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:orientation="vertical"
android:padding="3dp"
android:paddingBottom="10dp">
<TextView <TextView
android:id="@+id/operation_date" android:id="@+id/operation_date"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:text="@string/dummy_date" android:text="@string/dummy_date"
android:textColor="@color/operation_date" android:textColor="@color/operation_date"
android:textSize="@dimen/operation_normal_text_size" /> android:textSize="@dimen/operation_normal_text_size" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -2,7 +2,7 @@ package jp.agentec.abook.abv.launcher.android; ...@@ -2,7 +2,7 @@ package jp.agentec.abook.abv.launcher.android;
import java.util.ArrayList; import java.util.ArrayList;
import jp.agentec.abook.abv.bl.common.Constant.OperationReportType; import jp.agentec.abook.abv.bl.common.Constant.ReportType;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.cl.util.PreferenceUtil; import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
...@@ -22,7 +22,7 @@ public class ABVUIDataCache { ...@@ -22,7 +22,7 @@ public class ABVUIDataCache {
// ホーム画面項目 // ホーム画面項目
private int viewMode; // パンネル、リスト形式 private int viewMode; // パンネル、リスト形式
private ArrayList<Integer> mOperationReportTypes; private ArrayList<Integer> mReportTypes;
public long lastUpdateTime = -1; public long lastUpdateTime = -1;
public String searchText; public String searchText;
...@@ -112,7 +112,7 @@ public class ABVUIDataCache { ...@@ -112,7 +112,7 @@ public class ABVUIDataCache {
} }
public void setOperationReportTypes(ArrayList<Integer> operationReportTypes) { public void setOperationReportTypes(ArrayList<Integer> operationReportTypes) {
this.mOperationReportTypes = operationReportTypes; this.mReportTypes = operationReportTypes;
String val = null; String val = null;
if (operationReportTypes.size() > 0) { if (operationReportTypes.size() > 0) {
// カンマ区切りで保存 // カンマ区切りで保存
...@@ -137,14 +137,14 @@ public class ABVUIDataCache { ...@@ -137,14 +137,14 @@ public class ABVUIDataCache {
operationReportTypes.add(Integer.parseInt(contentType)); operationReportTypes.add(Integer.parseInt(contentType));
} }
} }
mOperationReportTypes = operationReportTypes; mReportTypes = operationReportTypes;
} else { } else {
mOperationReportTypes = new ArrayList<Integer>(); mReportTypes = new ArrayList<Integer>();
mOperationReportTypes.add(OperationReportType.REPORT_TYPE); mReportTypes.add(ReportType.Report);
mOperationReportTypes.add(OperationReportType.ROUTINE_TASK); mReportTypes.add(ReportType.RoutineTask);
mOperationReportTypes.add(OperationReportType.REPORT_RESPONSE_TYPE); mReportTypes.add(ReportType.ReportReply);
} }
return mOperationReportTypes; return mReportTypes;
} }
} }
...@@ -788,7 +788,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -788,7 +788,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
helpViewType = Constant.HelpViewType.ListOperationDirector; helpViewType = Constant.HelpViewType.ListOperationDirector;
break; break;
case Constant.XWalkOpenType.TASK_REPORT: case Constant.XWalkOpenType.TASK_REPORT:
if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == Constant.ReportType.RoutineTask) {
helpViewType = Constant.HelpViewType.RoutineTaskOperation; helpViewType = Constant.HelpViewType.RoutineTaskOperation;
} else { } else {
helpViewType = Constant.HelpViewType.ListOperationReporter; helpViewType = Constant.HelpViewType.ListOperationReporter;
...@@ -825,7 +825,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -825,7 +825,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) { if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) {
helpViewType = Constant.HelpViewType.DirectorTask; helpViewType = Constant.HelpViewType.DirectorTask;
} else if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) { } else if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == Constant.ReportType.RoutineTask) {
helpViewType = Constant.HelpViewType.RoutineTaskOperationReport; helpViewType = Constant.HelpViewType.RoutineTaskOperationReport;
} else { } else {
helpViewType = Constant.HelpViewType.ReportTask; helpViewType = Constant.HelpViewType.ReportTask;
...@@ -862,14 +862,16 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -862,14 +862,16 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
// 作業追加区分の値を取得する // 作業追加区分の値を取得する
mAddReport = true; mAddReport = true;
if (abookCheckParam.containsKey(ABookKeys.ADD_REPORT)) {
// 定期点検の場合、以下のフラグを変更しない(mAddReport trueのみ)
if (abookCheckParam.containsKey(ABookKeys.ADD_REPORT) && operationDto.reportType != Constant.ReportType.RoutineTask) {
mAddReport = Integer.parseInt(abookCheckParam.get(ABookKeys.ADD_REPORT)) > 0 ? true : false; mAddReport = Integer.parseInt(abookCheckParam.get(ABookKeys.ADD_REPORT)) > 0 ? true : false;
} }
int taskReportId = 0; int taskReportId = 0;
String reportStartDate = ""; String reportStartDate = "";
if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK && abookCheckParam.get(ABookKeys.TASK_REPORT_ID) != null && abookCheckParam.get(ABookKeys.REPORT_START_DATE) != null) { if (operationDto.reportType == Constant.ReportType.RoutineTask && abookCheckParam.get(ABookKeys.TASK_REPORT_ID) != null && abookCheckParam.get(ABookKeys.REPORT_START_DATE) != null) {
taskReportId = Integer.parseInt(abookCheckParam.get(ABookKeys.TASK_REPORT_ID)); taskReportId = Integer.parseInt(abookCheckParam.get(ABookKeys.TASK_REPORT_ID));
reportStartDate = abookCheckParam.get(ABookKeys.REPORT_START_DATE); reportStartDate = abookCheckParam.get(ABookKeys.REPORT_START_DATE);
} }
......
...@@ -61,7 +61,9 @@ import jp.agentec.abook.abv.bl.common.ABVEnvironment; ...@@ -61,7 +61,9 @@ import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.Callback; import jp.agentec.abook.abv.bl.common.Callback;
import jp.agentec.abook.abv.bl.common.CommonExecutor; import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant; import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.Constant.OperationReportType; import jp.agentec.abook.abv.bl.common.Constant.ReportType;
import jp.agentec.abook.abv.bl.common.Constant.TaskReportLevel;
import jp.agentec.abook.abv.bl.common.Constant.PushMessageSendType;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys; import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.ABVException; import jp.agentec.abook.abv.bl.common.exception.ABVException;
import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode; import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode;
...@@ -591,7 +593,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -591,7 +593,7 @@ public class OperationListActivity extends ABVUIActivity {
// プロジェクトの指示/報告表示時、必要なJSONファイル作成 // プロジェクトの指示/報告表示時、必要なJSONファイル作成
mOperationLogic.createJsonForOpenABookCheckPano(operationDto.operationId, operationDto.contentId, contentPath); mOperationLogic.createJsonForOpenABookCheckPano(operationDto.operationId, operationDto.contentId, contentPath);
mOperationLogic.createJsonForOperationContent(operationDto.operationId, contentPath, operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK); mOperationLogic.createJsonForOperationContent(operationDto.operationId, contentPath, operationDto.reportType == ReportType.RoutineTask);
// サーバ作業後、対応必要 // サーバ作業後、対応必要
StringBuffer path = new StringBuffer(); StringBuffer path = new StringBuffer();
...@@ -696,7 +698,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -696,7 +698,7 @@ public class OperationListActivity extends ABVUIActivity {
// 報告受信 // 報告受信
mOperationLastEditDate = receptionTaskData(operationId, progressCallback, buttonEventFlag); mOperationLastEditDate = receptionTaskData(operationId, progressCallback, buttonEventFlag);
if (reportType == Constant.OperationReportType.ROUTINE_TASK) { if (reportType == ReportType.RoutineTask) {
if (buttonEventFlag) { if (buttonEventFlag) {
String dialogMsg = null; String dialogMsg = null;
// 定期点検プロジェクトの利用可能日付を取得 // 定期点検プロジェクトの利用可能日付を取得
...@@ -827,92 +829,100 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -827,92 +829,100 @@ public class OperationListActivity extends ABVUIActivity {
progress = 40 / json.taskDtoList.size(); progress = 40 / json.taskDtoList.size();
} }
boolean isRoutineTask = operationDto.reportType == Constant.ReportType.Routine; boolean isRoutineTask = operationDto.reportType == ReportType.RoutineTask;
JSONObject taskReportJson; JSONObject taskReportJson = null;
for (TaskDto serverTaskDto : json.taskDtoList) { for (TaskDto serverTaskDto : json.taskDtoList) {
List<TaskReportDto> localRemove = new ArrayList(); List<TaskReportDto> localRemove = new ArrayList();
List<TaskReportDto> localTaskReportList = mTaskReportDao.getTaskReportListByTaskKey(serverTaskDto.taskKey);
for (TaskReportDto localTaskReportDto : localTaskReportList) {
if (!isExistsTaskReportInList(serverTaskDto.taskReportDtoList, localTaskReportDto, isRoutineTask)) { // 定期点検のみ、時間が変更になった場合、差分の削除が必要なため、以下の処理を行う
if (isRoutineTask) { // 定期点検以外の場合は、taskが存在しないので、削除処理は必要なし
mOperationLogic.deleteRoutineTaskReport(operationId, operationContentDto.contentId, localTaskReportDto); if (operationDto.reportType == ReportType.RoutineTask) {
} else { List<TaskReportDto> localTaskReportList = mTaskReportDao.getTaskReportListByTaskKey(serverTaskDto.taskKey);
// taskDtoが存在するとtaskReportLevel 0 (作業報告)が存在しないことはないので、報告(回答)のみチェックして削除 for (TaskReportDto localTaskReportDto : localTaskReportList) {
if (localTaskReportDto.taskReportLevel == Constant.TaskReportLevel.ReportReplyType) { if (!isExistsTaskReportInList(serverTaskDto.taskReportDtoList, localTaskReportDto)) {
// 作業報告のディレクトリ削除 if (isRoutineTask) {
mOperationLogic.deleteTaskFileData(operationId, operationContentDto.contentId, serverTaskDto.taskKey, localTaskReportDto.taskReportLevel); mOperationLogic.deleteRoutineTaskReport(operationId, operationContentDto.contentId, localTaskReportDto);
mTaskReportDao.delete(localTaskReportDto);
} }
} }
localTaskReportList.remove(localTaskReportDto);
} }
} }
if (isExistsTaskInList(localTaskList, serverTaskDto)) { if (isExistsTaskInList(localTaskList, serverTaskDto)) {
// 作業の報告更新 // 作業の報告更新
mTaskDao.update(serverTaskDto); mTaskDao.update(serverTaskDto);
localTaskList.remove(serverTaskDto);
} else { } else {
// 作業の報告登録 // 作業の報告登録
mTaskDao.insert(serverTaskDto); mTaskDao.insert(serverTaskDto);
} }
if (operationDto.reportType == Constant.ReportType.Routine) {
// サーバーからの情報で更新 // サーバーからの情報で更新
for (TaskReportDto taskReportDto : serverTaskDto.taskReportDtoList) { for (TaskReportDto serverTaskReportDto : serverTaskDto.taskReportDtoList) {
String reportAttachedFileName = taskReportDto.attachedFileName; String attachedFileName = serverTaskReportDto.attachedFileName;
taskReportDto.taskKey = serverTaskDto.taskKey; TaskReportDto localTaskReportDto;
if (operationDto.reportType == ReportType.RoutineTask) {
// 添付ファイルが存在する場合、取得して解凍する。 localTaskReportDto = mTaskReportDao.getRoutineTaskReport(serverTaskReportDto.taskKey, serverTaskReportDto.taskReportId, DateTimeUtil.toString(serverTaskReportDto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen));
refreshRoutineTaskFile(operationId, operationContentDto.contentId, serverTaskDto.taskId, serverTaskDto.taskKey, taskReportDto.taskReportId, taskReportDto.taskReportInfoId, taskReportDto.reportStartDate, reportAttachedFileName); } else {
if (isSyncGetTaskFileError) { localTaskReportDto = mTaskReportDao.selectByTaskKey(serverTaskReportDto.taskKey, serverTaskReportDto.taskReportLevel);
return null; }
} if (localTaskReportDto != null && localTaskReportDto.localSavedFlg) {
if (localTaskReportList.size() > 0 && isExistsTaskReportInList(localTaskReportList, taskReportDto, true)) { // 一時保存フラグがtureだと何もしない
// 報告データが存在すると作業報告を更新する continue;
mOperationLogic.updateRoutineTaskReport(serverTaskDto.operationId, operationContentDto.contentId, taskReportDto, false, false, false);
} else {
mOperationLogic.insertRoutineTaskReport(serverTaskDto.operationId, operationContentDto.contentId, taskReportDto, false, false);
}
} }
} else { if (operationDto.reportType == ReportType.RoutineTask) {
for (TaskReportDto serverTaskReportDto : serverTaskDto.taskReportDtoList) {
String attachedFileName = serverTaskReportDto.attachedFileName; serverTaskReportDto.taskKey = serverTaskDto.taskKey;
// 添付ファイルが存在する場合、取得して解凍する。
try { // 添付ファイルが存在する場合、取得して解凍する。
refreshTaskFile(operationId, serverTaskReportDto.taskReportLevel, operationContentDto.contentId, serverTaskDto.taskId, serverTaskDto.taskKey, serverTaskReportDto.attachedFileName); refreshRoutineTaskFile(operationId, operationContentDto.contentId, serverTaskDto.taskId, serverTaskDto.taskKey, serverTaskReportDto.taskReportId, serverTaskReportDto.taskReportInfoId, serverTaskReportDto.reportStartDate, attachedFileName);
} catch (Exception e) { if (isSyncGetTaskFileError) {
return null; return null;
} }
TaskReportDto localTaskReportDto = mTaskReportDao.selectByTaskKey(serverTaskReportDto.taskKey, serverTaskReportDto.taskReportLevel); if (localTaskReportDto != null) {
if (localTaskReportDto == null) { // 報告データが存在すると作業報告を更新する
// 登録 mOperationLogic.updateRoutineTaskReport(serverTaskDto.operationId, operationContentDto.contentId, serverTaskReportDto, false, false, false, localTaskReportDto.localSavedFlg);
if (serverTaskReportDto.jsonData.isEmpty()) {
// jsonDataが空で入る場合、taskReportJsonをnullで登録
mOperationLogic.insertTaskReport(serverTaskDto.taskKey, operationId, operationContentDto.contentId, serverTaskReportDto.taskReportLevel, serverTaskReportDto.enableReport,
null, attachedFileName, false, false);
} else { } else {
mOperationLogic.insertRoutineTaskReport(serverTaskDto.operationId, operationContentDto.contentId, serverTaskReportDto, false, false);
}
} else {
// 添付ファイルが存在する場合、取得して解凍する。
try {
refreshTaskFile(operationId, serverTaskReportDto.taskReportLevel, operationContentDto.contentId, serverTaskDto.taskId, serverTaskDto.taskKey, serverTaskReportDto.attachedFileName);
} catch (Exception e) {
return null;
}
if (!serverTaskReportDto.jsonData.isEmpty()) {
taskReportJson = new JSONObject(serverTaskReportDto.jsonData); taskReportJson = new JSONObject(serverTaskReportDto.jsonData);
if (serverTaskReportDto.taskReportLevel == Constant.TaskReportLevel.ReportType) { if (serverTaskReportDto.taskReportLevel == TaskReportLevel.ReportType) {
taskReportJson.put(ABookKeys.TASK_STATUS, serverTaskDto.taskStatus); taskReportJson.put(ABookKeys.TASK_STATUS, serverTaskDto.taskStatus);
} }
mOperationLogic.insertTaskReport(serverTaskDto.taskKey, operationId, operationContentDto.contentId, serverTaskReportDto.taskReportLevel, serverTaskReportDto.enableReport,
taskReportJson, attachedFileName, false, false);
} }
} else { if (localTaskReportDto == null) {
// 更新 // 登録
taskReportJson = new JSONObject(serverTaskReportDto.jsonData); mOperationLogic.insertTaskReport(serverTaskDto.taskKey, operationId, operationContentDto.contentId,
mOperationLogic.updateTaskReport(localTaskReportDto.taskKey, operationId, operationContentDto.contentId, localTaskReportDto.taskReportLevel, serverTaskReportDto.enableReport, serverTaskReportDto.taskReportLevel, serverTaskReportDto.enableReport,
taskReportJson, null, false, false); taskReportJson, attachedFileName, false, false, false);
} else {
// 更新
// jsonDataが空で入る場合、taskReportJsonをnullで登録
mOperationLogic.updateTaskReport(serverTaskDto.taskKey, operationId, operationContentDto.contentId,
serverTaskReportDto.taskReportLevel, serverTaskReportDto.enableReport,
taskReportJson, attachedFileName, false, false, localTaskReportDto.localSavedFlg);
}
} }
} }
}
progressCallback.callback(new Integer(progress)); progressCallback.callback(new Integer(progress));
} }
// サーバーから取得した作業情報がローカルに存在しないので削除する // サーバーから取得した作業情報がローカルに存在しないので削除する
for (TaskDto taskDto : localTaskList) { for (TaskDto taskDto : localTaskList) {
mOperationLogic.deleteTaskFileData(operationId, operationContentDto.contentId, taskDto.taskKey, Constant.TaskReportLevel.ReportType); mOperationLogic.deleteTaskFileData(operationId, operationContentDto.contentId, taskDto.taskKey, TaskReportLevel.ReportType);
mTaskDao.delete(taskDto); mTaskDao.delete(taskDto);
} }
lastEditDate = json.lastEditDate; lastEditDate = json.lastEditDate;
...@@ -1377,9 +1387,9 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1377,9 +1387,9 @@ public class OperationListActivity extends ABVUIActivity {
@Override @Override
public void onCheckedChanged(RadioGroup group, int checkedId) { public void onCheckedChanged(RadioGroup group, int checkedId) {
if (checkedId == R.id.in_gourp) { if (checkedId == R.id.in_gourp) {
mSendType = Constant.PushMessageSendType.InGroup; mSendType = PushMessageSendType.InGroup;
} else { } else {
mSendType = Constant.PushMessageSendType.AllOperation; mSendType = PushMessageSendType.AllOperation;
} }
} }
}); });
...@@ -1525,22 +1535,15 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1525,22 +1535,15 @@ public class OperationListActivity extends ABVUIActivity {
* @param rDto * @param rDto
* @return * @return
*/ */
private boolean isExistsTaskReportInList(List<TaskReportDto> listDto, TaskReportDto rDto, boolean isRoutineTask) { private boolean isExistsTaskReportInList(List<TaskReportDto> listDto, TaskReportDto rDto) {
for (TaskReportDto lDto : listDto) { for (TaskReportDto lDto : listDto) {
if (isRoutineTask) { // 定期点検の場合、taskKey,taskReportId,reportStartDateで判定
// 定期点検の場合、taskKey,taskReportId,reportStartDateで判定 if (lDto.taskKey.equals(rDto.taskKey) &&
if (lDto.taskKey.equals(rDto.taskKey) && lDto.taskReportId == rDto.taskReportId &&
lDto.taskReportId == rDto.taskReportId && lDto.reportStartDate.equals(rDto.reportStartDate)) {
lDto.reportStartDate.equals(rDto.reportStartDate)) { return true;
return true;
}
} else {
// taskKeyと作業報告階層で判定
if (lDto.taskKey.equals(rDto.taskKey) &&
lDto.taskReportLevel == rDto.taskReportLevel) {
return true;
}
} }
} }
return false; return false;
} }
...@@ -1743,9 +1746,9 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1743,9 +1746,9 @@ public class OperationListActivity extends ABVUIActivity {
private ArrayList<Integer> getOperationReportTypeList(boolean isAll) { private ArrayList<Integer> getOperationReportTypeList(boolean isAll) {
ArrayList<Integer> operationReportTypes = new ArrayList<>(); ArrayList<Integer> operationReportTypes = new ArrayList<>();
if (isAll) { if (isAll) {
operationReportTypes.add(OperationReportType.REPORT_TYPE); operationReportTypes.add(ReportType.Report);
operationReportTypes.add(OperationReportType.ROUTINE_TASK); operationReportTypes.add(ReportType.RoutineTask);
operationReportTypes.add(OperationReportType.REPORT_RESPONSE_TYPE); operationReportTypes.add(ReportType.ReportReply);
} else { } else {
operationReportTypes = getABVUIDataCache().getOperationReportTypes(); operationReportTypes = getABVUIDataCache().getOperationReportTypes();
} }
......
...@@ -5,15 +5,14 @@ import android.view.LayoutInflater; ...@@ -5,15 +5,14 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import jp.agentec.abook.abv.bl.acms.type.OperationButtonType;
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.Constant; import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.Constant.ReportType;
import jp.agentec.abook.abv.bl.dto.OperationDto; import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
...@@ -32,31 +31,27 @@ public class OperationListAdapter extends AbstractOperationAdapter { ...@@ -32,31 +31,27 @@ public class OperationListAdapter extends AbstractOperationAdapter {
private static final String TAG = "OperationListAdapter"; private static final String TAG = "OperationListAdapter";
private Context mContext; private Context mContext;
private LayoutInflater mInflater; private LayoutInflater mInflater;
private List<OperationDto> mListItem = new ArrayList<>();
private boolean mNormalSizeFlg; private boolean mNormalSizeFlg;
public OperationListAdapter(Context context, List<OperationDto> listItem) { public OperationListAdapter(Context context, List<OperationDto> listItem) {
mContext = context; mContext = context;
mListItem = listItem; this.listItem = listItem;
mNormalSizeFlg = ((OperationListActivity)context).isNormalSize(); mNormalSizeFlg = ((OperationListActivity)context).isNormalSize();
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
} }
public List<OperationDto> getData() {
return mListItem;
}
@Override @Override
public int getCount() { public int getCount() {
return mListItem.size(); return listItem.size();
} }
@Override @Override
public OperationDto getItem(int position) { public OperationDto getItem(int position) {
return mListItem.get(position); return listItem.get(position);
} }
@Override @Override
public long getItemId(int position) { public long getItemId(int position) {
return mListItem.get(position).operationId; return listItem.get(position).operationId;
} }
@Override @Override
...@@ -65,14 +60,19 @@ public class OperationListAdapter extends AbstractOperationAdapter { ...@@ -65,14 +60,19 @@ public class OperationListAdapter extends AbstractOperationAdapter {
if (convertView == null) { if (convertView == null) {
convertView = mInflater.inflate(R.layout.item_operation_list, parent, false); convertView = mInflater.inflate(R.layout.item_operation_list, parent, false);
holder = new ViewHolder(); holder = new ViewHolder();
holder.tvOperationName = (TextView) convertView.findViewById(R.id.operation_name); holder.tvOperationName = convertView.findViewById(R.id.operation_name);
holder.tvDate = (TextView) convertView.findViewById(R.id.operation_date); holder.tvDate = convertView.findViewById(R.id.operation_date);
// 報告タイプ
holder.ivReportType = convertView.findViewById(R.id.report_type);
// 作業ベースタイプ
holder.ivOperationType = convertView.findViewById(R.id.operation_type);
// 360編集関連 // 360編集関連
holder.ivPanoEdit = (ImageView) convertView.findViewById(R.id.btn_pano_edit); holder.ivPanoEdit = convertView.findViewById(R.id.btn_pano_edit);
// 情報更新関連 // 情報更新関連
holder.ivInformationUpdate = (ImageView) convertView.findViewById(R.id.btn_information_update); holder.ivSync = convertView.findViewById(R.id.btn_sync);
convertView.setTag(holder); convertView.setTag(holder);
} else { } else {
...@@ -82,9 +82,13 @@ public class OperationListAdapter extends AbstractOperationAdapter { ...@@ -82,9 +82,13 @@ public class OperationListAdapter extends AbstractOperationAdapter {
final OperationDto operationDto = getItem(position); final OperationDto operationDto = getItem(position);
if (operationDto != null) { if (operationDto != null) {
boolean noRoutineTaskAll = (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK && operationDto.reportCount == 0); // タイプによってイメージのセット
setImageReportType(holder, operationDto.reportType);
setImageOperationType(holder, operationDto.operationType);
boolean noRoutineTaskAll = (operationDto.reportType == ReportType.RoutineTask && operationDto.reportCount == 0);
holder.tvOperationName.setText(operationDto.operationName); holder.tvOperationName.setText(operationDto.operationName);
if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == ReportType.RoutineTask) {
if (StringUtil.isNullOrEmpty(operationDto.reportPeriod)) { if (StringUtil.isNullOrEmpty(operationDto.reportPeriod)) {
holder.tvDate.setText(mContext.getString(R.string.date_label_routineTask) + " : " + mContext.getString(R.string.msg_no_report_data)); holder.tvDate.setText(mContext.getString(R.string.date_label_routineTask) + " : " + mContext.getString(R.string.msg_no_report_data));
} else { } else {
...@@ -97,49 +101,51 @@ public class OperationListAdapter extends AbstractOperationAdapter { ...@@ -97,49 +101,51 @@ public class OperationListAdapter extends AbstractOperationAdapter {
// 同期ボタン表示・非表示 // 同期ボタン表示・非表示
if (operationDto.contentId != null && operationDto.contentId != 0) { if (operationDto.contentId != null && operationDto.contentId != 0) {
if ((operationDto.needSyncFlg)) { if ((operationDto.needSyncFlg)) {
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, true); holder.ivSync.setVisibility(View.VISIBLE);
} else { } else {
// needSyncFlgがfalseの場合 // needSyncFlgがfalseの場合
if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == ReportType.RoutineTask) {
// 定期点検プロジェクトの場合のみ、以下の処理を行う // 定期点検プロジェクトの場合のみ、以下の処理を行う
String syncedDate = getUserPref(mContext, String.format(AppDefType.UserPrefKey.SYNCED_OPERATION_ID, operationDto.operationId), ""); String syncedDate = getUserPref(mContext, String.format(AppDefType.UserPrefKey.SYNCED_OPERATION_ID, operationDto.operationId), "");
if (StringUtil.isNullOrEmpty(operationDto.reportPeriod) && !syncedDate.equals(DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMdd_none))) { if (StringUtil.isNullOrEmpty(operationDto.reportPeriod) && !syncedDate.equals(DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMdd_none))) {
// 同期ボタンタップの日付と現在の日付が異なる且つ、作業するデータが存在しない場合 // 同期ボタンタップの日付と現在の日付が異なる且つ、作業するデータが存在しない場合
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, true); holder.ivSync.setVisibility(View.VISIBLE);
} else { } else {
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, false); holder.ivSync.setVisibility(View.INVISIBLE);
} }
} else { } else {
// 定期点検プロジェクトではない場合、同期ボタンを非活性化する // 定期点検プロジェクトではない場合、同期ボタンを非活性化する
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, false); holder.ivSync.setVisibility(View.INVISIBLE);
} }
} }
} else { } else {
// プロジェクトのコンテンツが存在しない場合は、同期ボタンを非活性化する // プロジェクトのコンテンツが存在しない場合は、同期ボタンを非活性化する
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, false); holder.ivSync.setVisibility(View.INVISIBLE);
} }
if(operationDto.operationType == OperationType.PANO) { if(operationDto.operationType == OperationType.PANO) {
// 360タイプのみ360編集ボタン表示 if (operationDto.enableReportEdit == Constant.EnableReportEdit.NO) {
holder.ivPanoEdit.setVisibility(View.VISIBLE); holder.ivPanoEdit.setVisibility(View.INVISIBLE);
if (operationDto.contentCreatingFlg) { //Panoコンテンツ作成中の状態
setButtonEnabled(holder, OperationButtonType.PANO_EDIT, false);
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, false);
} else { } else {
if (operationDto.contentId == null || operationDto.contentId != 0) { // 360タイプのみ360編集ボタン表示
setButtonEnabled(holder, OperationButtonType.PANO_EDIT, true); holder.ivPanoEdit.setVisibility(View.VISIBLE);
if (operationDto.contentCreatingFlg) { //Panoコンテンツ作成中の状態
holder.ivPanoEdit.setVisibility(View.INVISIBLE);
holder.ivSync.setVisibility(View.INVISIBLE);
} else { } else {
setButtonEnabled(holder, OperationButtonType.PANO_EDIT, false); if (operationDto.contentId == null || operationDto.contentId != 0) {
holder.ivPanoEdit.setVisibility(View.VISIBLE);
} else {
holder.ivPanoEdit.setVisibility(View.INVISIBLE);
}
} }
} }
} else { } else {
holder.ivPanoEdit.setVisibility(View.INVISIBLE); holder.ivPanoEdit.setVisibility(View.INVISIBLE);
} }
if(operationDto.enableReportEdit == Constant.EnableReportEdit.NO) {
holder.ivPanoEdit.setVisibility(View.GONE);
}
holder.ivPanoEdit.setOnClickListener(new View.OnClickListener() { holder.ivPanoEdit.setOnClickListener(new View.OnClickListener() {
@Override @Override
...@@ -148,7 +154,7 @@ public class OperationListAdapter extends AbstractOperationAdapter { ...@@ -148,7 +154,7 @@ public class OperationListAdapter extends AbstractOperationAdapter {
} }
}); });
holder.ivInformationUpdate.setOnClickListener(new View.OnClickListener() { holder.ivSync.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
listener.onSyncOperation(operationDto); listener.onSyncOperation(operationDto);
...@@ -162,26 +168,49 @@ public class OperationListAdapter extends AbstractOperationAdapter { ...@@ -162,26 +168,49 @@ public class OperationListAdapter extends AbstractOperationAdapter {
private static class ViewHolder { private static class ViewHolder {
TextView tvOperationName; TextView tvOperationName;
TextView tvDate; TextView tvDate;
ImageView ivReportType;
ImageView ivOperationType;
// 360編集関連 // 360編集関連
ImageView ivPanoEdit; ImageView ivPanoEdit;
// 情報更新関連 // 情報更新関連
ImageView ivInformationUpdate; ImageView ivSync;
} }
/**
* 作業一覧の各ボタンの活性化、非活性化に変更する // ReportTypeで画像の設定
* @param holder private void setImageReportType(ViewHolder holder, int reportType) {
* @param buttonType switch (reportType) {
* @param isEnabled case Constant.ReportType.Report :
*/ // 報告タイプ
private void setButtonEnabled(ViewHolder holder, int buttonType, boolean isEnabled) { holder.ivReportType.setBackgroundResource(R.drawable.ic_list_type1);
switch (buttonType) { break;
case OperationButtonType.PANO_EDIT : case Constant.ReportType.RoutineTask :
holder.ivPanoEdit.setEnabled(isEnabled); // 定期点検タイプ
holder.ivReportType.setBackgroundResource(R.drawable.ic_list_type2);
break;
case Constant.ReportType.ReportReply :
// 報告(回答)タイプ
holder.ivReportType.setBackgroundResource(R.drawable.ic_list_type3);
break;
}
}
// OperationTypeで画像の設定
private void setImageOperationType(ViewHolder holder, int operationType) {
switch (operationType) {
case OperationType.LIST :
// リスト
holder.ivOperationType.setBackgroundResource(R.drawable.ic_list);
break;
case OperationType.PANO :
// 360
holder.ivOperationType.setBackgroundResource(R.drawable.ic_list_360);
break; break;
case OperationButtonType.INFORMATION_UPDATE: case OperationType.PDF :
holder.ivInformationUpdate.setEnabled(isEnabled); // PDF
holder.ivOperationType.setBackgroundResource(R.drawable.ic_list_draw);
break; break;
} }
} }
......
...@@ -5,14 +5,13 @@ import android.view.LayoutInflater; ...@@ -5,14 +5,13 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import java.util.List; import java.util.List;
import jp.agentec.abook.abv.bl.acms.type.OperationButtonType;
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.Constant; import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.Constant.ReportType;
import jp.agentec.abook.abv.bl.dto.OperationDto; import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
...@@ -73,19 +72,18 @@ public class OperationPanelAdapter extends AbstractOperationAdapter { ...@@ -73,19 +72,18 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
return listItem.get(position).operationId; return listItem.get(position).operationId;
} }
public List<OperationDto> getListItem() {
return listItem;
}
private static class ViewHolder { private static class ViewHolder {
TextView tvOperationName; TextView tvOperationName;
TextView tvDate; TextView tvDate;
TextView tvDescription;
ImageView ivReportType;
ImageView ivOperationType;
// 360編集関連 // 360編集関連
ImageView ivPanoEdit; ImageView ivPanoEdit;
// 情報更新関連 // 同期関連
ImageView ivInformationUpdate; ImageView ivSync;
} }
@Override @Override
...@@ -94,14 +92,19 @@ public class OperationPanelAdapter extends AbstractOperationAdapter { ...@@ -94,14 +92,19 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
if (convertView == null) { if (convertView == null) {
convertView = mInflater.inflate(R.layout.item_operation_panel, parent, false); convertView = mInflater.inflate(R.layout.item_operation_panel, parent, false);
holder = new OperationPanelAdapter.ViewHolder(); holder = new OperationPanelAdapter.ViewHolder();
holder.tvOperationName = (TextView) convertView.findViewById(R.id.operation_name); holder.tvOperationName = convertView.findViewById(R.id.operation_name);
holder.tvDate = (TextView) convertView.findViewById(R.id.operation_date); holder.tvDate = convertView.findViewById(R.id.operation_date);
// 報告タイプ
holder.ivReportType = convertView.findViewById(R.id.report_type);
// 作業ベースタイプ
holder.ivOperationType = convertView.findViewById(R.id.operation_type);
// 360編集関連 // 360編集関連
holder.ivPanoEdit = (ImageView) convertView.findViewById(R.id.btn_pano_edit); holder.ivPanoEdit = convertView.findViewById(R.id.btn_pano_edit);
// 情報更新関連 // 同期関連
holder.ivInformationUpdate = (ImageView) convertView.findViewById(R.id.btn_information_update); holder.ivSync = convertView.findViewById(R.id.btn_sync);
convertView.setTag(holder); convertView.setTag(holder);
} else { } else {
...@@ -111,9 +114,13 @@ public class OperationPanelAdapter extends AbstractOperationAdapter { ...@@ -111,9 +114,13 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
final OperationDto operationDto = getItem(position); final OperationDto operationDto = getItem(position);
if (operationDto != null) { if (operationDto != null) {
boolean noRoutineTaskAll = (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK && operationDto.reportCount == 0); setImageReportType(holder, operationDto.reportType);
setImageOperationType(holder, operationDto.operationType);
boolean noRoutineTaskAll = (operationDto.reportType == ReportType.RoutineTask && operationDto.reportCount == 0);
holder.tvOperationName.setText(operationDto.operationName); holder.tvOperationName.setText(operationDto.operationName);
if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == ReportType.RoutineTask) {
if (StringUtil.isNullOrEmpty(operationDto.reportPeriod)) { if (StringUtil.isNullOrEmpty(operationDto.reportPeriod)) {
holder.tvDate.setText(mContext.getString(R.string.date_label_routineTask) + " : " + mContext.getString(R.string.msg_no_report_data)); holder.tvDate.setText(mContext.getString(R.string.date_label_routineTask) + " : " + mContext.getString(R.string.msg_no_report_data));
} else { } else {
...@@ -126,40 +133,42 @@ public class OperationPanelAdapter extends AbstractOperationAdapter { ...@@ -126,40 +133,42 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
// 同期ボタン表示・非表示 // 同期ボタン表示・非表示
if (operationDto.contentId != null && operationDto.contentId != 0) { if (operationDto.contentId != null && operationDto.contentId != 0) {
if ((operationDto.needSyncFlg)) { if ((operationDto.needSyncFlg)) {
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, true); holder.ivSync.setVisibility(View.VISIBLE);
} else { } else {
// needSyncFlgがfalseの場合 // needSyncFlgがfalseの場合
if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == ReportType.RoutineTask) {
// 定期点検プロジェクトの場合のみ、以下の処理を行う // 定期点検プロジェクトの場合のみ、以下の処理を行う
String syncedDate = getUserPref(mContext, String.format(AppDefType.UserPrefKey.SYNCED_OPERATION_ID, operationDto.operationId), ""); String syncedDate = getUserPref(mContext, String.format(AppDefType.UserPrefKey.SYNCED_OPERATION_ID, operationDto.operationId), "");
if (StringUtil.isNullOrEmpty(operationDto.reportPeriod) && !syncedDate.equals(DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMdd_none))) { if (StringUtil.isNullOrEmpty(operationDto.reportPeriod) && !syncedDate.equals(DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMdd_none))) {
// 同期ボタンタップの日付と現在の日付が異なる且つ、作業するデータが存在しない場合 // 同期ボタンタップの日付と現在の日付が異なる且つ、作業するデータが存在しない場合
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, true); holder.ivSync.setVisibility(View.VISIBLE);
} else { } else {
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, false); holder.ivSync.setVisibility(View.INVISIBLE);
} }
} else { } else {
// 定期点検プロジェクトではない場合、同期ボタンを非活性化する // 定期点検プロジェクトではない場合、同期ボタンを非活性化する
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, false); holder.ivSync.setVisibility(View.INVISIBLE);
} }
} }
} else { } else {
// プロジェクトのコンテンツが存在しない場合は、同期ボタンを非活性化する // プロジェクトのコンテンツが存在しない場合は、同期ボタンを非活性化する
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, false); holder.ivSync.setVisibility(View.INVISIBLE);
} }
if(operationDto.operationType == OperationType.PANO) { if(operationDto.operationType == OperationType.PANO) {
// 360タイプのみ360編集ボタン表示 if (operationDto.enableReportEdit == Constant.EnableReportEdit.NO) {
holder.ivPanoEdit.setVisibility(View.VISIBLE); holder.ivPanoEdit.setVisibility(View.INVISIBLE);
if (operationDto.contentCreatingFlg) { //Panoコンテンツ作成中の状態
setButtonEnabled(holder, OperationButtonType.PANO_EDIT, false);
setButtonEnabled(holder, OperationButtonType.INFORMATION_UPDATE, false);
} else { } else {
if (operationDto.contentId != null && operationDto.contentId != 0) { if (operationDto.contentCreatingFlg) { //Panoコンテンツ作成中の状態
setButtonEnabled(holder, OperationButtonType.PANO_EDIT, true); holder.ivPanoEdit.setVisibility(View.INVISIBLE);
holder.ivSync.setVisibility(View.INVISIBLE);
} else { } else {
setButtonEnabled(holder, OperationButtonType.PANO_EDIT, false); if (operationDto.contentId != null && operationDto.contentId != 0) {
holder.ivPanoEdit.setVisibility(View.VISIBLE);
} else {
holder.ivPanoEdit.setVisibility(View.INVISIBLE);
}
} }
} }
} else { } else {
...@@ -173,7 +182,7 @@ public class OperationPanelAdapter extends AbstractOperationAdapter { ...@@ -173,7 +182,7 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
} }
}); });
holder.ivInformationUpdate.setOnClickListener(new View.OnClickListener() { holder.ivSync.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
listener.onSyncOperation(operationDto); listener.onSyncOperation(operationDto);
...@@ -184,13 +193,38 @@ public class OperationPanelAdapter extends AbstractOperationAdapter { ...@@ -184,13 +193,38 @@ public class OperationPanelAdapter extends AbstractOperationAdapter {
return convertView; return convertView;
} }
private void setButtonEnabled(OperationPanelAdapter.ViewHolder holder, int buttonType, boolean isEnabled) { // ReportTypeで画像の設定
switch (buttonType) { private void setImageReportType(ViewHolder holder, int reportType) {
case OperationButtonType.PANO_EDIT : switch (reportType) {
holder.ivPanoEdit.setEnabled(isEnabled); case ReportType.Report :
// 報告タイプ
holder.ivReportType.setBackgroundResource(R.drawable.ic_panel_type1);
break;
case ReportType.RoutineTask :
// 定期点検タイプ
holder.ivReportType.setBackgroundResource(R.drawable.ic_panel_type2);
break;
case ReportType.ReportReply :
// 報告(回答)タイプ
holder.ivReportType.setBackgroundResource(R.drawable.ic_panel_type3);
break;
}
}
// OperationTypeで画像の設定
private void setImageOperationType(OperationPanelAdapter.ViewHolder holder, int operationType) {
switch (operationType) {
case OperationType.LIST :
// リスト
holder.ivOperationType.setBackgroundResource(R.drawable.ic_panel_list);
break;
case OperationType.PANO :
// 360
holder.ivOperationType.setBackgroundResource(R.drawable.ic_panel_360);
break; break;
case OperationButtonType.INFORMATION_UPDATE: case OperationType.PDF :
holder.ivInformationUpdate.setEnabled(isEnabled); // PDF
holder.ivOperationType.setBackgroundResource(R.drawable.ic_panel_draw);
break; break;
} }
} }
......
...@@ -84,12 +84,12 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -84,12 +84,12 @@ public class ABookCheckWebViewHelper extends ABookHelper {
switch (cmd) { switch (cmd) {
case ABookKeys.CMD_INSERT_TASK_REPORT: case ABookKeys.CMD_INSERT_TASK_REPORT:
case ABookKeys.CMD_UPDATE_TASK_REPORT: case ABookKeys.CMD_UPDATE_TASK_REPORT:
insertOrUpdateTaskReport(taskKey, enableReportHistory, operationId, contentId, param, contentPath, reportType, taskReportLevel, true); insertOrUpdateTaskReport(taskKey, enableReportHistory, operationId, contentId, param, contentPath, reportType, taskReportLevel, false);
copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel); copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel);
sendTaskData(context, operationId, taskKey, taskReportLevel); sendTaskData(context, operationId, taskKey, taskReportLevel);
break; break;
case ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT: case ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT:
insertOrUpdateTaskReport(taskKey, enableReportHistory, operationId, contentId, param, contentPath, reportType, taskReportLevel, false); insertOrUpdateTaskReport(taskKey, enableReportHistory, operationId, contentId, param, contentPath, reportType, taskReportLevel, true);
copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel); copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel);
ABVToastUtil.showMakeText(context, R.string.msg_temp_save_result, Toast.LENGTH_SHORT); ABVToastUtil.showMakeText(context, R.string.msg_temp_save_result, Toast.LENGTH_SHORT);
mFinishCallback.callback(true); mFinishCallback.callback(true);
...@@ -99,7 +99,7 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -99,7 +99,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
String reportStartDate = ""; String reportStartDate = "";
boolean sendTaskReportDataFlg = false; boolean sendTaskReportDataFlg = false;
if (reportType == Constant.ReportType.Routine) { if (reportType == Constant.ReportType.RoutineTask) {
taskReportId = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_ID)); taskReportId = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_ID));
reportStartDate = param.get(ABookKeys.REPORT_START_DATE).replace("T", " "); reportStartDate = param.get(ABookKeys.REPORT_START_DATE).replace("T", " ");
mOperationLogic.deleteRoutineTaskReport(operationId, contentId, taskKey, taskReportId, reportStartDate); mOperationLogic.deleteRoutineTaskReport(operationId, contentId, taskKey, taskReportId, reportStartDate);
...@@ -131,7 +131,6 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -131,7 +131,6 @@ public class ABookCheckWebViewHelper extends ABookHelper {
mFinishCallback.callback(false); mFinishCallback.callback(false);
break; break;
} }
} }
/** /**
...@@ -281,7 +280,7 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -281,7 +280,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
* @param taskReportLevel * @param taskReportLevel
* @throws IOException * @throws IOException
*/ */
private void insertOrUpdateTaskReport(String taskKey, int enableReportHistory, long operationId, long contentId, Map<String, String> param, String contentPath, int reportType, int taskReportLevel, boolean dataSendFlg) throws IOException { private void insertOrUpdateTaskReport(String taskKey, int enableReportHistory, long operationId, long contentId, Map<String, String> param, String contentPath, int reportType, int taskReportLevel, boolean localSavedFlg) throws IOException {
int taskReportSendId = 0; int taskReportSendId = 0;
boolean attachedChangeFlag = param.get(ABookKeys.ATTACHED_CHANGE_FLAG).equals("1") ? true : false; boolean attachedChangeFlag = param.get(ABookKeys.ATTACHED_CHANGE_FLAG).equals("1") ? true : false;
String taskReport = param.get(ABookKeys.TASK_REPORT); String taskReport = param.get(ABookKeys.TASK_REPORT);
...@@ -289,14 +288,14 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -289,14 +288,14 @@ public class ABookCheckWebViewHelper extends ABookHelper {
int taskReportId = 0; int taskReportId = 0;
String reportStartDate = ""; String reportStartDate = "";
if (reportType == Constant.ReportType.Routine) { if (reportType == Constant.ReportType.RoutineTask) {
taskReportId = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_ID)); taskReportId = Integer.valueOf(param.get(ABookKeys.TASK_REPORT_ID));
reportStartDate = param.get(ABookKeys.REPORT_START_DATE); reportStartDate = param.get(ABookKeys.REPORT_START_DATE);
reportStartDate = reportStartDate.replace("T", " "); reportStartDate = reportStartDate.replace("T", " ");
TaskReportDto taskReportDto = mOperationLogic.getRoutineTaskReportUtc(taskKey, taskReportId, reportStartDate); TaskReportDto taskReportDto = mOperationLogic.getRoutineTaskReportUtc(taskKey, taskReportId, reportStartDate);
taskReportDto.jsonData = taskReport; taskReportDto.jsonData = taskReport;
mOperationLogic.updateRoutineTaskReport(operationId, contentId, taskReportDto, attachedChangeFlag, true, true); mOperationLogic.updateRoutineTaskReport(operationId, contentId, taskReportDto, attachedChangeFlag, true, true, localSavedFlg);
mOperationLogic.createJsonForOperationContent(operationId, contentPath, true); mOperationLogic.createJsonForOperationContent(operationId, contentPath, true);
copyRoutineTaskReportAttachedMovie(operationId, contentId, taskKey, taskReportId, reportStartDate); copyRoutineTaskReportAttachedMovie(operationId, contentId, taskKey, taskReportId, reportStartDate);
...@@ -310,27 +309,26 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -310,27 +309,26 @@ public class ABookCheckWebViewHelper extends ABookHelper {
TaskReportDto taskReportDto = mOperationLogic.getTaskReport(taskKey, taskReportLevel); TaskReportDto taskReportDto = mOperationLogic.getTaskReport(taskKey, taskReportLevel);
if (taskReportDto != null) { if (taskReportDto != null) {
// 更新 // 更新
mOperationLogic.updateTaskReport(taskReportDto.taskKey, operationId, contentId, taskReportLevel, Constant.EnableReport.YES, taskReportJson, null, attachedChangeFlag, dataSendFlg); mOperationLogic.updateTaskReport(taskReportDto.taskKey, operationId, contentId, taskReportLevel, Constant.EnableReport.YES, taskReportJson, null, attachedChangeFlag, localSavedFlg ? false : true, localSavedFlg);
} else { } else {
// 登録 // 登録
mOperationLogic.insertTaskReport(taskKey, operationId, contentId, taskReportLevel, Constant.EnableReport.YES, taskReportJson, null, attachedChangeFlag, dataSendFlg); mOperationLogic.insertTaskReport(taskKey, operationId, contentId, taskReportLevel, Constant.EnableReport.YES, taskReportJson, null, attachedChangeFlag, localSavedFlg ? false : true, localSavedFlg);
} }
mOperationLogic.createJsonForOperationContent(operationId, contentPath, false); mOperationLogic.createJsonForOperationContent(operationId, contentPath, false);
copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel); copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel);
} }
if (dataSendFlg) { if (!localSavedFlg) {
if (enableReportHistory == Constant.EnableReportHistory.Invalid) { if (enableReportHistory == Constant.EnableReportHistory.Invalid) {
//データ無い場合は中でinsertされる //データ無い場合は中でinsertされる
taskReportSendId = mOperationLogic.updateTaskReportSend(taskKey, taskReportId, reportStartDate, taskReportJson, false); taskReportSendId = mOperationLogic.updateTaskReportSend(taskKey, taskReportId, reportStartDate, taskReportJson, false);
} else { } else {
taskReportSendId = mOperationLogic.insertTaskReportSend(taskKey, taskReportId, reportStartDate, taskReportJson, false); taskReportSendId = mOperationLogic.insertTaskReportSend(taskKey, taskReportId, reportStartDate, taskReportJson, false);
} }
// #32926 作業報告画面改善 start
copyReportTaskSendFiles(operationId, taskKey, taskReportSendId, reportType == Constant.ReportType.RoutineTask, taskReportId, reportStartDate, taskReportLevel);
// #32926 作業報告画面改善 end
} }
// #32926 作業報告画面改善 start
copyReportTaskSendFiles(operationId, taskKey, taskReportSendId, reportType == Constant.ReportType.Routine, taskReportId, reportStartDate, taskReportLevel);
// #32926 作業報告画面改善 end
} }
// xwalkで動画ファイルにアクセスするため、../files/..の以下のパスのディレクトりを../cache/..以下のパスに変更 // xwalkで動画ファイルにアクセスするため、../files/..の以下のパスのディレクトりを../cache/..以下のパスに変更
...@@ -340,7 +338,7 @@ public class ABookCheckWebViewHelper extends ABookHelper { ...@@ -340,7 +338,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
for (TaskDto taskDto : taskDtoList) { for (TaskDto taskDto : taskDtoList) {
List<TaskReportDto> taskReportDtoList = mOperationLogic.getTaskReportByTaskKey(taskDto.taskKey); List<TaskReportDto> taskReportDtoList = mOperationLogic.getTaskReportByTaskKey(taskDto.taskKey);
for (TaskReportDto taskReportDto : taskReportDtoList) { for (TaskReportDto taskReportDto : taskReportDtoList) {
if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK) { if (operationDto.reportType == Constant.ReportType.RoutineTask) {
copyRoutineTaskReportAttachedMovie(operationId, contentId, taskReportDto.taskKey, taskReportDto.taskReportId, taskReportDto.reportStartDate); copyRoutineTaskReportAttachedMovie(operationId, contentId, taskReportDto.taskKey, taskReportDto.taskReportId, taskReportDto.reportStartDate);
} else { } else {
copyTaskAttachedMovie(operationId, contentId, taskDto.taskKey, taskReportDto.taskReportLevel); copyTaskAttachedMovie(operationId, contentId, taskDto.taskKey, taskReportDto.taskReportLevel);
......
...@@ -244,7 +244,7 @@ public class ParentWebViewActivity extends ABVContentViewActivity { ...@@ -244,7 +244,7 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
progressDialog.setProgress(20); progressDialogHorizontal.setProgress(20);
webViewLoadUrl(String.format("javascript:CHK_E.checkResourceEntry('%s')", resourceId)); webViewLoadUrl(String.format("javascript:CHK_E.checkResourceEntry('%s')", resourceId));
} }
}); });
...@@ -252,21 +252,21 @@ public class ParentWebViewActivity extends ABVContentViewActivity { ...@@ -252,21 +252,21 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
handler.post(new Runnable() { handler.post(new Runnable() {
@Override @Override
public void run() { public void run() {
int progress = progressDialog.getProgress(); int progress = progressDialogHorizontal.getProgress();
if (progress == 0) { if (progress == 0) {
return; return;
} else if (progress == 100) { } else if (progress == 100) {
progressDialog.setProgress(0); progressDialogHorizontal.setProgress(0);
closeProgressPopup(); closeProgressPopup();
} else if (progress < 100 && progress > 80) { } else if (progress < 100 && progress > 80) {
progressDialog.setProgress(progress + 1); progressDialogHorizontal.setProgress(progress + 1);
handler.postDelayed(this, 2000); handler.postDelayed(this, 2000);
} else if (progress <= 80 && progress >= 60) { } else if (progress <= 80 && progress >= 60) {
progressDialog.setProgress(progress + 2); progressDialogHorizontal.setProgress(progress + 2);
handler.postDelayed(this, 1000); handler.postDelayed(this, 1000);
} else if (progress < 60) { } else if (progress < 60) {
progressDialog.setProgress(progress + 4); progressDialogHorizontal.setProgress(progress + 4);
handler.postDelayed(this, 1000); handler.postDelayed(this, 1000);
} }
} }
......
...@@ -278,15 +278,15 @@ public class OperationTaskLayout extends RelativeLayout { ...@@ -278,15 +278,15 @@ public class OperationTaskLayout extends RelativeLayout {
final String script = String.format(SCRIPT_SHOW_TASK_LIST, pageNum + 1); final String script = String.format(SCRIPT_SHOW_TASK_LIST, pageNum + 1);
RelativeLayout.LayoutParams params; RelativeLayout.LayoutParams params;
if (isNormalSize) { // if (isNormalSize) {
params = createParam(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); params = createParam(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
} else { // } else {
DisplayMetrics displayMetrics = getResources().getDisplayMetrics(); // DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
int halfWidth = (int) (displayMetrics.density * OperationTaskLayout.HALF_WIDTH); // int halfWidth = (int) (displayMetrics.density * OperationTaskLayout.HALF_WIDTH);
int screenWidth = displayMetrics.widthPixels; // int screenWidth = displayMetrics.widthPixels;
params = createParam(halfWidth, ViewGroup.LayoutParams.WRAP_CONTENT); // params = createParam(halfWidth, ViewGroup.LayoutParams.WRAP_CONTENT);
params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); // params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
} // }
setLayoutParams(params); setLayoutParams(params);
...@@ -335,20 +335,20 @@ public class OperationTaskLayout extends RelativeLayout { ...@@ -335,20 +335,20 @@ public class OperationTaskLayout extends RelativeLayout {
public void setTaskFormPosition(float screenX, boolean isNormalSize) { public void setTaskFormPosition(float screenX, boolean isNormalSize) {
RelativeLayout.LayoutParams params; RelativeLayout.LayoutParams params;
if (isNormalSize) { // if (isNormalSize) {
params = createParam(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); params = createParam(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
} else { // } else {
DisplayMetrics displayMetrics = getResources().getDisplayMetrics(); // DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
int halfWidth = (int) (displayMetrics.density * OperationTaskLayout.HALF_WIDTH); // int halfWidth = (int) (displayMetrics.density * OperationTaskLayout.HALF_WIDTH);
int screenWidth = displayMetrics.widthPixels; // int screenWidth = displayMetrics.widthPixels;
params = createParam(halfWidth, ViewGroup.LayoutParams.WRAP_CONTENT); // params = createParam(halfWidth, ViewGroup.LayoutParams.WRAP_CONTENT);
//
if (screenX < screenWidth / 2) { // if (screenX < screenWidth / 2) {
params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); // params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
} else { // } else {
params.addRule(RelativeLayout.ALIGN_PARENT_LEFT); // params.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
} // }
} // }
setLayoutParams(params); setLayoutParams(params);
} }
......
...@@ -38,8 +38,8 @@ app_versioncode=1 ...@@ -38,8 +38,8 @@ app_versioncode=1
# abvEnvironments.xml # abvEnvironments.xml
#cms server #cms server
acms_address=https://abook188-1.abook.bz/acms acms_address=https://abook189.abook.bz/acms
download_server_address=https://abook188-1.abook.bz/acms download_server_address=https://abook189.abook.bz/acms
#syncview server #syncview server
websocket_server_http_url=https://abookplus.agentec.jp/v1 websocket_server_http_url=https://abookplus.agentec.jp/v1
......
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