Commit dd7aa92d by Jeong Gilmo

#32861 作業情報追加(Android)

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