Commit ac8c60d0 by Jeong Gilmo

#32861_作業情報追加(Android)

- レビュー対応
parent 93ba0dfc
......@@ -42,10 +42,6 @@ public class ABookKeys {
public static final String CMD_SHOW_RELATED_CONTENT = "showRelatedContent";
public static final String CMD_PAGE_NUM = "pageNum";
// #32861 作業情報追加 start
public static final String CMD_LOCAL_SAVE_TASK_REPORT = "localSaveTaskReport"; // 一時保存
// #32861 作業情報追加 end
public static final String GPS_TYPE = "gpsType";
public static final String STATUS_CODE = "statusCode";
public static final String TASK_KEY = "taskKey";
......@@ -122,7 +118,8 @@ public class ABookKeys {
public static final String OK = "OK";
// #32861 作業情報追加 start
public static final String REPORT_DRAFT = "reportDraft"; // 一時保存情報
public static final String REPORT_DRAFT = "localSave"; // 一時保存情報
public static final String ADD_REPORT = "addReport"; // 作業追加区分
public static final String CMD_LOCAL_SAVE_TASK_REPORT = "localSaveTaskReport"; // 一時保存
// #32861 作業情報追加 end
}
......@@ -105,7 +105,7 @@ public class TaskReportDao extends AbstractDao {
+ "attached_file_name=?, "
+ "local_attached_file_name=?, "
+ "attached_file_send_flg=?, "
+ "data_send_flg=?, "
+ "data_send_flg=? "
// #32782 指示者テーブル関連削除 start
// TODO append
// + "reporter_flag=? "
......
......@@ -133,8 +133,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
// #32861 作業情報追加 start
public int mButtonStatus; // 保存ボタンチェック
protected boolean mLocalSaveTaskReport; // 一時保存情報
protected boolean mInsertTaskReport; // 作業追加区分
protected boolean mLocalSave; // 一時保存情報
protected boolean mAddReport; // 作業追加区分
// #32861 作業情報追加 end
@Override
......@@ -435,6 +435,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
// ホームをリロードさせる
ActivityHandlingHelper.getInstance().setRequireHomeReload(true);
// #32861 作業情報追加 start
// 押したボタンによってHTML側の処理を行う
if (this instanceof CheckOZDViewActivity) {
if (mButtonStatus == R.id.btn_close) {
ozdCancelProcess(); // 閉じる
......@@ -956,18 +957,18 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, true, true, mReportFileName);
} else if (mCmd.equals(ABookKeys.CMD_SHOW_REPORT_OZD)) {
mReportFileName = abookCheckParam.get(ABookKeys.REPORT_FILE_NAME);
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, false, taskReportId, reportStartDate, mReportFileName);
} else if (mCmd.equals(ABookKeys.CMD_PREVIEW_REPORT_OZD)) {
mReportFileName = abookCheckParam.get(ABookKeys.REPORT_FILE_NAME);
// #32861 作業情報追加 start
if (abookCheckParam.containsKey(ABookKeys.REPORT_DRAFT)) {
mLocalSaveTaskReport = Integer.parseInt(abookCheckParam.get(ABookKeys.REPORT_DRAFT)) > 0 ? true : false;
mLocalSave = Integer.parseInt(abookCheckParam.get(ABookKeys.REPORT_DRAFT)) > 0 ? true : false;
}
if (abookCheckParam.containsKey(ABookKeys.ADD_REPORT)) {
mInsertTaskReport = Integer.parseInt(abookCheckParam.get(ABookKeys.ADD_REPORT)) > 0 ? true : false;
mAddReport = Integer.parseInt(abookCheckParam.get(ABookKeys.ADD_REPORT)) > 0 ? true : false;
}
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, false, taskReportId, reportStartDate, mReportFileName, mLocalSaveTaskReport, mInsertTaskReport);
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, false, taskReportId, reportStartDate, mReportFileName, mLocalSave, mAddReport);
// #32861 作業情報追加 end
} else if (mCmd.equals(ABookKeys.CMD_PREVIEW_REPORT_OZD)) {
mReportFileName = abookCheckParam.get(ABookKeys.REPORT_FILE_NAME);
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, true, taskReportId, reportStartDate, mReportFileName, false, false);
} else if (mCmd.equals(ABookKeys.CMD_CONTENT_EDIT_CLOSE)) {
showProgressPopup();
handler.postDelayed(new Runnable() {
......@@ -1091,10 +1092,10 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
// #32861 作業情報追加 start
// 作業追加区分ありの場合
if (mInsertTaskReport) {
webViewLoadUrl("javascript:CHK.cancelOzReport()");
if (mAddReport) {
webViewLoadUrl("javascript:CHK.cancelOzReport()"); // OZD画面日表示するため行う
} else {
ActivityHandlingHelper.getInstance().finishAllContentViewActivity();
goToMain(); // 一覧画面に遷移
}
// #32861 作業情報追加 end
}
......@@ -1202,7 +1203,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
runOnUiThread(new Runnable() {
@Override
public void run () {
// 実行Javascript - 閉じる
// 実行Javascript - 保存
webViewLoadUrl("javascript:CHK.saeOzReport()");
Logger.d(TAG, "ozdSaveProcess");
}
......@@ -1214,7 +1215,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
runOnUiThread(new Runnable() {
@Override
public void run () {
// 実行Javascript - 閉じる
// 実行Javascript - 一時保存
webViewLoadUrl("javascript:CHK.localSaveOzReport()");
Logger.d(TAG, "ozdLocalSaveProcess");
}
......@@ -1232,5 +1233,10 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
});
}
// 作業一覧画面に遷移
public void goToMain() {
ActivityHandlingHelper.getInstance().finishAllContentViewActivity(); // 一覧画面に遷移
}
// #32861 作業情報追加 end
}
......@@ -1543,39 +1543,11 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
* @param taskReportId
* @param reportStartDate
* @param reportFileName
*/
public void startOZViewerActivity(Context context, long operationId, long contentId, String taskKey, boolean isReadOnly, int taskReportId, String reportStartDate, String reportFileName) {
reportStartDate = reportStartDate.replace("T", " ");
String strReportStartDate = DateTimeUtil.toString(DateTimeUtil.toDate(reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen), DateTimeFormat.yyyyMMddHHmm_none);
Intent intent = new Intent();
intent.setClass(context, CheckOZDViewActivity.class);
intent.putExtra(ABookKeys.OPERATION_ID, operationId);
intent.putExtra(ABookKeys.CONTENT_ID, contentId);
intent.putExtra(ABookKeys.TASK_KEY, taskKey);
intent.putExtra(ABookKeys.READ_ONLY_FLG, isReadOnly);
intent.putExtra(ABookKeys.DIRECTION_FLG, false);
intent.putExtra(ABookKeys.TASK_REPORT_ID, taskReportId);
intent.putExtra(ABookKeys.REPORT_START_DATE, strReportStartDate);
intent.putExtra(ABookKeys.REPORT_FILE_NAME, reportFileName);
context.startActivity(intent);
}
// #32861 作業情報追加 start
/**
* OZD, OZRコンテンツを開く(レポートあり)
* @param context
* @param operationId
* @param contentId
* @param taskKey
* @param isReadOnly
* @param taskReportId
* @param reportStartDate
* @param reportFileName
* @param reportDraft
* @param localSave
* @param addReport
*/
public void startOZViewerActivity(Context context, long operationId, long contentId, String taskKey, boolean isReadOnly, int taskReportId, String reportStartDate, String reportFileName, boolean reportDraft, boolean addReport) {
// #32861 作業情報追加 start
public void startOZViewerActivity(Context context, long operationId, long contentId, String taskKey, boolean isReadOnly, int taskReportId, String reportStartDate, String reportFileName, boolean localSave, boolean addReport) {
reportStartDate = reportStartDate.replace("T", " ");
String strReportStartDate = DateTimeUtil.toString(DateTimeUtil.toDate(reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen), DateTimeFormat.yyyyMMddHHmm_none);
......@@ -1589,8 +1561,10 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
intent.putExtra(ABookKeys.TASK_REPORT_ID, taskReportId);
intent.putExtra(ABookKeys.REPORT_START_DATE, strReportStartDate);
intent.putExtra(ABookKeys.REPORT_FILE_NAME, reportFileName);
intent.putExtra(ABookKeys.REPORT_DRAFT, reportDraft); // 一時保存情報
// #32861 作業情報追加 start
intent.putExtra(ABookKeys.REPORT_DRAFT, localSave); // 一時保存情報
intent.putExtra(ABookKeys.ADD_REPORT, addReport); // 作業追加区分
// #32861 作業情報追加 end
context.startActivity(intent);
}
......
......@@ -75,7 +75,7 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
private String mSaveOzdFileName;
// #32861 作業情報追加 start
private boolean mReportDraft; // 一時保存情報
private boolean mLocalSave; // 一時保存情報
private boolean mAadReport; // 作業追加区分
// #32861 作業情報追加 end
......@@ -118,7 +118,7 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
// #32861 作業情報追加 start
// OZ閲覧画面に表示するボタン表示の可否設定
// 一時保存情報についてボタン表示:「0:false、一時保存ボタン非表示」「1:ture、一時保存ボタン表示」
mReportDraft = intent.getBooleanExtra(ABookKeys.REPORT_DRAFT, false);
mLocalSave = intent.getBooleanExtra(ABookKeys.REPORT_DRAFT, false);
// 作業追加区分についてボタンを表示:「0:false、作業追加区分なし、作業一覧へボタン」「1:ture、作業追加区分あり、閉じるボタン」
mAadReport = intent.getBooleanExtra(ABookKeys.ADD_REPORT, false);
......@@ -130,13 +130,13 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
// 一時ボタン表示可否判断
homeButton.setVisibility(mAadReport ? View.GONE : View.VISIBLE);
closeButton.setVisibility(mAadReport ? View.VISIBLE : View.GONE);
tempSaveButton.setVisibility(mReportDraft ? View.VISIBLE : View.GONE);
tempSaveButton.setVisibility(mLocalSave ? View.VISIBLE : View.GONE);
// 作業一覧へ戻るボタン
homeButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mButtonStatus = R.id.btn_operation_home;
goToMain();
goToMain(); // 作業一覧画面に遷移
}
});
......@@ -144,24 +144,25 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
closeButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mButtonStatus = R.id.btn_close;
finishActivity();
mButtonStatus = R.id.btn_close; // HTML側の分岐処理を行うため変数に値を渡す
finishActivity(); // HTML側の処理を行う
}
});
// 一時保存
// 一時保存ボタン
tempSaveButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mButtonStatus = R.id.btn_temp_save;
mButtonStatus = R.id.btn_temp_save; // HTML側の分岐処理を行うため変数に値を渡す
showSaveConfirmAlert(R.string.temp_save, R.string.temp_save_info);
}
});
// 保存ボタン
saveButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mButtonStatus = R.id.btn_save;
mButtonStatus = R.id.btn_save; // HTML側の分岐処理を行うため変数に値を渡す
showSaveConfirmAlert(R.string.save, R.string.save_info);
}
});
......@@ -185,42 +186,6 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
}
}
// #32861 作業情報追加 start
// アラート表示処理
private void showSaveConfirmAlert(final int dialogTitle, int dialogMessage) {
ABookAlertDialog logoutAkert = AlertDialogUtil.createAlertDialog(this, dialogTitle);
logoutAkert.setMessage(dialogMessage);
logoutAkert.setButton(DialogInterface.BUTTON_POSITIVE, getResources().getString(R.string.confirm), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// 一時保存処理
// if (dialogTitle == R.string.temp_save) {
// tempSaved();
// } else if (dialogTitle == R.string.save) {
// tempSaved();
// }
tempSaved();
}
});
logoutAkert.setButton(DialogInterface.BUTTON_NEGATIVE, getResources().getString(R.string.cancel), (DialogInterface.OnClickListener) null);
showAlertDialog(logoutAkert);
}
// #32861 作業情報追加 end
// #32861 作業情報追加 start
// 臨時保存の処理
private void tempSaved() {
if (!mReadOnlyFlg) {
//OZD臨時保存処理
if (!saveTempOzdFile()) {
ABVToastUtil.showMakeText(mContext, R.string.msg_ozd_save_fail, Toast.LENGTH_LONG);
return;
}
}
finishActivity();
}
// #32861 作業情報追加 end
private boolean loadOzdDocument(File file) {
if (mOzReportViewer != null) {
mOzReportViewer.dispose();
......@@ -584,8 +549,30 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
}
// #32861 作業情報追加 start
private void goToMain() {
ActivityHandlingHelper.getInstance().finishAllContentViewActivity(); // 一覧画面に遷移
// アラート表示処理
private void showSaveConfirmAlert(final int dialogTitle, int dialogMessage) {
ABookAlertDialog logoutAkert = AlertDialogUtil.createAlertDialog(this, dialogTitle);
logoutAkert.setMessage(dialogMessage);
logoutAkert.setButton(DialogInterface.BUTTON_POSITIVE, getResources().getString(R.string.confirm), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
tempSaved(); // 一時保存処理
}
});
logoutAkert.setButton(DialogInterface.BUTTON_NEGATIVE, getResources().getString(R.string.cancel), (DialogInterface.OnClickListener) null);
showAlertDialog(logoutAkert);
}
// 臨時保存の処理
private void tempSaved() {
if (!mReadOnlyFlg) {
//OZD臨時保存処理
if (!saveTempOzdFile()) {
ABVToastUtil.showMakeText(mContext, R.string.msg_ozd_save_fail, Toast.LENGTH_LONG);
return;
}
}
finishActivity(); // HTML側の処理を行う
}
// #32861 作業情報追加 end
}
\ No newline at end of file
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