Commit 2bf12615 by Lee Jaebin

enableAddReport項目追加して、ヘルプボタンの表示・非表示処理追加

parent 199c9807
......@@ -54,6 +54,8 @@ public class OperationListJSON extends AcmsCommonJSON {
public static final String PushMessage = "pushMessage";
public static final String EnableAddReport = "enableAddReport";
public List<OperationDto> operationList;
public OperationListJSON(String jsonString) throws AcmsException {
......@@ -80,6 +82,7 @@ public class OperationListJSON extends AcmsCommonJSON {
dto.reportType = operationJson.getInt(ReportType); // 作業報告タイプ
dto.enableReportHistory = operationJson.getInt(EnableReportHistory); // 報告履歴管理
dto.enableReportEdit = operationJson.has(EnableReportEdit) ? operationJson.getInt(EnableReportEdit) : 0; // 作業編集区分
dto.enableAddReport = operationJson.has(EnableAddReport) ? operationJson.getInt(EnableAddReport) : 0; // 作業追加区分
// 作業終了更新日
if (operationJson.has(OperationLastEditDate)) {
......
......@@ -152,7 +152,13 @@ public class Constant {
}
// 作業可能区分
public interface EnableReport {
public interface EnableEditReport {
int NO = 0;
int YES = 1;
}
// 作業追加区分
public interface EnableAddReport {
int NO = 0;
int YES = 1;
}
......
......@@ -105,6 +105,11 @@ public class OperationDao extends AbstractDao {
dto.reportType = cursor.getInt(column);
}
column = cursor.getColumnIndex("enable_add_report");
if (column != -1) {
dto.enableAddReport = cursor.getInt(column);
}
return dto;
}
......@@ -174,9 +179,10 @@ public class OperationDao extends AbstractDao {
+ "report_cycle, "
+ "enable_report_update, "
+ "enable_report_history, "
+ "enable_report_edit) "
+ "enable_report_edit,"
+ "enable_add_report) "
+ "values "
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
dto.getInsertValues());
}
......@@ -196,7 +202,8 @@ public class OperationDao extends AbstractDao {
+ "report_cycle=?, "
+ "enable_report_update=?, "
+ "enable_report_history=?, "
+ "enable_report_edit=? "
+ "enable_report_edit=?, "
+ "enable_add_report=? "
+ "where operation_id=?",
dto.getUpdateValues());
return count > 0;
......@@ -244,6 +251,7 @@ public class OperationDao extends AbstractDao {
sql.append(" top.report_cycle, ");
sql.append(" top.enable_report_update, ");
sql.append(" top.enable_report_edit, ");
sql.append(" top.enable_add_report, ");
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')) ");
......
......@@ -37,6 +37,7 @@ public class TOperation extends SQLiteTableScript {
sql.append(" , enable_report_update INTEGER NOT NULL DEFAULT 0 ");
sql.append(" , enable_report_history SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , enable_report_edit SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , enable_add_report SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , PRIMARY KEY (operation_id) ");
sql.append(" ) ");
ddl.add(sql.toString());
......
......@@ -30,6 +30,7 @@ public class OperationDto extends AbstractDto {
public int reportCount; //定期点検、作業数
public int enableReportHistory; // 0: 履歴無し, 1: 履歴可
public int enableReportEdit; // 作業編集可能区分
public int enableAddReport; // 作業追加区分
// 作業担当グループリスト
public List<TaskWorkerGroupDto> taskWorkerGroupDtoList;
......@@ -45,12 +46,12 @@ public class OperationDto extends AbstractDto {
@Override
public Object[] getInsertValues() {
return new Object[] { operationId, operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit };
return new Object[] { operationId, operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport };
}
@Override
public Object[] getUpdateValues() {
return new Object[] { operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, operationId };
return new Object[] { operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport, operationId };
}
@Override
......
......@@ -338,10 +338,10 @@ 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, localSavedFlg ? false : true, localSavedFlg);
mOperationLogic.updateTaskReport(taskReportDto.taskKey, operationId, contentId, taskReportLevel, Constant.EnableEditReport.YES, taskReportJson, null, attachedChangeFlag, localSavedFlg ? false : true, localSavedFlg);
} else {
// 登録
mOperationLogic.insertTaskReport(taskKey, operationId, contentId, taskReportLevel, Constant.EnableReport.YES, taskReportJson, null, attachedChangeFlag, localSavedFlg ? false : true, localSavedFlg);
mOperationLogic.insertTaskReport(taskKey, operationId, contentId, taskReportLevel, Constant.EnableEditReport.YES, taskReportJson, null, attachedChangeFlag, localSavedFlg ? false : true, localSavedFlg);
}
mOperationLogic.createJsonForOperationContent(operationId, contentPath, false);
copyTaskAttachedMovie(operationId, contentId, taskKey, taskReportLevel);
......
......@@ -189,7 +189,12 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
addSceneButton.setVisibility(View.GONE);
taskListButton.setVisibility(View.GONE);
} else {
if (mOperationType == OperationType.LIST && operationDto.enableAddReport == Constant.EnableAddReport.NO) {
// リストタイプ且つ、作業追加区分が無しの場合、ヘルプボタンを非表示
helpButton.setVisibility(View.INVISIBLE);
} else {
helpButton.setVisibility(View.VISIBLE);
}
operationHomeButton.setVisibility(View.VISIBLE);
btnWebBack.setVisibility(View.GONE);
......
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