Commit 05668f53 by Lee Jaebin

#32824 作業一覧画面改善

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