Commit 199c9807 by Lee Jaebin

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

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