|
|
@@ -17,12 +17,14 @@ import android.widget.TextView;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.common.LogUtil;
|
|
|
+import com.common.data.StringUtil;
|
|
|
import com.core.app.Constants;
|
|
|
import com.core.base.BaseActivity;
|
|
|
import com.core.net.http.ViewUtil;
|
|
|
import com.core.utils.CommonUtil;
|
|
|
import com.core.widget.DrawableCenterTextView;
|
|
|
import com.core.widget.EmptyLayout;
|
|
|
+import com.core.widget.view.Activity.CommonWebviewActivity;
|
|
|
import com.core.widget.view.MyGridView;
|
|
|
import com.handmark.pulltorefresh.library.PullToRefreshBase;
|
|
|
import com.handmark.pulltorefresh.library.PullToRefreshListView;
|
|
|
@@ -48,6 +50,7 @@ import java.util.Map;
|
|
|
*/
|
|
|
public class ReportStatisticsActivity extends BaseActivity {
|
|
|
private final int GET_MENU_DATA = 0x16;
|
|
|
+ public static final int GET_CLICK_URL=0x17;
|
|
|
private PullToRefreshListView mMenuListView;
|
|
|
private List<GridMenuReportStatisticsBean> mGridMenuReportStatisticsBeans;
|
|
|
private ReportStatisticsMenuListAdapter mReportStatisticsMenuListAdapter;
|
|
|
@@ -143,6 +146,7 @@ public class ReportStatisticsActivity extends BaseActivity {
|
|
|
@Override
|
|
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
|
|
DataInquiryGirdItemBean dataInquiryGirdItemBean = mDataInquiryMenuGridAdapter.getObjects().get(position);
|
|
|
+
|
|
|
String iconText = dataInquiryGirdItemBean.getIconText();
|
|
|
String dataInquiryMenuRecentCache = CommonUtil.getSharedPreferences(ReportStatisticsActivity.this,
|
|
|
mCurrentUser + mCurrentMaster + com.uas.appworks.datainquiry.Constants.CONSTANT.REPORT_QUERY_MENU_RECENT_CACHE);
|
|
|
@@ -179,7 +183,9 @@ public class ReportStatisticsActivity extends BaseActivity {
|
|
|
Intent intent = new Intent();
|
|
|
intent.setClass(ReportStatisticsActivity.this, ReportQueryCriteriaActivity.class);
|
|
|
intent.putExtra("reportinfo", reportlist.get(j));
|
|
|
- ReportStatisticsActivity.this.startActivity(intent);
|
|
|
+ String caller= reportlist.get(j).getCaller();
|
|
|
+ clickItem(caller);
|
|
|
+ // ReportStatisticsActivity.this.startActivity(intent);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
@@ -204,6 +210,7 @@ public class ReportStatisticsActivity extends BaseActivity {
|
|
|
mGridMenuReportStatisticsBeans = new ArrayList<>();
|
|
|
mReportStatisticsMenuListAdapter = new ReportStatisticsMenuListAdapter(this, mGridMenuReportStatisticsBeans);
|
|
|
mMenuListView.setAdapter(mReportStatisticsMenuListAdapter);
|
|
|
+ mReportStatisticsMenuListAdapter.setmHandler(mHandler);
|
|
|
|
|
|
mRecentBrowseLl = (LinearLayout) View.inflate(this, R.layout.item_list_data_inquiry_menu, null);
|
|
|
mReportStatisticsModulView = (View) mRecentBrowseLl.findViewById(R.id.data_inquiry_modul_view);
|
|
|
@@ -298,18 +305,51 @@ public class ReportStatisticsActivity extends BaseActivity {
|
|
|
|
|
|
|
|
|
private void getMenuData() {
|
|
|
- String url = CommonUtil.getAppBaseUrl(this) + "mobile/qry/getReport.action";
|
|
|
+// String url = CommonUtil.getAppBaseUrl(this) + "mobile/qry/getReport.action";
|
|
|
+// Map<String, Object> params = new HashMap<>();
|
|
|
+// params.put("emcode", CommonUtil.getSharedPreferences(ct, "erp_username"));
|
|
|
+// LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
+// headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
+// ViewUtil.httpSendRequest(this, url, params, mHandler, headers, GET_MENU_DATA, null, null, "get");
|
|
|
+
|
|
|
+ //common/getSearchByTree.action
|
|
|
+ String url = CommonUtil.getAppBaseUrl(this) + "common/getSearchByTree.action";
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
params.put("emcode", CommonUtil.getSharedPreferences(ct, "erp_username"));
|
|
|
LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
ViewUtil.httpSendRequest(this, url, params, mHandler, headers, GET_MENU_DATA, null, null, "get");
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ public void clickItem(String caller){
|
|
|
+ String url = CommonUtil.getAppBaseUrl(this) + "common/bi/getToken.action";
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ params.put("emcode", CommonUtil.getSharedPreferences(ct, "erp_username"));
|
|
|
+ params.put("caller",caller);
|
|
|
+ params.put("master",CommonUtil.getMaster());
|
|
|
+ LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
+ headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
+ ViewUtil.httpSendRequest(this, url, params, mHandler, headers, GET_CLICK_URL, null, null, "get");
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
private Handler mHandler = new Handler() {
|
|
|
@Override
|
|
|
public void handleMessage(Message msg) {
|
|
|
switch (msg.what) {
|
|
|
+ case GET_CLICK_URL:
|
|
|
+ String data = msg.getData().getString("result");
|
|
|
+ LogUtil.d("arison", "data:" + data);
|
|
|
+ String url = JSON.parseObject(data).getString("data");
|
|
|
+ if(!StringUtil.isEmpty(url)){
|
|
|
+ startActivity(new Intent(mContext, CommonWebviewActivity.class)
|
|
|
+ .putExtra("title",msg.getData().getString("mTitle"))
|
|
|
+ .putExtra("scan_url",url));
|
|
|
+ }
|
|
|
+ break;
|
|
|
case GET_MENU_DATA:
|
|
|
if (progressDialog.isShowing()) {
|
|
|
progressDialog.dismiss();
|