Commit 3c2688c1 by nakamura akane

Merge branch 'features/1.2.0_ogawa-y' into 'contract/kagome/1.2.1'

Features/1.2.0 ogawa y

See merge request !63
parents 1337fa69 698cb34c
......@@ -36,6 +36,7 @@ public class ABookKeys {
public static final String CMD_PAGE_NUM = "pageNum";
public static final String CMD_LABEL_PRINT = "labelPrint";
public static final String CMD_ABNORMALITY_REPORT = "abnormalityReport";
public static final String CMD_WEBVIEW_FINISH = "webviewFinish";
public static final String GPS_TYPE = "gpsType";
public static final String STATUS_CODE = "statusCode";
......@@ -56,12 +57,14 @@ public class ABookKeys {
// KAGOME対応 ラベル印刷パラメータend
// KAGOME対応Ph2 品質異常報告パラメータstart
public static final String UBNORMALITY_REPORT_OPERATION_ID = "operationId";
public static final String UBNORMALITY_REPORT_CONTENT_ID = "contentId";
public static final String UBNORMALITY_REPORT_LOT_NUMBER_7_FIGURE = "lotNumber7";
public static final String UBNORMALITY_REPORT_ITEM_NO = "itemNo";
public static final String UBNORMALITY_REPORT_FARM_NO = "farmNo";
public static final String UBNORMALITY_REPORT_SHIPPING_SOURCE_NO = "shippingSourceNo";
public static final String UBNORMALITY_REPORT_OPERATION_ID = "operationId"; // 作業ID
public static final String UBNORMALITY_REPORT_CONTENT_ID = "contentId"; // コンテンツID
public static final String UBNORMALITY_REPORT_CHECK_TYPE = "itemCheckTimingType"; // 検品種別
public static final String UBNORMALITY_REPORT_OPERATION_NAME = "operationName"; // 作業名
public static final String UBNORMALITY_REPORT_LOT_NUMBER_7_FIGURE = "lotNo7Figure"; // 7桁ロットNo
public static final String UBNORMALITY_REPORT_ITEM_NO = "itemNo"; // 商品ID
public static final String UBNORMALITY_REPORT_FARM_NO = "farmNo"; // 生産者ID
public static final String UBNORMALITY_REPORT_SHIPPING_SOURCE_NO = "shippingSourceNo"; // 出荷元ID
// KAGOME対応 品質異常報告パラメータend
// #32782 指示者テーブル関連削除 start
......@@ -133,6 +136,7 @@ public class ABookKeys {
public static final String LOCAL_SAVE = "localSave"; // 一時保存情報
public static final String ADD_REPORT = "addReport"; // 作業追加区分
public static final String IS_ABNORMALITY_REPORT = "isAbnormalityReport"; // KAGOME 異常報告遷移フラグ
public static final String CMD_LOCAL_SAVE_TASK_REPORT = "localSaveTaskReport"; // 一時保存
public static final String CMD_CHANGE_TASK_REPORT = "changeTaskReport"; // 報告・報告(回答)切替
// #32926 作業報告画面改善 start
......
......@@ -31,6 +31,7 @@ public class OperationDto extends AbstractDto {
public int enableReportHistory; // 0: 履歴無し, 1: 履歴可
public int enableReportEdit; // 作業編集可能区分
public int enableAddReport; // 作業追加区分
public boolean isAbnormalityReport; // KAGOME Ph2 異常報告への遷移
public List<OperationGroupMasterRelationDto> operationGroupMasterRelationDtoList; // 作業種別に紐づく作業Dto
......
......@@ -879,7 +879,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
public void commonShouldOverrideUrlLoading (Uri uri, OperationTaskDto operationTaskDto) {
Logger.d(TAG, "Uri : %s", uri);
//parent method
Map<String, String> abookCheckParam = new HashMap<String, String>();
final Map<String, String> abookCheckParam = new HashMap<String, String>();
for (String key : uri.getQueryParameterNames()) {
abookCheckParam.put(key, uri.getQueryParameter(key));
}
......@@ -987,8 +987,15 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
if (mAddReport) { // 作業追加ありの場合
// コールバック処理のみ行う。
afterABookCheckApi(mCmd, mTaskKey, 0, "", null, isOperationPdf());
// KAGOME 異常報告への遷移の場合フラグを付与する
if (abookCheckParam.containsKey(ABookKeys.IS_ABNORMALITY_REPORT)) {
JSONObject json = new JSONObject();
json.put(ABookKeys.IS_ABNORMALITY_REPORT, abookCheckParam.get(ABookKeys.IS_ABNORMALITY_REPORT));
afterABookCheckApi(mCmd, mTaskKey, 0, "", json.toString(), isOperationPdf());
} else {
// コールバック処理のみ行う。
afterABookCheckApi(mCmd, mTaskKey, 0, "", null, isOperationPdf());
}
} else {
// 作業追加無しの場合、エラー発生時フォーム画面表示を維持するためにコールバックresult:1でする
if (isError) {
......@@ -1107,6 +1114,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} else if (mCmd.equals(ABookKeys.CMD_ABNORMALITY_REPORT)) { // KAGOME対応Ph2 検品からの品質異常報告
// 品質異常の初期値を設定
Map<String, String> param = getABVUIDataCache().ubnormalityReportParam;
param.put(ABookKeys.UBNORMALITY_REPORT_OPERATION_NAME, abookCheckParam.get(ABookKeys.UBNORMALITY_REPORT_OPERATION_NAME));
param.put(ABookKeys.UBNORMALITY_REPORT_CHECK_TYPE, abookCheckParam.get(ABookKeys.UBNORMALITY_REPORT_CHECK_TYPE));
param.put(ABookKeys.UBNORMALITY_REPORT_LOT_NUMBER_7_FIGURE, abookCheckParam.get(ABookKeys.UBNORMALITY_REPORT_LOT_NUMBER_7_FIGURE));
param.put(ABookKeys.UBNORMALITY_REPORT_ITEM_NO, abookCheckParam.get(ABookKeys.UBNORMALITY_REPORT_ITEM_NO));
param.put(ABookKeys.UBNORMALITY_REPORT_FARM_NO, abookCheckParam.get(ABookKeys.UBNORMALITY_REPORT_FARM_NO));
......@@ -1115,6 +1124,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
// 品質異常へ遷移
ActivityHandlingHelper.getInstance().abnormalityReport(abookCheckParam.get(ABookKeys.UBNORMALITY_REPORT_OPERATION_ID),
abookCheckParam.get(ABookKeys.UBNORMALITY_REPORT_CONTENT_ID));
} else if (mCmd.equals(ABookKeys.CMD_WEBVIEW_FINISH)) { // KAGOME対応Ph2 現在のWebViewを終了
finish();
}
}
......
......@@ -719,7 +719,10 @@ public class OperationListActivity extends ABVUIActivity {
intent.putExtra(ABookKeys.CONTENT_ID, operationDto.contentId);
intent.putExtra(ABookKeys.OPERATION_ID, operationDto.operationId);
intent.putExtra(Constant.ABookCheck.XWALK_OPEN_TYPE, Constant.XWalkOpenType.TASK_REPORT);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
// KAGOME Ph2 異常報告への遷移の場合は遷移元の報告を残すため別インスタンスとしてWebViewを管理する
if (!operationDto.isAbnormalityReport) {
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
}
if(operationDto.operationType == OperationType.PDF) {
intent.putExtra("LINKURL", "file://" + path);
......
......@@ -1740,6 +1740,8 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
/**
* KAGOME Ph2 検品→品質異常報告への遷移
*
* Activityスタックから作業一覧を検索し、WebViewの起動を実行する
*
* @param operationId
* @param contentId
*/
......@@ -1749,23 +1751,14 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
dto.contentId = Long.parseLong(contentId);
dto.operationType = OperationType.LIST;
dto.reportType = Constant.ReportType.Report;
dto.isAbnormalityReport = true;
for (final ABVAuthenticatedActivity activity : currentActivityStack) {
if (activity instanceof OperationListActivity) {
// 報告一覧の表示
((OperationListActivity) activity).startTaskDirectionOrReportView(dto);
// // 報告一覧のWebViewから報告の新規追加処理をキックする
// final ABVAuthenticatedActivity peekActivity = currentActivityStack.peek();
// if (peekActivity instanceof HTMLWebViewActivity) {
// ((HTMLWebViewActivity) peekActivity).addTaskReportFlg = true;
// //((HTMLWebViewActivity) peekActivity).kickAddTaskReport();
// return;
// }
break;
}
}
// // 報告の新規追加が出来なかった場合例外をスロー
// throw new IllegalStateException("transitioning to abnormality report is failed.");
}
}
......@@ -28,6 +28,7 @@ import android.widget.Toast;
import org.json.adf.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON;
......@@ -275,6 +276,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity implements KeyAct
}
isPageFinished = true;
// KAGOME Ph2 WebView表示時のform初期値を設定
Map<String, String> addTaskReportInitParam = getABVUIDataCache().ubnormalityReportParam;
if (addTaskReportInitParam.size() > 0) {
kickAddTaskReport(addTaskReportInitParam);
......@@ -662,9 +664,15 @@ public class HTMLWebViewActivity extends ParentWebViewActivity implements KeyAct
mUploadMessage = null;
}
/**
* 初期値付き報告追加処理
* @param addTaskReportInitParam
*/
public void kickAddTaskReport(Map<String, String> addTaskReportInitParam) {
// キャッシュからパラメータを受け取りjsの関数に引数として渡す
JSONObject json = new JSONObject();
json.put(ABookKeys.UBNORMALITY_REPORT_OPERATION_NAME, addTaskReportInitParam.get(ABookKeys.UBNORMALITY_REPORT_OPERATION_NAME));
json.put(ABookKeys.UBNORMALITY_REPORT_CHECK_TYPE, addTaskReportInitParam.get(ABookKeys.UBNORMALITY_REPORT_CHECK_TYPE));
json.put(ABookKeys.UBNORMALITY_REPORT_LOT_NUMBER_7_FIGURE, addTaskReportInitParam.get(ABookKeys.UBNORMALITY_REPORT_LOT_NUMBER_7_FIGURE));
json.put(ABookKeys.UBNORMALITY_REPORT_ITEM_NO, addTaskReportInitParam.get(ABookKeys.UBNORMALITY_REPORT_ITEM_NO));
json.put(ABookKeys.UBNORMALITY_REPORT_FARM_NO, addTaskReportInitParam.get(ABookKeys.UBNORMALITY_REPORT_FARM_NO));
......@@ -678,6 +686,8 @@ public class HTMLWebViewActivity extends ParentWebViewActivity implements KeyAct
webViewLoadUrl(String.format("javascript:CHK_L.addTaskReportWithInitParam('%s')", param));
}
});
// キャッシュのクリア
getABVUIDataCache().ubnormalityReportParam = new HashMap<>();
}
@Override
......
......@@ -462,11 +462,10 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
if (event.getAction()==KeyEvent.ACTION_DOWN || event.getAction()==KeyEvent.ACTION_UP) {
// KAGOME Ph2 WebView表示時に戻るボタンの誤打で報告が消えることがあるため非活性に変更
if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) {return true;}
if (event.getAction()==KeyEvent.ACTION_UP) {
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_BACK:
// KAGOME Ph2 WebView表示時に戻るボタンの誤打で報告が消えることがあるため非活性に変更
return true;
case KeyEvent.KEYCODE_ENTER:
// KAGOME Ph2 バーコード読み取り時のEnterキー入力イベントをハンドリング
doEnterEvent();
......
......@@ -36,6 +36,7 @@ public class CheckFormWebview extends WebView {
}
// WebView上でIMEキーボードのアクションがあった場合のハンドリングを行う
// NOTE バーコード読取は{@link ParentWebviewActivity#dispatchKeyEvent(KeyEvent event) dispatchKeyEvent}でキャッチする
@Override public boolean performEditorAction(int action) {
if(action == EditorInfo.IME_ACTION_GO || action == EditorInfo.IME_ACTION_NEXT) {
if(enterCallback != null) {
......
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