Commit dd7aa92d by Jeong Gilmo

#32861 作業情報追加(Android)

- CMSとの連携対応の修正
parent e99ccc62
......@@ -73,6 +73,7 @@ import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper;
import jp.agentec.abook.abv.ui.home.helper.ABookPermissionHelper;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.viewer.activity.CheckOZDViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.HTMLWebViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.HTMLXWalkWebViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.NoPdfViewActivity;
import jp.agentec.abook.abv.ui.viewer.foxitPdf.FoxitPdfCore;
......@@ -135,14 +136,13 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
// #32861 作業情報追加 start
public int mButtonStatus; // 保存ボタンチェック
protected boolean mLocalSave; // 一時保存情報
protected boolean mAddReport; // 作業追加区分
// #32861 作業情報追加 end
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = getIntent();
contentId = intent.getLongExtra(ABookKeys.CONTENT_ID, 0);
contentType = intent.getStringExtra(ABookKeys.CONTENT_TYPE);
......@@ -674,8 +674,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
});
alertDialog.show();
} else {
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId);
finishActivity();
// 作業終了する時、作業ID設定して作業一覧で使用するメソットを行う。
operationFinish();
}
}
});
......@@ -764,8 +764,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
});
alertDialog.show();
} else {
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId);
finishActivity();
// 作業終了する時、作業ID設定して作業一覧で使用するメソットを行う。
operationFinish();
}
}
......@@ -877,7 +877,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_MOVE_HOT_SPOT, ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT,
ABookKeys.CMD_DELETE_TASK_REPORT, ABookKeys.CMD_CANCEL_TASK_REPORT, ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT)) {
boolean isError = false;
try {
if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT)) {
......@@ -924,11 +923,19 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
final boolean isError = (boolean)ret;
closeProgressPopup();
// #32861 作業情報追加 start
// HTML側からのコール(insertTaskReport, updateTaskReport, deleteTaskReport, cancelTaskReport)と
// 作業追加区分(mAddReport)がなしと
// エラーがなしの場合
// 現在画面を閉じる
// その以外の場合コールバック処理のみ行う。
if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT,
ABookKeys.CMD_DELETE_TASK_REPORT, ABookKeys.CMD_CANCEL_TASK_REPORT) && !mAddReport) {
finish();
}else {
ABookKeys.CMD_DELETE_TASK_REPORT, ABookKeys.CMD_CANCEL_TASK_REPORT) && !mAddReport && !isError) {
operationFinish();
} else {
afterABookCheckApi(mCmd, mTaskKey, 0, "", null, isOperationPdf());
if (!isError) { // エラーがない場合のみ画面遷移処理を行う。
doneProcess();
}
}
// #32861 作業情報追加 end
return null;
......@@ -964,6 +971,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} else if (mCmd.equals(ABookKeys.CMD_SHOW_REPORT_OZD)) {
mReportFileName = abookCheckParam.get(ABookKeys.REPORT_FILE_NAME);
// #32926 作業報告画面改善 start
boolean mLocalSave = false; // 一時保存情報
if (abookCheckParam.containsKey(ABookKeys.LOCAL_SAVE)) {
mLocalSave = Integer.parseInt(abookCheckParam.get(ABookKeys.LOCAL_SAVE)) > 0 ? true : false;
}
......@@ -1218,7 +1226,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
// 実行Javascript - 保存
ActivityHandlingHelper.getInstance().callOzdHtmlScript("javascript:CHK.saveOzReport()");
Logger.d(TAG, "ozdSaveProcess");
doneProcess();
}
});
}
......@@ -1255,7 +1262,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
// 実行Javascript - 閉じる
ActivityHandlingHelper.getInstance().callOzdHtmlScript("javascript:CHK.deleteOzReport()");
Logger.d(TAG, "ozdDeleteProcess");
doneProcess();
}
});
}
......@@ -1265,11 +1271,10 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
ActivityHandlingHelper.getInstance().finishAllContentViewActivity(); // 一覧画面に遷移
}
// 押したボタンによってHTML側の処理を行う
public void doProcess() {
// 押したボタンによってHTML側の処理を行う
if (this instanceof CheckOZDViewActivity) {
if (mButtonStatus == R.id.btn_close) {
super.finish();
ozdCancelProcess(); // 閉じる
} else if (mButtonStatus == R.id.btn_temp_save) {
ozdLocalSaveProcess(); // 一時保存
......@@ -1281,17 +1286,23 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
}
// 押したボタンによってHTML側の処理が終わった後の処理を行う
public void doneProcess() {
// 押したボタンによってHTML側の処理が終わった後の処理を行う
if (this instanceof CheckOZDViewActivity) {
if (mButtonStatus == R.id.btn_save || mButtonStatus == R.id.btn_close || mButtonStatus == R.id.btn_delete){
// 作業追加区分ありの場合
if (mAddReport) {
super.finish();
} else {
goToMain(); // 一覧画面に遷移
}
}
// 作業追加区分ありの場合
if (ActivityHandlingHelper.getInstance().searchActivityStack() && mAddReport) {
ActivityHandlingHelper.getInstance().selectedActivityClose(); // 現在画面を閉じる
} else {
operationFinish(); // 現在画面を閉じる
}
}
// 作業終了する時、作業ID設定して作業一覧で使用するメソット
public void operationFinish() {
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId);
if (ActivityHandlingHelper.getInstance().searchActivityStack()) {
goToMain(); // 一覧画面に遷移
} else {
finishActivity(); // 開いてる画面を閉じる
}
}
// #32861 作業情報追加 end
......
......@@ -33,6 +33,7 @@ import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ABVContentViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.CheckOZDViewActivity;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.FileUtil;
......@@ -74,6 +75,13 @@ public class ABookCheckWebViewHelper extends ABookHelper {
int taskReportSendId = 0;
mFinishCallback = finishCallback;
// #32861 start
// ActivityであるClassからCheckOZDViewActivityを確認してContextの値を変更する。
if (ActivityHandlingHelper.getInstance().searchActivityStack()) {
context = (ABVContentViewActivity) ActivityHandlingHelper.getInstance().selectedAtivityContext();
}
// #32861 end
switch (cmd) {
case ABookKeys.CMD_INSERT_TASK_REPORT:
insertOrUpdateTaskReport(taskKey, enableReportHistory, operationId, contentId, param, contentPath, true, reportType, taskReportLevel);
......@@ -163,6 +171,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
public void run() {
OperationDto operationDto = mOperationLogic.getOperation(operationId);
boolean isError = false;
try {
mOperationLogic.updateSyncOperation(operationId, true);
if (mOperationLogic.sendTaskReportSendData(operationId, taskKey, taskReportLevel, progressCallback)) {
......
......@@ -1600,7 +1600,6 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
public void callOzdHtmlScript(String url) {
if (!currentActivityStack.isEmpty()) {
for (final ABVAuthenticatedActivity activity : currentActivityStack) {
final ABVAuthenticatedActivity a = activity;
final String scriptUrl = url;
if (activity instanceof HTMLWebViewActivity) {
((HTMLWebViewActivity) activity).callViewLoadUrl(scriptUrl);
......@@ -1608,5 +1607,42 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
}
}
}
// ActivityであるClassからCheckOZDViewActivityを確認する処理
public boolean searchActivityStack() {
if (!currentActivityStack.isEmpty()) {
for (final ABVAuthenticatedActivity activity : currentActivityStack) {
if (activity instanceof CheckOZDViewActivity) {
return true;
}
}
}
return false;
}
// ActivityであるClassからCheckOZDViewActivityを確認して画面を閉じる処理
public void selectedActivityClose() {
if (!currentActivityStack.isEmpty()) {
for (final ABVAuthenticatedActivity activity : currentActivityStack) {
if (activity instanceof CheckOZDViewActivity) {
((CheckOZDViewActivity) activity).finishActivity();
}
}
}
}
public Context selectedAtivityContext() {
Context context = null;
if (!currentActivityStack.isEmpty()) {
for (final ABVAuthenticatedActivity activity : currentActivityStack) {
if (activity instanceof CheckOZDViewActivity) {
context = ((CheckOZDViewActivity) activity);
return context;
}
}
}
return context;
}
// #32861 end
}
......@@ -77,6 +77,7 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
// #32926 作業報告画面改善 start
private int mTaskReportLevel; // 作業報告レベル
boolean mIsOzFilePath; // 削除処理のフラグ
boolean mLocalSave; // 一時保存フラグ
// #32926 作業報告画面改善 end
@Override
......
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