导航菜单

页面标题

页面副标题

大众借. v4.1.2 - MTM0ACT.java 源代码

正在查看: 大众借. v4.1.2 应用的 MTM0ACT.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.shiliuj.ui.activitys;

import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
import androidx.core.app.NotificationCompat;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import com.base.commonlibrary.base.BaseResult;
import com.base.commonlibrary.base.baseapp.AppActivityManager;
import com.base.commonlibrary.base.baserx.RxHelper;
import com.base.commonlibrary.base.baserx.RxSchedulers;
import com.base.commonlibrary.baseview.BaseDialogFragment;
import com.base.commonlibrary.baseview.recyclerview.MultiItemTypeAdapter;
import com.base.commonlibrary.netstate.ComNetWorkUtil;
import com.base.commonlibrary.utils.MD5Utils;
import com.base.commonlibrary.utils.RSAUtils;
import com.base.commonlibrary.utils.RegexUtil;
import com.base.commonlibrary.utils.SPUtils;
import com.base.commonlibrary.utils.ToastUtil;
import com.base.commonlibrary.views.TitleLayout;
import com.google.gson.Gson;
import com.liaoinstan.springview.widget.SpringView;
import com.shiliuj.mjyp.BMAG01ACT;
import com.shiliuj.mjyp.adapters.ChooseWayAdapter;
import com.shiliuj.mjyp.app.api.Api;
import com.shiliuj.mjyp.app.base.BaseBindActivity;
import com.shiliuj.mjyp.app.base.RxSubscriber;
import com.shiliuj.mjyp.app.fragment.LoginPwdDialog;
import com.shiliuj.ui.activitys.MTM0ACT;
import com.shiliuj.ui.bean.EncForm;
import com.shiliuj.ui.bean.MyBorrowBean;
import com.shiliuj.ui.bean.OrderthirdBean;
import com.shiliuj.ui.bean.PostponeBean;
import com.shiliuj.ui.bean.Result;
import com.shiliuj.ui.bean.VerifyCodeBean;
import com.shiliuj.ui.views.SureAndCancelDialog;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

public class MTM0ACT extends BaseBindActivity {
    private int TYPE;
    ChooseWayAdapter chooseWayAdapter;
    List<OrderthirdBean.ResultBean> datas = new ArrayList();
    private MyBorrowBean myBorrow;
    private String orderNo;
    private PostponeBean postponeBean;

    @BindView(2131296802)
    RecyclerView recycleView;

    @BindView(2131296905)
    SpringView sp;

    @BindView(2131296966)
    TextView tip;

    @BindView(2131296998)
    TitleLayout title;

    protected boolean canLoadMore() {
        return false;
    }

    public int getLayoutId() {
        return 2131492898;
    }

    public void initPresenter() {
    }

    protected void loadMore() {
    }

    protected void refresh() {
        loadData(false);
    }

