Commit 199c9807 by Lee Jaebin

コマンド実行後、コールバック処理修正

parent 070d7026
......@@ -109,6 +109,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
public Long mOperationId;
protected int mXWalkOpenType = -1;
protected int mOperationType;
private int mReportType;
protected int mEnableReportHistory; //0:履歴無し 1:履歴可
// 報告可能区分
protected int mEnableReportEdit; //0:報告無し 1:報告可
......@@ -158,6 +159,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
mOperationType = operationDto.operationType;
mReportType = operationDto.reportType;
if (mOperationType != OperationType.PDF && isNormalSize()) {
// 縦画面固定
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
......@@ -953,7 +955,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
// 画面遷移処理(一時保存以外)
if (!mCmd.equals(ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT)) {
closeCurrentScreen(mOperationType);
closeCurrentScreen(mReportType);
}
}
} else {
......@@ -966,9 +968,15 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
if (mAddReport) { // 作業追加ありの場合
// コールバック処理のみ行う。
afterABookCheckApi(mCmd, mTaskKey, 0, "", null, isOperationPdf());
} else {
// 作業追加無しの場合、エラー発生時フォーム画面表示を維持するためにコールバックresult:1でする
if (isError) {
afterABookCheckApi(mCmd, mTaskKey, 1, "", null, isOperationPdf());
return null;
}
}
// 画面遷移処理
closeCurrentScreen(mOperationType);
closeCurrentScreen(mReportType);
}
return null;
}
......@@ -1113,11 +1121,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
public void afterABookCheckApi(final String cmd, final String taskKey, final int result, final String message, final String extParam, final boolean isParent) {
Logger.v(TAG, "run javaScript for ABookCheck : cmd=%s, taskKey=%s, result=%s, message=%s", cmd, taskKey, result, message);
String scriptParent = "";
if (isParent) {
scriptParent = "window.parent.";
}
final String finalParent = scriptParent;
final String finalParent = isParent ? "window.parent." : "";
runOnUiThread(new Runnable() {
@Override
public void run() {
......@@ -1289,25 +1293,19 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
// 作業終了する時、作業ID設定し、画面遷移処理
public void closeCurrentScreen(int operationType) {
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId); // 作業IDの設定
public void closeCurrentScreen(int reportType) {
if (mAddReport) { // 作業追加あり
if (ActivityHandlingHelper.getInstance().searchOzdActivityStack()) { // OZD画面で画面遷移処理
ActivityHandlingHelper.getInstance().selectedOzdActivityClose(); // 開いてる画面を閉じる
}
} else { // 作業追加なし
if (operationType == Constant.ReportType.Report) { // 報告タイプ
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId); // 作業IDの設定
if (ActivityHandlingHelper.getInstance().searchOzdActivityStack()) { // OZD画面で画面遷移処理
goToMain(); // 一覧画面に遷移
} else {
finishActivity(); // 一覧画面に遷移
}
} else { // 報告タイプ以外
if (ActivityHandlingHelper.getInstance().searchOzdActivityStack()) { // OZD画面で画面遷移処理
ActivityHandlingHelper.getInstance().selectedOzdActivityClose(); // 開いてる画面を閉じる
}
}
}
}
}
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