Commit 764e9ad2 by yuichiro ogawa

品質異常初期表示、検品への戻り遷移の実装

parent 3b6745b0
......@@ -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);
......
......@@ -1751,6 +1751,7 @@ 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) {
......
......@@ -276,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);
......@@ -663,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));
......
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