Commit cf89955c by Lee Jaebin

#33433 報告(回答)で、同期後に所属グループを変更すると、プレビュー表示にならない(errorCode : P006対応)

parent f2866eb6
......@@ -564,16 +564,19 @@ public class AcmsClient implements AcmsClientResponseListener {
if (json.errorMessage != null) {
if (json.errorMessage[0].equals("P003")) {
throw new ABVException(ABVExceptionCode.P_E_ACMS_P003);
throw new AcmsException(ABVExceptionCode.P_E_ACMS_P003, json);
} else if (json.errorMessage[0].equals("P004")) {
throw new ABVException(ABVExceptionCode.P_E_ACMS_P004);
throw new AcmsException(ABVExceptionCode.P_E_ACMS_P004, json);
} else if (json.errorMessage[0].equals("P005")) {
throw new ABVException(ABVExceptionCode.P_E_ACMS_P005);
throw new AcmsException(ABVExceptionCode.P_E_ACMS_P005, json);
} else if (json.errorMessage[0].equals("P006")) {
throw new AcmsException(ABVExceptionCode.P_E_ACMS_P006, json);
}
}
if (json.httpStatus != 200) {
throw new AcmsException(ABVExceptionCode.S_E_ACMS_0001, json);
Logger.e("error code : " + json.httpStatus);
throw new AcmsException(ABVExceptionCode.fromResponseCode(result.httpResponseCode), json);
}
return json;
}
......
......@@ -220,7 +220,11 @@ public enum ABVExceptionCode {
/**
* 定期点検、既に点検済みです。点検データ送信できません。
*/
P_E_ACMS_P005;
P_E_ACMS_P005,
/**
* 既に作業報告を行う権限がありません。
*/
P_E_ACMS_P006;
/**
* HTTPレスポンスコードから対応するコードを返す
......
......@@ -1213,11 +1213,15 @@ public class OperationLogic extends AbstractLogic {
removeTaskReportSendIds.add(taskReportSendDto.taskReportSendId);
FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, taskReportSendDto.taskReportSendId));
} catch (ABVException ex) {
} catch (AcmsException ex) {
if (ex.getCode() == ABVExceptionCode.P_E_ACMS_P005) {
mTaskReportSendDao.deleteBySendId(taskReportSendDto.taskReportSendId);
FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, taskReportSendDto.taskReportSendId));
return true;
} else if (ex.getCode() == ABVExceptionCode.P_E_ACMS_P006) {
mTaskReportSendDao.deleteBySendId(taskReportSendDto.taskReportSendId);
FileUtil.delete(ABVEnvironment.getInstance().getOperationTaskReportSendDirFilePath(operationId, taskReportSendDto.taskKey, taskReportSendDto.taskReportSendId));
taskReportDto.dataSendFlg = false;
mTaskReportDao.update(taskReportDto);
}
throw ex;
} catch (Exception ex) {
......
......@@ -363,8 +363,9 @@
<string name="P001">資料名に半角カタカナは使用できません。</string>
<string name="P002">既に資料が登録されています。</string>
<string name="P003">この作業は新規登録・修正・削除出来ません。</string>
<string name="P004">この作業はサーバで閲覧中です。しばらく経ってから再度同期処理を実行してください。</string>
<string name="P004">この作業はサーバで編集中です。しばらく経ってから再度実行してください。</string>
<string name="P005">既に点検済みです。点検データ送信できません。</string>
<string name="P006">既に作業報告を行う権限がありません。</string>
<string name="no_ozd_viewer">ビュアーが存在しません。</string>
<string name="msg_ozd_save_fail">ドキュメント保存に失敗しました。もう一度保存してください</string>
......
......@@ -365,8 +365,9 @@
<string name="P001">자료명에 반각가타가나는 사용할 수 없습니다.</string>
<string name="P002">이미 자료가 등록되어 있습니다.</string>
<string name="P003">이 작업은 신규등록, 수정, 삭제를 할 수 없습니다.</string>
<string name="P004">이 작업은 서버에서 관람중입니다. 약간 시간이 경과한 뒤에 다시 동기를 해 주세요.</string>
<string name="P004">해당 작업은 서버에서 편집 중이므로 잠시 후 다시 실행해 주세요.</string>
<string name="P005">이미 점검이 완료된 상태입니다. 점검 데이터를 송신할 수 없습니다.</string>
<string name="P006">작업 보고 권한이 없습니다.</string>
<string name="no_ozd_viewer">뷰어가 존재하지 않습니다.</string>
<string name="msg_ozd_save_fail">문서저장에 실패했습니다. 다시한번 저장해주세요.</string>
......
......@@ -369,8 +369,9 @@
<string name="P001">Hankaku katakana can not be used for content name.</string>
<string name="P002">Content has already been registered.</string>
<string name="P003">Wokring can not be newly registered, modified, or deleted.</string>
<string name="P004">Wokring is being viewed on the server. Please execute the synchronization process again after a while.</string>
<string name="P004">Task of this working is being edited on the server. Please try again later.</string>
<string name="P005">It is already checked. Check data can not be sent.</string>
<string name="P006">You do not have job reporting permissions.</string>
<string name="no_ozd_viewer">Viewer doesn\'t exist.</string>
<string name="msg_ozd_save_fail">Document save failed. Please save again.</string>
......
......@@ -2,6 +2,7 @@ package jp.agentec.abook.abv.ui.home.activity;
import android.app.DatePickerDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Configuration;
......@@ -68,6 +69,7 @@ import jp.agentec.abook.abv.bl.common.Constant.PushMessageSendType;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.ABVException;
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.exception.NetworkDisconnectedException;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.ABVDataCache;
......@@ -727,8 +729,8 @@ public class OperationListActivity extends ABVUIActivity {
if (mOperationLogic.sendTaskReportSendData(operationId, progressCallback)) {
// 作業報告タイプが定期点検且つ、P005のエラーの場合、以下のエラーをトーストメッセージで表示
handleErrorMessageToast(PatternStringUtil.patternToInt(getApplicationContext(),
R.string.P005,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
R.string.P005,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
}
progressDialogHorizontal.setProgress(60);
......@@ -758,7 +760,7 @@ public class OperationListActivity extends ABVUIActivity {
}
putUserPref(String.format(AppDefType.UserPrefKey.SYNCED_OPERATION_ID, operationId), DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMdd_none));
}
} catch (ABVException e) {
} catch (AcmsException e) {
//noinspection EnumSwitchStatementWhichMissesCases
switch (e.getCode()) {
case P_E_ACMS_P003:
......@@ -772,12 +774,12 @@ public class OperationListActivity extends ABVUIActivity {
R.string.P004,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
break;
case S_E_ACMS_0500:
handleErrorMessageToast(ABVExceptionCode.S_E_ACMS_0500);
case P_E_ACMS_P006:
showSimpleAlertDialog(R.string.app_name, R.string.P006);
break;
default:
Logger.e(TAG, "syncOperation", e);
handleErrorMessageToast(ErrorCode.E107);
handleErrorMessageToast(ErrorMessage.getErrorCode(e));
break;
}
} catch (Exception e) {
......@@ -785,7 +787,7 @@ public class OperationListActivity extends ABVUIActivity {
handler.post(new Runnable() {
@Override
public void run() {
ABVToastUtil.showMakeText(OperationListActivity.this, getResources().getString(ErrorCode.E107.resId), Toast.LENGTH_SHORT);
handleErrorMessageToast(ABVExceptionCode.S_E_ACMS_0001);
closeProgressPopup();
}
});
......
......@@ -25,6 +25,8 @@ 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.ABVException;
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.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.OperationTaskDto;
......@@ -35,6 +37,8 @@ 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.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.constant.ErrorCode;
import jp.agentec.abook.abv.ui.common.constant.ErrorMessage;
import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import jp.agentec.abook.abv.ui.common.util.ABVToastUtil;
import jp.agentec.adf.util.DateTimeFormat;
......@@ -178,40 +182,38 @@ public class ABookCheckWebViewHelper extends ABookHelper {
try {
mOperationLogic.updateSyncOperation(operationId, true);
if (mOperationLogic.sendTaskReportSendData(operationId, taskKey, taskReportLevel, progressCallback)) {
// リソースパターンの適用
context.handleErrorMessageToast(PatternStringUtil.patternToInt(context,
R.string.P005,
getUserPref(context, AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
mOperationLogic.sendTaskReportSendData(operationId, taskKey, taskReportLevel, progressCallback);
} catch (AcmsException ex) {
//noinspection EnumSwitchStatementWhichMissesCases
switch (ex.getCode()) {
case P_E_ACMS_P003:
// リソースパターンを適用
context.showSimpleAlertDialog(R.string.app_name, PatternStringUtil.patternToInt(context,
R.string.P003,
getUserPref(context, AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
break;
case P_E_ACMS_P004:
context.showSimpleAlertDialog(R.string.app_name, PatternStringUtil.patternToInt(context, R.string.P004, getUserPref(context, AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
break;
case P_E_ACMS_P005:
context.showSimpleAlertDialog(PatternStringUtil.patternToInt(context,
R.string.app_name,
getUserPref(context, AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), PatternStringUtil.patternToInt(context,
R.string.P005,
getUserPref(context, AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
break;
case P_E_ACMS_P006:
context.showSimpleAlertDialog(R.string.app_name, R.string.P006);
break;
default:
context.handleErrorMessageToast(ErrorMessage.getErrorCode(ex));
break;
}
} catch (ABVException ex) {
Logger.e(TAG, "sendTaskData", ex);
// if (isDirections) {
// context.showSimpleAlertDialog(R.string.app_name, R.string.msg_send_error_task_directions_data);
// } else {
// リソースパターンの適用
context.showSimpleAlertDialog(PatternStringUtil.patternToInt(context,
R.string.app_name,
getUserPref(context, AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)),
PatternStringUtil.patternToInt(context,
R.string.msg_send_error_task_report_data,
getUserPref(context, AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
// }
isError = true;
} catch (Exception e) {
Logger.e(TAG, e);
// if (isDirections) {
// context.showSimpleAlertDialog(R.string.app_name, R.string.msg_send_error_task_directions_data);
// } else {
// リソースパターンの適用
context.showSimpleAlertDialog(PatternStringUtil.patternToInt(context,
R.string.app_name,
getUserPref(context, AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)),
PatternStringUtil.patternToInt(context,
R.string.msg_send_error_task_report_data,
getUserPref(context, AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
// }
context.handleErrorMessageToast(ABVExceptionCode.S_E_ACMS_0001);
isError = true;
} finally {
mFinishCallback.callback(isError);
......
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