Commit c9b298e1 by Lee Jaebin

#34190 作業種別毎に作業を絞り込み機能追加

parent 0e644a17
......@@ -636,6 +636,11 @@ public class AcmsClient implements AcmsClientResponseListener {
HttpResponse result = HttpRequestSender.post(apiUrl, new HttpMultipart[]{part1, part2, part3});
SceneEntryJSON json = new SceneEntryJSON(result.httpResponseBody);
if (json.httpStatus != 200) {
if (json.errorMessage != null) {
if (json.errorMessage[0].equals("P007")) {
throw new AcmsException(ABVExceptionCode.P_E_ACMS_P007, json);
}
}
throw new AcmsException(ABVExceptionCode.fromResponseCode(result.httpResponseCode), new AcmsMessageJSON(result.httpResponseBody));
}
......
......@@ -10,7 +10,7 @@ import jp.agentec.abook.abv.bl.common.exception.JSONValidationException;
* Created by leej on 2018/10/26.
*/
public class SceneEntryJSON extends AcmsCommonJSON {
public class SceneEntryJSON extends AcmsMessageJSON {
private static final String ResourceId = "resourceId";
public Integer resourceId;
......
......@@ -224,7 +224,11 @@ public enum ABVExceptionCode {
/**
* 既に作業報告を行う権限がありません。
*/
P_E_ACMS_P006;
P_E_ACMS_P006,
/**
* ロック中である場合
*/
P_E_ACMS_P007;
/**
* HTTPレスポンスコードから対応するコードを返す
......
......@@ -3,7 +3,7 @@
<item
android:state_checked="true"
android:state_pressed="true"
android:drawable="@drawable/operation_location_segment_off" />
android:drawable="@drawable/operation_location_segment_on" />
<item
android:state_checked="true"
android:drawable="@drawable/operation_location_segment_on" />
......
......@@ -540,19 +540,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
if (mOperationId != null && mOperationId > -1) {
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId);
}
if (isLinkedContent) {
goToBack();
} else {
finishActivity();
}
} else {
return super.onKeyUp(keyCode, event);
}
return false;
return super.onKeyUp(keyCode, event);
}
@Override
......@@ -561,20 +549,6 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
}
@Override
protected void finishActivity() {
setResult(RESULT_OK, new Intent());
finish();
if (objectId == -1) { // HTMLコンテンツの場合で、KeyUpではない場合、全コンテンツActivityを終了
if (isLinkedContent) {
ActivityHandlingHelper.getInstance().finishAllLinkContentViewActivity();
} else {
ActivityHandlingHelper.getInstance().finishAllContentViewActivity();
}
}
}
@Override
public void onResume() {
Logger.i(TAG, "onResume");
super.onResume();
......
......@@ -579,35 +579,13 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity {
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
if (mOperationId != null && mOperationId > -1) {
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId);
}
if (isLinkedContent) {
goToBack();
} else {
finishActivity();
}
} else {
return super.onKeyUp(keyCode, event);
}
return false;
return super.onKeyUp(keyCode, event);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
return super.onKeyDown(keyCode, event);
}
@Override
protected void finishActivity() {
setResult(RESULT_OK, new Intent());
finish();
if (isLinkedContent) {
ActivityHandlingHelper.getInstance().finishAllLinkContentViewActivity();
} else {
ActivityHandlingHelper.getInstance().finishAllContentViewActivity();
}
}
@Override
public void onResume() {
......@@ -622,13 +600,13 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity {
protected void onStop() {
super.onStop();
webView.stopLoading();
if (objectLogId != -1) {
ContentLogUtil.getInstance().endObjectLog(getContentId(), objectLogId);
} else {
if (objectLogId == -1) {
if (lastPageStartDate != null) { // 360の場合
ContentLogUtil.getInstance().endContentPageReadLog(contentId, lastPageNo, readingLogId);
AbstractLogic.getLogic(ContentReadingLogLogic.class).endContentReadLog(contentId);
}
} else {
ContentLogUtil.getInstance().endObjectLog(getContentId(), objectLogId);
}
}
......
......@@ -3,7 +3,9 @@ package jp.agentec.abook.abv.ui.viewer.activity;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
......@@ -22,6 +24,8 @@ import jp.agentec.abook.abv.bl.common.Callback;
import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.ContentDao;
......@@ -240,6 +244,37 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
}
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
if (mXWalkOpenType != Constant.XWalkOpenType.PANO_EDIT && mOperationId != null && mOperationId > -1) {
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId);
}
if (isLinkedContent) {
goToBack();
} else {
finishActivity();
}
} else {
return super.onKeyUp(keyCode, event);
}
return false;
}
@Override
protected void finishActivity() {
setResult(RESULT_OK, new Intent());
finish();
if (objectId == -1) { // HTMLコンテンツの場合で、KeyUpではない場合、全コンテンツActivityを終了
if (isLinkedContent) {
ActivityHandlingHelper.getInstance().finishAllLinkContentViewActivity();
} else {
ActivityHandlingHelper.getInstance().finishAllContentViewActivity();
}
}
}
@Override
protected void onDestroy() {
Logger.d(TAG, "onDestroy");
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
......@@ -304,7 +339,7 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
} else if (progress <= 80 && progress >= 60) {
progressDialogHorizontal.setProgress(progress + 2);
handler.postDelayed(this, 1000);
} else if (progress < 60) {
} else if (progress < 60) {
progressDialogHorizontal.setProgress(progress + 4);
handler.postDelayed(this, 1000);
}
......@@ -319,10 +354,10 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
}
});
}
} catch (Exception e) {
Logger.e(TAG, e);
// ロック中である場合以下のエラーメッセージで判定
if (e.getMessage().equals("P007")) {
} catch (AcmsException ex) {
Logger.e(TAG, ex);
if (ex.getCode() == ABVExceptionCode.P_E_ACMS_P007) {
// シーン追加時、ロック状態である場合
runOnUiThread(new Runnable() {
@Override
public void run() {
......@@ -339,6 +374,15 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
}
});
}
} catch (Exception e) {
Logger.e(TAG, e);
handler.post(new Runnable() {
@Override
public void run() {
closeProgressPopup();
showFailedSceneApiDialog();
}
});
} finally {
//アプリ内のファイルのみ削除(Galleryファイルは削除しない)
if (mLocalFile != null && mLocalFile.getPath().contains(getPackageName())) {
......
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