|
|
@@ -5,31 +5,43 @@ import android.support.v7.app.ActionBar;
|
|
|
import android.support.v7.widget.LinearLayoutManager;
|
|
|
import android.support.v7.widget.RecyclerView;
|
|
|
import android.text.SpannableStringBuilder;
|
|
|
+import android.text.TextUtils;
|
|
|
import android.view.View;
|
|
|
import android.widget.ImageView;
|
|
|
import android.widget.LinearLayout;
|
|
|
-import android.widget.PopupWindow;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
import com.afollestad.materialdialogs.MaterialDialog;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.chad.library.adapter.base.BaseQuickAdapter;
|
|
|
+import com.common.LogUtil;
|
|
|
+import com.common.data.DateFormatUtil;
|
|
|
import com.common.data.JSONUtil;
|
|
|
import com.core.app.Constants;
|
|
|
import com.core.base.activity.BaseMVPActivity;
|
|
|
import com.core.utils.CommonUtil;
|
|
|
import com.core.utils.SpanUtils;
|
|
|
import com.core.widget.DrawableCenterTextView;
|
|
|
+import com.me.network.app.base.HttpCallback;
|
|
|
+import com.me.network.app.base.HttpParams;
|
|
|
+import com.me.network.app.http.HttpRequest;
|
|
|
+import com.me.network.app.http.Method;
|
|
|
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
|
|
+import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
|
|
|
+import com.uas.appworks.OA.platform.activity.PurchaseDetailsActivity;
|
|
|
import com.uas.appworks.R;
|
|
|
import com.uas.appworks.adapter.B2BAccountAdapter;
|
|
|
+import com.uas.appworks.adapter.B2bBusinessListAdapter;
|
|
|
+import com.uas.appworks.model.bean.B2BBusinessListBean;
|
|
|
import com.uas.appworks.model.bean.B2BCompanyBean;
|
|
|
import com.uas.appworks.presenter.WorkPlatPresenter;
|
|
|
-import com.uas.appworks.view.WorkPlatView;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* @author RaoMeng
|
|
|
@@ -37,7 +49,8 @@ import java.util.List;
|
|
|
* @date 2018/1/14 14:19
|
|
|
*/
|
|
|
|
|
|
-public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter> implements WorkPlatView, View.OnClickListener {
|
|
|
+public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter> implements View.OnClickListener, HttpCallback {
|
|
|
+ private static final int OBTAIN_PURCHASE_ORDER_LIST = 0x01, OBTAIN_CUSTOMER_INQUIRY_LIST = 0x02, OBTAIN_PUBLIC_INQUIRY_LIST = 0x03;
|
|
|
|
|
|
private RefreshLayout mRefreshLayout;
|
|
|
private ImageView mBackImageView;
|
|
|
@@ -59,6 +72,9 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
|
|
|
private SpanUtils mSpanUtils;
|
|
|
private List<B2BCompanyBean> mB2BCompanyBeans;
|
|
|
private B2BAccountAdapter mB2BAccountAdapter;
|
|
|
+ private List<B2BBusinessListBean> mPurchaseOrderBeans, mCustomerInquiryBeans, mPublicInquiryBeans;
|
|
|
+ private B2bBusinessListAdapter mPurchaseOrderAdapter, mCustomerInquiryAdapter, mPublicInquiryAdapter;
|
|
|
+ private boolean isPurchaseSuccess, isCustomerSuccess, isPublicSuccess;
|
|
|
|
|
|
@Override
|
|
|
protected int getLayout() {
|
|
|
@@ -99,11 +115,29 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
|
|
|
mAccountDialog = new MaterialDialog.Builder(mContext)
|
|
|
.customView(accountView, true)
|
|
|
.build();
|
|
|
+
|
|
|
+ mPurchaseOrderRv.setLayoutManager(new LinearLayoutManager(mContext));
|
|
|
+ mPurchaseOrderRv.setNestedScrollingEnabled(false);
|
|
|
+ mPurchaseOrderBeans = new ArrayList<>();
|
|
|
+ mPurchaseOrderAdapter = new B2bBusinessListAdapter(mContext, mPurchaseOrderBeans);
|
|
|
+ mPurchaseOrderRv.setAdapter(mPurchaseOrderAdapter);
|
|
|
+
|
|
|
+ mCustomerInquiryRv.setLayoutManager(new LinearLayoutManager(mContext));
|
|
|
+ mCustomerInquiryRv.setNestedScrollingEnabled(false);
|
|
|
+ mCustomerInquiryBeans = new ArrayList<>();
|
|
|
+ mCustomerInquiryAdapter = new B2bBusinessListAdapter(mContext, mCustomerInquiryBeans);
|
|
|
+ mCustomerInquiryRv.setAdapter(mCustomerInquiryAdapter);
|
|
|
+
|
|
|
+ mPublicInquiryRv.setLayoutManager(new LinearLayoutManager(mContext));
|
|
|
+ mPublicInquiryRv.setNestedScrollingEnabled(false);
|
|
|
+ mPublicInquiryBeans = new ArrayList<>();
|
|
|
+ mPublicInquiryAdapter = new B2bBusinessListAdapter(mContext, mPublicInquiryBeans);
|
|
|
+ mPublicInquiryRv.setAdapter(mPublicInquiryAdapter);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
protected WorkPlatPresenter initPresenter() {
|
|
|
- return new WorkPlatPresenter();
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -118,6 +152,59 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
|
|
|
mPublicInquiryAllTv.setOnClickListener(this);
|
|
|
mAccountSureTextView.setOnClickListener(this);
|
|
|
mAccountCancelTextView.setOnClickListener(this);
|
|
|
+
|
|
|
+ mRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
|
|
|
+ @Override
|
|
|
+ public void onRefresh(RefreshLayout refreshLayout) {
|
|
|
+ if (CommonUtil.isNetWorkConnected(mContext)) {
|
|
|
+ isPurchaseSuccess = false;
|
|
|
+ isCustomerSuccess = false;
|
|
|
+ isPublicSuccess = false;
|
|
|
+ getListData(OBTAIN_PURCHASE_ORDER_LIST);
|
|
|
+ getListData(OBTAIN_CUSTOMER_INQUIRY_LIST);
|
|
|
+ getListData(OBTAIN_PUBLIC_INQUIRY_LIST);
|
|
|
+ } else {
|
|
|
+ toast(R.string.networks_out);
|
|
|
+ mRefreshLayout.finishRefresh(500, false);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ mPurchaseOrderAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onItemClick(BaseQuickAdapter baseQuickAdapter, View view, int i) {
|
|
|
+ Intent intent = new Intent();
|
|
|
+ intent.setClass(mContext, PurchaseDetailsActivity.class);
|
|
|
+ intent.putExtra(Constants.FLAG.KEY_PURCHASE_ID, mPurchaseOrderBeans.get(i).getId());
|
|
|
+ intent.putExtra(Constants.FLAG.KEY_PURCHASE_STATUS, mPurchaseOrderBeans.get(i).getBillState());
|
|
|
+ startActivity(intent);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ mCustomerInquiryAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onItemClick(BaseQuickAdapter baseQuickAdapter, View view, int i) {
|
|
|
+ Intent intent = new Intent();
|
|
|
+ intent.setClass(mContext, CustomerInquiryDetailActivity.class);
|
|
|
+ intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_ID, mCustomerInquiryBeans.get(i).getId());
|
|
|
+ intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_STATE, mCustomerInquiryBeans.get(i).getBillState());
|
|
|
+ intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_JSON, mCustomerInquiryBeans.get(i).getJsonData());
|
|
|
+ startActivity(intent);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ mPublicInquiryAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onItemClick(BaseQuickAdapter baseQuickAdapter, View view, int i) {
|
|
|
+ Intent intent = new Intent();
|
|
|
+ intent.setClass(mContext, PublicInquiryDetailActivity.class);
|
|
|
+ intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_ID, mPublicInquiryBeans.get(i).getId());
|
|
|
+ intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_STATE, mPublicInquiryBeans.get(i).getBillState());
|
|
|
+ intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_JSON, mPublicInquiryBeans.get(i).getJsonData());
|
|
|
+ startActivity(intent);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -129,6 +216,50 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
|
|
|
SpannableStringBuilder companyName = mSpanUtils.append(mB2BCompanyBean.getName()).setUnderline().create();
|
|
|
mCompanyNameTextView.setText(companyName);
|
|
|
}
|
|
|
+
|
|
|
+ if (CommonUtil.isNetWorkConnected(mContext)) {
|
|
|
+ showLoading(null);
|
|
|
+ getListData(OBTAIN_PURCHASE_ORDER_LIST);
|
|
|
+ getListData(OBTAIN_CUSTOMER_INQUIRY_LIST);
|
|
|
+ getListData(OBTAIN_PUBLIC_INQUIRY_LIST);
|
|
|
+ } else {
|
|
|
+ toast(R.string.networks_out);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private void getListData(int flag) {
|
|
|
+ String url = "";
|
|
|
+ switch (flag) {
|
|
|
+ case OBTAIN_PURCHASE_ORDER_LIST:
|
|
|
+ url = "mobile/sale/orders/info/search";
|
|
|
+ break;
|
|
|
+ case OBTAIN_CUSTOMER_INQUIRY_LIST:
|
|
|
+ url = "mobile/sale/inquiry/info/search";
|
|
|
+ break;
|
|
|
+ case OBTAIN_PUBLIC_INQUIRY_LIST:
|
|
|
+ url = "mobile/purc/inquiry/publicInquiryItem";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ showLoading(null);
|
|
|
+
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+// params.put("en_uu", mB2BCompanyBean.getEnuu());
|
|
|
+ params.put("en_uu", 10041559);
|
|
|
+// params.put("user_tel", MyApplication.getInstance().mLoginUser.getTelephone());
|
|
|
+ params.put("user_tel", "15671616315");
|
|
|
+ params.put("_state", "");
|
|
|
+ params.put("page", 1);
|
|
|
+ params.put("size", 3);
|
|
|
+
|
|
|
+ HttpRequest.getInstance().sendRequest("http://192.168.253.102:8090/platform-b2b/",
|
|
|
+ new HttpParams.Builder()
|
|
|
+ .url(url)
|
|
|
+ .flag(flag)
|
|
|
+ .method(Method.GET)
|
|
|
+ .setHeaders(new HashMap<String, Object>())
|
|
|
+ .setParams(params)
|
|
|
+ .build(), this);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -147,12 +278,184 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void requestSuccess(int what, Object object) {
|
|
|
+ public void onSuccess(int flag, Object o) {
|
|
|
+ try {
|
|
|
+ String result = o.toString();
|
|
|
+ LogUtil.prinlnLongMsg("b2blistlogsuccess", result);
|
|
|
+ JSONObject resultObject = JSON.parseObject(result);
|
|
|
+ JSONArray contentArray = resultObject.getJSONArray("content");
|
|
|
+ switch (flag) {
|
|
|
+ case OBTAIN_PURCHASE_ORDER_LIST:
|
|
|
+ isPurchaseSuccess = true;
|
|
|
+ if (isCustomerSuccess && isPublicSuccess) {
|
|
|
+ hideLoading();
|
|
|
+ }
|
|
|
+ if (contentArray == null || contentArray.size() == 0) {
|
|
|
+ mPurchaseOrderBeans.clear();
|
|
|
+ mPurchaseOrderAdapter.notifyDataSetChanged();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ mPurchaseOrderBeans.clear();
|
|
|
+ analysisPurchaseOrder(contentArray);
|
|
|
+ break;
|
|
|
+ case OBTAIN_CUSTOMER_INQUIRY_LIST:
|
|
|
+ isCustomerSuccess = true;
|
|
|
+ if (isPurchaseSuccess && isPublicSuccess) {
|
|
|
+ hideLoading();
|
|
|
+ }
|
|
|
+ if (contentArray == null || contentArray.size() == 0) {
|
|
|
+ mCustomerInquiryBeans.clear();
|
|
|
+ mCustomerInquiryAdapter.notifyDataSetChanged();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ mCustomerInquiryBeans.clear();
|
|
|
+ analysisCustomerInquiry(contentArray);
|
|
|
+ break;
|
|
|
+ case OBTAIN_PUBLIC_INQUIRY_LIST:
|
|
|
+ isPublicSuccess = true;
|
|
|
+ if (isCustomerSuccess && isPurchaseSuccess) {
|
|
|
+ hideLoading();
|
|
|
+ }
|
|
|
+ if (contentArray == null || contentArray.size() == 0) {
|
|
|
+ mPublicInquiryBeans.clear();
|
|
|
+ mPublicInquiryAdapter.notifyDataSetChanged();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ mPublicInquiryBeans.clear();
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private void analysisCustomerInquiry(JSONArray contentArray) {
|
|
|
+ for (int i = 0; i < contentArray.size(); i++) {
|
|
|
+ JSONObject contentObject = contentArray.getJSONObject(i);
|
|
|
+ if (contentObject != null) {
|
|
|
+ B2BBusinessListBean b2BBusinessListBean = new B2BBusinessListBean();
|
|
|
+ b2BBusinessListBean.setJsonData(contentObject.toString());
|
|
|
+ b2BBusinessListBean.setItemType(B2BBusinessListBean.CUSTOMER_INQUIRY_LIST);
|
|
|
+ b2BBusinessListBean.setId(JSONUtil.getText(contentObject, "id"));
|
|
|
|
|
|
+ JSONObject inquiryObject = contentObject.getJSONObject("inquiry");
|
|
|
+ if (inquiryObject != null) {
|
|
|
+ JSONObject enterpriseObject = inquiryObject.getJSONObject("enterprise");
|
|
|
+ if (enterpriseObject != null) {
|
|
|
+ b2BBusinessListBean.setCompanyName(JSONUtil.getText(enterpriseObject, "enName"));
|
|
|
+ }
|
|
|
+ b2BBusinessListBean.setMaterialNum(JSONUtil.getText(inquiryObject, "code"));
|
|
|
+ b2BBusinessListBean.setBillNum(JSONUtil.getText(inquiryObject, "id"));
|
|
|
+ b2BBusinessListBean.setExpiryDate(DateFormatUtil.long2Str((JSONUtil.getLong(inquiryObject, "endDate") / 1000), "yyyy-MM-dd"));
|
|
|
+ }
|
|
|
+ b2BBusinessListBean.setBillDate(DateFormatUtil.long2Str((JSONUtil.getLong(contentObject, "date") / 1000), "yyyy-MM-dd"));
|
|
|
+
|
|
|
+ String invalid = JSONUtil.getText(contentObject, "invalid");
|
|
|
+ if ("1".equals(invalid)) {
|
|
|
+ b2BBusinessListBean.setBillState(Constants.FLAG.STATE_CUSTOMER_INQUIRY_INVALID);
|
|
|
+ } else {
|
|
|
+ String overdue = JSONUtil.getText(contentObject, "overdue");
|
|
|
+ if ("1".equals(overdue)) {
|
|
|
+ b2BBusinessListBean.setBillState(Constants.FLAG.STATE_CUSTOMER_INQUIRY_END);
|
|
|
+ } else {
|
|
|
+ String agreed = JSONUtil.getText(contentObject, "agreed");
|
|
|
+ if ("1".equals(agreed)) {
|
|
|
+ b2BBusinessListBean.setBillState(Constants.FLAG.STATE_CUSTOMER_INQUIRY_AGREED);
|
|
|
+ } else if ("0".equals(agreed)) {
|
|
|
+ b2BBusinessListBean.setBillState(Constants.FLAG.STATE_CUSTOMER_INQUIRY_REFUSED);
|
|
|
+ } else {
|
|
|
+ String status = JSONUtil.getText(contentObject, "status");
|
|
|
+ if ("200".equals(status)) {
|
|
|
+ b2BBusinessListBean.setBillState(Constants.FLAG.STATE_CUSTOMER_INQUIRY_TODO);
|
|
|
+ } else if ("201".equals(status)) {
|
|
|
+ b2BBusinessListBean.setBillState(Constants.FLAG.STATE_CUSTOMER_INQUIRY_DONE);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ mCustomerInquiryBeans.add(b2BBusinessListBean);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ mCustomerInquiryAdapter.notifyDataSetChanged();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void analysisPurchaseOrder(JSONArray contentArray) {
|
|
|
+ for (int i = 0; i < contentArray.size(); i++) {
|
|
|
+ JSONObject contentObject = contentArray.getJSONObject(i);
|
|
|
+ if (contentObject != null) {
|
|
|
+ B2BBusinessListBean b2BBusinessListBean = new B2BBusinessListBean();
|
|
|
+ b2BBusinessListBean.setJsonData(contentObject.toString());
|
|
|
+ b2BBusinessListBean.setItemType(B2BBusinessListBean.PURCHASE_ORDER_LIST);
|
|
|
+ b2BBusinessListBean.setId(JSONUtil.getText(contentObject, "id"));
|
|
|
+ b2BBusinessListBean.setCompanyName(JSONUtil.getText(contentObject, "receiveName"));
|
|
|
+ b2BBusinessListBean.setBillDate(DateFormatUtil.long2Str((JSONUtil.getLong(contentObject, "date") / 1000), "yyyy-MM-dd"));
|
|
|
+ b2BBusinessListBean.setBillNum(JSONUtil.getText(contentObject, "code"));
|
|
|
+ b2BBusinessListBean.setMaterialNum("ddd");
|
|
|
+ JSONArray orderItems = contentObject.getJSONArray("orderItems");
|
|
|
+ if (orderItems == null || orderItems.size() == 0) {
|
|
|
+ b2BBusinessListBean.setMoney("0");
|
|
|
+ } else {
|
|
|
+ long money = 0;
|
|
|
+ for (int j = 0; j < orderItems.size(); j++) {
|
|
|
+ JSONObject orderItem = orderItems.getJSONObject(j);
|
|
|
+ long amount = JSONUtil.getLong(orderItem, "amount");
|
|
|
+ money += amount;
|
|
|
+ }
|
|
|
+ b2BBusinessListBean.setMoney(money + "");
|
|
|
+ }
|
|
|
+ String end = JSONUtil.getText(contentObject, "end");
|
|
|
+ if (!TextUtils.isEmpty(end) && "1".equals(end)) {
|
|
|
+ b2BBusinessListBean.setBillState(Constants.FLAG.STATE_PURCHASE_ORDER_END);
|
|
|
+ } else {
|
|
|
+ String status = JSONUtil.getText(contentObject, "status");
|
|
|
+ if ("200".equals(status)) {
|
|
|
+ b2BBusinessListBean.setBillState(Constants.FLAG.STATE_PURCHASE_ORDER_TODO);
|
|
|
+ } else if ("201".equals(status)) {
|
|
|
+ b2BBusinessListBean.setBillState(Constants.FLAG.STATE_PURCHASE_ORDER_DONE);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ mPurchaseOrderBeans.add(b2BBusinessListBean);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ mPurchaseOrderAdapter.notifyDataSetChanged();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void requestError(int what, String errorMsg) {
|
|
|
+ public void onFail(int flag, String failStr) {
|
|
|
+ try {
|
|
|
+ if (!CommonUtil.isRepeatClick(2000)) {
|
|
|
+ toast(failStr);
|
|
|
+ }
|
|
|
+ switch (flag) {
|
|
|
+ case OBTAIN_PURCHASE_ORDER_LIST:
|
|
|
+ isPurchaseSuccess = true;
|
|
|
+ if (isCustomerSuccess && isPublicSuccess) {
|
|
|
+ hideLoading();
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case OBTAIN_CUSTOMER_INQUIRY_LIST:
|
|
|
+ isCustomerSuccess = true;
|
|
|
+ if (isPurchaseSuccess && isPublicSuccess) {
|
|
|
+ hideLoading();
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case OBTAIN_PUBLIC_INQUIRY_LIST:
|
|
|
+ isPublicSuccess = true;
|
|
|
+ if (isCustomerSuccess && isPurchaseSuccess) {
|
|
|
+ hideLoading();
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -173,15 +476,30 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
|
|
|
|| i == R.id.b2b_business_main_public_inquiry_all_tv) {
|
|
|
startActivity(PublicInquiryListActivity.class);
|
|
|
} else if (i == R.id.b2b_change_account_sure_tv) {
|
|
|
- for (B2BCompanyBean b2BCompanyBean : mB2BCompanyBeans) {
|
|
|
- if (b2BCompanyBean.isSelected()) {
|
|
|
- mB2BCompanyBean = b2BCompanyBean;
|
|
|
- break;
|
|
|
+ if (CommonUtil.isNetWorkConnected(mContext)) {
|
|
|
+ for (B2BCompanyBean b2BCompanyBean : mB2BCompanyBeans) {
|
|
|
+ if (b2BCompanyBean.isSelected()) {
|
|
|
+ mB2BCompanyBean = b2BCompanyBean;
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
+ CommonUtil.setSharedPreferences(mContext, Constants.CACHE.B2B_BUSINESS_ENUU, mB2BCompanyBean.getEnuu());
|
|
|
+ mSpanUtils = new SpanUtils();
|
|
|
+ SpannableStringBuilder companyName = mSpanUtils.append(mB2BCompanyBean.getName()).setUnderline().create();
|
|
|
+ mCompanyNameTextView.setText(companyName);
|
|
|
+ mAccountDialog.dismiss();
|
|
|
+
|
|
|
+ isPurchaseSuccess = false;
|
|
|
+ isCustomerSuccess = false;
|
|
|
+ isPublicSuccess = false;
|
|
|
+ showLoading(null);
|
|
|
+ getListData(OBTAIN_PURCHASE_ORDER_LIST);
|
|
|
+ getListData(OBTAIN_CUSTOMER_INQUIRY_LIST);
|
|
|
+ getListData(OBTAIN_PUBLIC_INQUIRY_LIST);
|
|
|
+ } else {
|
|
|
+ toast(R.string.networks_out);
|
|
|
}
|
|
|
- mSpanUtils = new SpanUtils();
|
|
|
- SpannableStringBuilder companyName = mSpanUtils.append(mB2BCompanyBean.getName()).setUnderline().create();
|
|
|
- mCompanyNameTextView.setText(companyName);
|
|
|
+
|
|
|
} else if (i == R.id.b2b_change_account_cancel_tv) {
|
|
|
mAccountDialog.dismiss();
|
|
|
}
|
|
|
@@ -237,4 +555,5 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|