Commit 0e430e46 by yuichiro ogawa

検品から品質異常報告への遷移を追加

parent 33097dae
......@@ -35,6 +35,7 @@ public class ABookKeys {
public static final String CMD_SHOW_RELATED_CONTENT = "showRelatedContent";
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 GPS_TYPE = "gpsType";
public static final String STATUS_CODE = "statusCode";
......@@ -54,6 +55,15 @@ public class ABookKeys {
public static final String LABEL_LOT_NUMBER_QR = "lotNumberQR";
// 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";
// KAGOME対応 品質異常報告パラメータend
// #32782 指示者テーブル関連削除 start
// TODO change TASK_DIRECTIONS 削除が必要
// public static final String TASK_DIRECTIONS = "taskReport";
......
......@@ -14,7 +14,10 @@ import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.StringUtil;
import android.content.Context;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Stack;
public class ABVUIDataCache {
......@@ -44,6 +47,9 @@ public class ABVUIDataCache {
//コンテンツビューからコンテンツビューへ戻る時のコンテンツ情報リスト
public List<long[]> returnContentIdList = new ArrayList<>();
// KAGOME Ph2 検品→品質異常報告遷移時の引継ぎパラメータ
public Map<String, String> ubnormalityReportParam = new HashMap<>();
/**
* 最上部に表示されているActivityのクラス名、つまりユーザに見えているActivityのクラス名です。<br>
* Activityにfocusがあるかどうかをもとにアプリがバックグラウンドになったかを判断します。
......
......@@ -14,7 +14,6 @@ import android.util.Xml;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.OrientationEventListener;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
......@@ -41,7 +40,6 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
......@@ -1106,8 +1104,17 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
abookCheckParam.get(ABookKeys.LABEL_LOT_NUMBER),
abookCheckParam.get(ABookKeys.LABEL_OPERATION_NO),
abookCheckParam.get(ABookKeys.LABEL_LOT_NUMBER_QR));
} else if (mCmd.equals(ABookKeys.CMD_ABNORMALITY_REPORT)) { // KAGOME対応Ph2 検品からの品質異常報告
// 品質異常の初期値を設定
Map<String, String> param = getABVUIDataCache().ubnormalityReportParam;
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));
param.put(ABookKeys.UBNORMALITY_REPORT_SHIPPING_SOURCE_NO, abookCheckParam.get(ABookKeys.UBNORMALITY_REPORT_SHIPPING_SOURCE_NO));
// 品質異常へ遷移
ActivityHandlingHelper.getInstance().abnormalityReport(abookCheckParam.get(ABookKeys.UBNORMALITY_REPORT_OPERATION_ID),
abookCheckParam.get(ABookKeys.UBNORMALITY_REPORT_CONTENT_ID));
}
}
......
......@@ -31,7 +31,9 @@ import jp.agentec.abook.abv.bl.acms.client.json.DownloadedContentInfoJSON;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON;
import jp.agentec.abook.abv.bl.acms.type.DeliveryType;
import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType;
import jp.agentec.abook.abv.bl.acms.type.OperationType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
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.AcmsException;
import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
......@@ -48,6 +50,7 @@ import jp.agentec.abook.abv.bl.download.ContentRefresher;
import jp.agentec.abook.abv.bl.download.ContentZipDownloadNotification;
import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.MeetingDto;
import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.ContentLogic;
import jp.agentec.abook.abv.bl.logic.ContentReadingLogLogic;
......@@ -94,6 +97,8 @@ import jp.agentec.adf.util.FileUtil;
import jp.agentec.adf.util.RuntimeUtil;
import jp.agentec.adf.util.StringUtil;
import static org.chromium.base.ThreadUtils.runOnUiThread;
// TODO: synchronizedメソッドは、currentActivityStackによるブロックに変更
// TODO: リファクタリング ActivityStackとActivity起動とMeeting関係をクラス分離
public class ActivityHandlingHelper extends ABookHelper implements RemoteObserver, ContentDownloadListener {
......@@ -1713,7 +1718,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
}
}
}
return context;
return null;
}
/**
......@@ -1731,4 +1736,36 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
public void setPreviousOfSettingActivity(ABVUIActivity activity) {
this.previousOfSettingActivity = activity;
}
/**
* KAGOME Ph2 検品→品質異常報告への遷移
*
* @param operationId
* @param contentId
*/
public void abnormalityReport(String operationId, String contentId) {
OperationDto dto = new OperationDto();
dto.operationId = Long.parseLong(operationId);
dto.contentId = Long.parseLong(contentId);
dto.operationType = OperationType.LIST;
dto.reportType = Constant.ReportType.Report;
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;
// }
}
}
// // 報告の新規追加が出来なかった場合例外をスロー
// throw new IllegalStateException("transitioning to abnormality report is failed.");
}
}
......@@ -32,6 +32,7 @@ import org.apache.http.impl.client.DefaultHttpClient;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.Map;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON;
import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType;
......@@ -97,7 +98,6 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
final String url = intent.getStringExtra("LINKURL"); // LinkURL
mOperationId = intent.getLongExtra(ABookKeys.OPERATION_ID, -1); // OperationId
// ***** WebViewセット
webView = (WebView) findViewById(R.id.webView2);
......@@ -282,6 +282,11 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
btnWebForward.setEnabled(false);
}
isPageFinished = true;
Map<String, String> addTaskReportInitParam = getABVUIDataCache().ubnormalityReportParam;
if (addTaskReportInitParam.size() > 0) {
kickAddTaskReport(addTaskReportInitParam);
}
}
@Override
......@@ -664,4 +669,16 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
}
mUploadMessage = null;
}
public void kickAddTaskReport(Map<String, String> addTaskReportInitParam) {
// TODO キャッシュからパラメータを受け取ってjsの関数に引数として渡す
runOnUiThread(new Runnable() {
@Override
public void run() {
if (webView != null) {
webView.loadUrl("javascript:CHK_L.addTaskReport()");
}
}
});
}
}
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