    public void initView(Bundle bundle) {
        final Bundle extras = getIntent().getExtras();
        if (extras != null) {
            int i = extras.getInt("TYPE", 1);
            this.TYPE = i;
            if (i == 1) {
                MyBorrowBean serializable = extras.getSerializable("myBorrow");
                this.myBorrow = serializable;
                this.orderNo = serializable.getOrderNo();
            } else {
                PostponeBean serializable2 = extras.getSerializable("myBorrow");
                this.postponeBean = serializable2;
                this.orderNo = serializable2.getOrderNo();
            }
        }
        this.chooseWayAdapter = new ChooseWayAdapter(this.mContext, 2131492974, this.datas);
        this.recycleView.setLayoutManager(new LinearLayoutManager(this.mContext));
        this.recycleView.setAdapter(this.chooseWayAdapter);
        this.chooseWayAdapter.setOnItemClickListener(new MultiItemTypeAdapter.OnItemClickListener() {
            public boolean onItemLongClick(View view, RecyclerView.ViewHolder viewHolder, int i2) {
                return false;
            }

            public void onItemClick(View view, RecyclerView.ViewHolder viewHolder, int i2) {
                if (i2 < 0 || i2 >= MTM0ACT.this.datas.size()) {
                    return;
                }
                OrderthirdBean.ResultBean resultBean = MTM0ACT.this.datas.get(i2);
                Integer valueOf = Integer.valueOf(resultBean.getJumpStatus() == null ? 0 : resultBean.getJumpStatus().intValue());
                int id = resultBean.getId();
                if (valueOf.intValue() != 0) {
                    if (MTM0ACT.this.TYPE != 1) {
                        MTM0ACT.this.xQData(id);
                        return;
                    } else {
                        MTM0ACT.this.repaymentOrder(id);
                        return;
                    }
                }
                Bundle bundle2 = new Bundle();
                bundle2.putInt("TYPE", MTM0ACT.this.TYPE);
                bundle2.putInt("id", id);
                if (MTM0ACT.this.TYPE == 1) {
                    MTM0ACT.this.myBorrow = extras.getSerializable("myBorrow");
                    MTM0ACT.this.myBorrow.setThirdChannelId(id);
                    bundle2.putSerializable("myBorrow", MTM0ACT.this.myBorrow);
                } else {
                    MTM0ACT.this.postponeBean = extras.getSerializable("myBorrow");
                    MTM0ACT.this.postponeBean.setThirdChannelId(id);
                    bundle2.putSerializable("myBorrow", MTM0ACT.this.postponeBean);
                }
                MTM0ACT.this.startActivity(MTT0Act.class, bundle2);
                MTM0ACT.this.finish();
            }
        });
        loadData(true);
    }

    private void loadData(boolean z) {
        this.mRxManager.add(Api.getDefault().orderthirdchannel().compose(RxHelper.handleResult()).subscribe(new RxSubscriber<List<OrderthirdBean.ResultBean>>(this.mContext, z) {
            public void _onNext(List<OrderthirdBean.ResultBean> list) {
                if (list != null) {
                    MTM0ACT.this.datas.clear();
                    MTM0ACT.this.datas = list;
                    MTM0ACT.this.chooseWayAdapter.replaceAll(list);
                    MTM0ACT.this.stopLoading();
                }
            }

            protected void _onError(String str) {
                MTM0ACT.this.showShortToast(str);
            }
        }));
    }

