Commit cf198583 by yuichiro ogawa

#37799 API処理実装(未テスト)

parent d64178ff
package jp.agentec.abook.abv.bl.acms.client; package jp.agentec.abook.abv.bl.acms.client;
import org.json.adf.JSONObject;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
...@@ -39,6 +41,7 @@ import jp.agentec.abook.abv.bl.acms.client.parameters.AcmsContentParameters; ...@@ -39,6 +41,7 @@ import jp.agentec.abook.abv.bl.acms.client.parameters.AcmsContentParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.AcmsParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.AcmsParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.AddMemberGroupParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.AddMemberGroupParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.AppStoreNewLoginParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.AppStoreNewLoginParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.CheckRunningOperationParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.CheckSendLogParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.CheckSendLogParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.ContentReadingLogParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.ContentReadingLogParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.EnqueteReplyParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.EnqueteReplyParameters;
...@@ -1012,4 +1015,17 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -1012,4 +1015,17 @@ public class AcmsClient implements AcmsClientResponseListener {
MasterDataJSON json = new MasterDataJSON(response.httpResponseBody); MasterDataJSON json = new MasterDataJSON(response.httpResponseBody);
return json; return json;
} }
/**
* KAGOME Ph2 稼働時間登録可否チェック
* @param param
* @return
* @throws NetworkDisconnectedException
* @throws AcmsException
*/
public JSONObject checkRunningStatus(CheckRunningOperationParameters param) throws NetworkDisconnectedException, AcmsException {
HttpResponse response = send(AcmsApis.ApiGetOperationData, param);
JSONObject json = new JSONObject(response.httpResponseBody);
return json;
}
} }
package jp.agentec.abook.abv.bl.acms.client.parameters;
/**
* Created by ogawa-y on 2020/04/07.
*/
public class CheckRunningOperationParameters extends AcmsParameters {
private String operationNo;
private String runningStatus;
private String time;
private String employeeCodeListStr;
public CheckRunningOperationParameters(String sid, String operationNo, String runningStatus, String time, String employeeCodeListStr) {
super(sid);
this.operationNo = operationNo;
this.runningStatus = runningStatus;
this.time = time;
this.employeeCodeListStr = employeeCodeListStr;
}
public String getOperationNo() {
return operationNo;
}
public String getRunningStatus() {
return runningStatus;
}
public String getTime() {
return time;
}
public String getEmployeeCodeListStr() {
return employeeCodeListStr;
}
}
\ No newline at end of file
...@@ -159,6 +159,8 @@ public class AcmsApis { ...@@ -159,6 +159,8 @@ public class AcmsApis {
public static final String ApiOperationGroupMaster = "operationGroupMaster"; public static final String ApiOperationGroupMaster = "operationGroupMaster";
// 絞り検索マスタデータ取得 // 絞り検索マスタデータ取得
public static final String ApiGetApertureMasterData = "getApertureMasterData"; public static final String ApiGetApertureMasterData = "getApertureMasterData";
// KAGOME Ph2 稼働時間登録可否チェック
public static final String ApiCheckRunningOperation = "checkRunningOperation";
// download // download
/** /**
...@@ -203,7 +205,8 @@ public class AcmsApis { ...@@ -203,7 +205,8 @@ public class AcmsApis {
} else if (methodName.equals(ApiOperationList) || methodName.equals(ApiWorkingGroupList) || methodName.equals(ApiSendTaskData) || methodName.equals(ApiGetOperationData) || } else if (methodName.equals(ApiOperationList) || methodName.equals(ApiWorkingGroupList) || methodName.equals(ApiSendTaskData) || methodName.equals(ApiGetOperationData) ||
methodName.equals(ApiGetTaskFile) || methodName.equals(ApiSceneEntry) || methodName.equals(ApiTaskContentEntry) || methodName.equals(ApiGetTaskFile) || methodName.equals(ApiSceneEntry) || methodName.equals(ApiTaskContentEntry) ||
methodName.equals(ApiSendPushMessage) || methodName.equals(ApiGetPushMessages) || methodName.equals(ApiSendRoutineTaskData) || methodName.equals(ApiSendPushMessage) || methodName.equals(ApiGetPushMessages) || methodName.equals(ApiSendRoutineTaskData) ||
methodName.equals(ApiOperationGroupMaster) || methodName.equals(ApiGetApertureMasterData) || methodName.equals(ApiGetMasterData)) { methodName.equals(ApiOperationGroupMaster) || methodName.equals(ApiGetApertureMasterData) || methodName.equals(ApiGetMasterData) ||
methodName.equals(ApiCheckRunningOperation)) {
apiValue = Constant.ApiValue.checkapi; apiValue = Constant.ApiValue.checkapi;
} }
......
...@@ -37,6 +37,7 @@ public class ABookKeys { ...@@ -37,6 +37,7 @@ public class ABookKeys {
public static final String CMD_LABEL_PRINT = "labelPrint"; public static final String CMD_LABEL_PRINT = "labelPrint";
public static final String CMD_ABNORMALITY_REPORT = "abnormalityReport"; public static final String CMD_ABNORMALITY_REPORT = "abnormalityReport";
public static final String CMD_WEBVIEW_FINISH = "webviewFinish"; public static final String CMD_WEBVIEW_FINISH = "webviewFinish";
public static final String CMD_CHECK_RUNNING_OPERATION = "checkRunningOperation";
public static final String GPS_TYPE = "gpsType"; public static final String GPS_TYPE = "gpsType";
public static final String STATUS_CODE = "statusCode"; public static final String STATUS_CODE = "statusCode";
...@@ -67,6 +68,13 @@ public class ABookKeys { ...@@ -67,6 +68,13 @@ public class ABookKeys {
public static final String UBNORMALITY_REPORT_SHIPPING_SOURCE_NO = "shippingSourceNo"; // 出荷元ID public static final String UBNORMALITY_REPORT_SHIPPING_SOURCE_NO = "shippingSourceNo"; // 出荷元ID
// KAGOME対応 品質異常報告パラメータend // KAGOME対応 品質異常報告パラメータend
// KAGOME対応Ph2 品質異常報告パラメータstart
public static final String RUNNING_INFO_OPERATION_NO = "operationNo";
public static final String RUNNING_INFO_RUNNING_STATUS = "runningStatus";
public static final String RUNNING_INFO_TIME = "time";
public static final String RUNNING_INFO_EMPLOYEE_CODE_LIST = "employeeCodeList";
// KAGOME対応Ph2 品質異常報告パラメータend
// #32782 指示者テーブル関連削除 start // #32782 指示者テーブル関連削除 start
// TODO change TASK_DIRECTIONS 削除が必要 // TODO change TASK_DIRECTIONS 削除が必要
// public static final String TASK_DIRECTIONS = "taskReport"; // public static final String TASK_DIRECTIONS = "taskReport";
......
...@@ -1417,4 +1417,7 @@ ...@@ -1417,4 +1417,7 @@
<string name="msg_confirm_close_edit_page">編集を終了しますか?\n(保存されていない変更は破棄されます。)</string> <string name="msg_confirm_close_edit_page">編集を終了しますか?\n(保存されていない変更は破棄されます。)</string>
<string name="msg_error_edit_page_save">ファイルの保存中に予想以外のエラーが発生しました。\n編集画面を終了します。</string> <string name="msg_error_edit_page_save">ファイルの保存中に予想以外のエラーが発生しました。\n編集画面を終了します。</string>
<string name="msg_error_edit_page_open">編集画面の表示に失敗しました。</string> <string name="msg_error_edit_page_open">編集画面の表示に失敗しました。</string>
<!--稼働時間登録可否チェック-->
<string name="msg_error_check_running_info">稼働時間情報のチェックに失敗しました。</string>
</resources> </resources>
...@@ -46,12 +46,17 @@ import java.util.List; ...@@ -46,12 +46,17 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
import jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON;
import jp.agentec.abook.abv.bl.acms.client.parameters.CheckRunningOperationParameters;
import jp.agentec.abook.abv.bl.acms.type.OperationType; import jp.agentec.abook.abv.bl.acms.type.OperationType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment; import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.Callback; import jp.agentec.abook.abv.bl.common.Callback;
import jp.agentec.abook.abv.bl.common.CommonExecutor; import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant; import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys; import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
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.common.log.Logger;
import jp.agentec.abook.abv.bl.data.ABVDataCache; import jp.agentec.abook.abv.bl.data.ABVDataCache;
import jp.agentec.abook.abv.bl.data.DatabaseExporter; import jp.agentec.abook.abv.bl.data.DatabaseExporter;
...@@ -93,6 +98,11 @@ import jp.agentec.adf.util.DateTimeUtil; ...@@ -93,6 +98,11 @@ import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.FileUtil; import jp.agentec.adf.util.FileUtil;
import jp.agentec.adf.util.StringUtil; import jp.agentec.adf.util.StringUtil;
import static jp.agentec.abook.abv.bl.common.constant.ABookKeys.RUNNING_INFO_EMPLOYEE_CODE_LIST;
import static jp.agentec.abook.abv.bl.common.constant.ABookKeys.RUNNING_INFO_OPERATION_NO;
import static jp.agentec.abook.abv.bl.common.constant.ABookKeys.RUNNING_INFO_RUNNING_STATUS;
import static jp.agentec.abook.abv.bl.common.constant.ABookKeys.RUNNING_INFO_TIME;
public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
private static final String TAG ="ABVContentViewActivity"; private static final String TAG ="ABVContentViewActivity";
...@@ -1126,6 +1136,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1126,6 +1136,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
abookCheckParam.get(ABookKeys.UBNORMALITY_REPORT_CONTENT_ID)); abookCheckParam.get(ABookKeys.UBNORMALITY_REPORT_CONTENT_ID));
} else if (mCmd.equals(ABookKeys.CMD_WEBVIEW_FINISH)) { // KAGOME対応Ph2 現在のWebViewを終了 } else if (mCmd.equals(ABookKeys.CMD_WEBVIEW_FINISH)) { // KAGOME対応Ph2 現在のWebViewを終了
finish(); finish();
} else if (mCmd.equals(ABookKeys.CMD_CHECK_RUNNING_OPERATION)) { // KAGOME Ph2 稼働時間登録可否チェック
checkRunningOperation(abookCheckParam);
} }
} }
...@@ -1371,6 +1383,34 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1371,6 +1383,34 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}); });
} }
/**
* KAGOME Ph2 稼働時間登録可否チェック
* @param abookCheckParam
*/
private void checkRunningOperation(Map<String, String> abookCheckParam) {
CheckRunningOperationParameters param = new CheckRunningOperationParameters(ABVDataCache.getInstance().getMemberInfo().sid,
abookCheckParam.get(RUNNING_INFO_OPERATION_NO),
abookCheckParam.get(RUNNING_INFO_RUNNING_STATUS),
abookCheckParam.get(RUNNING_INFO_TIME),
abookCheckParam.get(RUNNING_INFO_EMPLOYEE_CODE_LIST));
try {
JSONObject json = AcmsClient.getInstance(ABVDataCache.getInstance().getUrlPath(), ABVEnvironment.getInstance().networkAdapter).checkRunningStatus(param);
Logger.w(TAG,"check running info complete");
afterABookCheckApi(mCmd, "", 0, "", json.getString("errMsgList"));
} catch (NetworkDisconnectedException e) {
Logger.w(TAG,e);
afterABookCheckApi(mCmd, "", 1, PatternStringUtil.patternToString(getApplicationContext(),
R.string.msg_network_offline,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), null);
} catch (AcmsException e) {
Logger.w(TAG,e);
afterABookCheckApi(mCmd, "", 1, PatternStringUtil.patternToString(getApplicationContext(),
R.string.msg_error_check_running_info,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), null);
}
}
protected boolean isOperationPdf() { protected boolean isOperationPdf() {
return isOperationPdf; return isOperationPdf;
} }
......
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