    protected void repaymentOrder(int i) {
        if (ComNetWorkUtil.isNetworkAvailable(this.mContext)) {
            MyBorrowBean myBorrowBean = this.myBorrow;
            if (myBorrowBean != null) {
                myBorrowBean.setThirdChannelId(i);
                String json = new Gson().toJson(this.myBorrow);
                long currentTimeMillis = System.currentTimeMillis();
                String uuid = UUID.randomUUID().toString();
                String str = json + "@" + uuid + "@" + currentTimeMillis;
                String encrypt = RSAUtils.getInstance().encrypt(str + "@" + MD5Utils.md5(str, "f4qgkb85q4pMRMChLeC7uSn2wwTWGXrs"));
                StringBuilder sb = new StringBuilder();
                sb.append(currentTimeMillis);
                sb.append("");
                this.mRxManager.add(Api.getDefault().repaymentOrderEnc(new EncForm(encrypt, uuid, sb.toString())).compose(RxSchedulers.io_main()).subscribe(new RxSubscriber<BaseResult<Result>>(this.mContext, true) {
                    public void _onNext(BaseResult<Result> baseResult) {
                        if (baseResult.getCode() == 3039) {
                            MTM0ACT.this.showShortToast(baseResult.getMessage());
                            MTM0ACT.this.startActivity(MTG0ACT.class);
                            return;
                        }
                        if (baseResult.getCode() == 200) {
                            String message = baseResult.getMessage();
                            Result result = (Result) baseResult.getResult();
                            if (result != null && !TextUtils.isEmpty(result.getPayUrl())) {
                                String payUrl = result.getPayUrl();
                                Bundle bundle = new Bundle();
                                bundle.putString("title", MTM0ACT.this.getResources().getString(2131689909));
                                bundle.putString("url", payUrl);
                                bundle.putSerializable("myBorrow", MTM0ACT.this.myBorrow);
                                MTM0ACT.this.showShortToast(message);
                                MTM0ACT.this.startActivity(MT7ACT.class, bundle);
                                MTM0ACT.this.finish();
                                return;
                            }
                            Bundle bundle2 = new Bundle();
                            bundle2.putInt(NotificationCompat.CATEGORY_STATUS, 1);
                            bundle2.putString(NotificationCompat.CATEGORY_MESSAGE, MTM0ACT.this.myBorrow.getRepaymentAmount() + "");
                            bundle2.putSerializable("myBorrow", MTM0ACT.this.myBorrow);
                            MTM0ACT.this.mRxManager.post("Status", "登录");
                            MTM0ACT.this.startActivity(MT1ACT.class, bundle2);
                            return;
                        }
                        if (baseResult.getCode() == 2022) {
                            Bundle bundle3 = new Bundle();
                            bundle3.putInt(NotificationCompat.CATEGORY_STATUS, 2);
                            bundle3.putString(NotificationCompat.CATEGORY_MESSAGE, MTM0ACT.this.myBorrow.getRepaymentAmount() + "");
                            bundle3.putSerializable("myBorrow", MTM0ACT.this.myBorrow);
                            MTM0ACT.this.startActivity(MT1ACT.class, bundle3);
                            return;
                        }
                        if (baseResult.getCode() == 202) {
                            MTM0ACT.this.showSmsDialog();
                            return;
                        }
                        Bundle bundle4 = new Bundle();
                        bundle4.putInt(NotificationCompat.CATEGORY_STATUS, 0);
                        bundle4.putSerializable("myBorrow", MTM0ACT.this.myBorrow);
                        bundle4.putString(NotificationCompat.CATEGORY_MESSAGE, baseResult.getMessage());
                        MTM0ACT.this.startActivity(MT1ACT.class, bundle4);
                    }

                    protected void _onError(String str2) {
                        Bundle bundle = new Bundle();
                        bundle.putInt(NotificationCompat.CATEGORY_STATUS, 0);
                        bundle.putString(NotificationCompat.CATEGORY_MESSAGE, str2);
                        MTM0ACT.this.startActivity(MT1ACT.class, bundle);
                    }
                }));
                return;
            }
            showShortToast(getResources().getString(2131689868));
        }
    }

    public void showSmsDialog() {
        final LoginPwdDialog newInstance = LoginPwdDialog.newInstance((String) SPUtils.getData("PHONE", ""));
        newInstance.setOnButtonOkClickListener(new BaseDialogFragment.OnButtonOkClickListener() {
            public void onClick(View view, String str) {
                if (RegexUtil.isEmpty(str)) {
                    return;
                }
                MTM0ACT.this.deductVerifyCode(str);
                newInstance.dismiss();
            }
        });
        getSupportFragmentManager().beginTransaction().add((Fragment) newInstance, "LoginPwdDialog").commitAllowingStateLoss();
    }

    public void xQData(int i) {
        PostponeBean postponeBean = this.postponeBean;
        if (postponeBean != null) {
            postponeBean.setThirdChannelId(i);
            String json = new Gson().toJson(this.postponeBean);
            long currentTimeMillis = System.currentTimeMillis();
            String uuid = UUID.randomUUID().toString();
            String str = json + "@" + uuid + "@" + currentTimeMillis;
            String encrypt = RSAUtils.getInstance().encrypt(str + "@" + MD5Utils.md5(str, "f4qgkb85q4pMRMChLeC7uSn2wwTWGXrs"));
            StringBuilder sb = new StringBuilder();
            sb.append(currentTimeMillis);
            sb.append("");
            this.mRxManager.add(Api.getDefault().postponeCreateEnc(new EncForm(encrypt, uuid, sb.toString())).compose(RxSchedulers.io_main()).subscribe(new RxSubscriber<BaseResult<PostponeBean>>(this.mContext, true) {
                public void _onNext(BaseResult<PostponeBean> baseResult) {
                    if (baseResult.getCode() == 202) {
                        MTM0ACT.this.showSmsDialog();
                        return;
                    }
                    Serializable serializable = (PostponeBean) baseResult.getResult();
                    String payUrl = serializable.getPayUrl();
                    if (TextUtils.isEmpty(payUrl)) {
                        Bundle bundle = new Bundle();
                        bundle.putInt(NotificationCompat.CATEGORY_STATUS, 1);
                        if (serializable != null) {
                            if (serializable.getOrderNo() != null) {
                                MTM0ACT.this.orderNo = serializable.getOrderNo();
                            }
                            bundle.putSerializable("postponeBean", serializable);
                        } else {
                            bundle.putString(NotificationCompat.CATEGORY_MESSAGE, MTM0ACT.this.getResources().getString(2131689982));
                        }
                        bundle.putString("ORDERID", MTM0ACT.this.orderNo);
                        MTM0ACT.this.startActivity(MT2ACT.class, bundle);
                        return;
                    }
                    Bundle bundle2 = new Bundle();
                    bundle2.putString("title", MTM0ACT.this.getResources().getString(2131689966));
                    bundle2.putString("url", payUrl);
                    bundle2.putSerializable("myBorrow", serializable);
                    MTM0ACT.this.startActivity(MT7ACT.class, bundle2);
                    MTM0ACT.this.finish();
                }

                protected void _onError(String str2) {
                    MTM0ACT.this.showShortToast(str2);
                    Bundle bundle = new Bundle();
                    bundle.putInt(NotificationCompat.CATEGORY_STATUS, 0);
                    bundle.putString(NotificationCompat.CATEGORY_MESSAGE, str2);
                    bundle.putString("ORDERID", MTM0ACT.this.orderNo);
                    MTM0ACT.this.startActivity(MT2ACT.class, bundle);
                }
            }));
        }
    }

    protected void deductVerifyCode(String str) {
        VerifyCodeBean verifyCodeBean = new VerifyCodeBean();
        verifyCodeBean.verifyCode = str;
        Api.getDefault().deductVerifyCode(verifyCodeBean).compose(RxSchedulers.io_main()).subscribe(new AnonymousClass6(this, false));
    }

    class AnonymousClass6 extends RxSubscriber<BaseResult> {
        AnonymousClass6(Context context, boolean z) {
            super(context, z);
        }

        public void _onNext(final BaseResult baseResult) {
            final SureAndCancelDialog sureAndCancelDialog = new SureAndCancelDialog(MTM0ACT.this.mContext, 2131492961);
            ((TextView) sureAndCancelDialog.getView(2131296444)).setText(baseResult.getMessage());
            sureAndCancelDialog.setOnClickCancel(new SureAndCancelDialog.onClickCancel() {
                public final void onClickCancel() {
                    sureAndCancelDialog.dismiss();
                }
            });
            sureAndCancelDialog.setOnClickSure(new SureAndCancelDialog.onClickSure() {
                public final void onClickSure() {
                    MTM0ACT.AnonymousClass6.lambda$_onNext$1(sureAndCancelDialog, baseResult);
                }
            });
            sureAndCancelDialog.show();
        }

        static void lambda$_onNext$1(SureAndCancelDialog sureAndCancelDialog, BaseResult baseResult) {
            sureAndCancelDialog.dismiss();
            if (baseResult.getCode() == 200) {
                AppActivityManager.getAppManager().getActivity(BMAG01ACT.class).onCheckPosition(0);
                AppActivityManager.getAppManager().returnToActivity(BMAG01ACT.class);
            } else {
                AppActivityManager.getAppManager().getActivity(BMAG01ACT.class).onCheckPosition(1);
                AppActivityManager.getAppManager().returnToActivity(BMAG01ACT.class);
            }
        }

        protected void _onError(String str) {
            new ToastUtil().showShort(MTM0ACT.this, str);
        }
    }
}