Search in sources :

Example 1 with RecordBaseGsonBean

use of com.mtm.mrecord.mvp.model.entity.RecordBaseGsonBean in project Mvp-Rxjava-Retrofit-dagger2 by pengMaster.

the class MediaRecordFragment method initData.

@Override
public void initData(Bundle savedInstanceState) {
    String baseGsonBean = getActivity().getIntent().getStringExtra("baseGsonBean");
    RecordBaseGsonBean recordBaseGsonBean = gson.fromJson(baseGsonBean, RecordBaseGsonBean.class);
    id = recordBaseGsonBean.getId();
    refreshMediaView();
    // 是否归档
    superviseForm superviseForm = recordBaseGsonBean.getSuperviseForm();
    isCaseFile(superviseForm);
}
Also used : com.mtm.mrecord.mvp.model.entity.superviseForm(com.mtm.mrecord.mvp.model.entity.superviseForm) RecordBaseGsonBean(com.mtm.mrecord.mvp.model.entity.RecordBaseGsonBean)

Example 2 with RecordBaseGsonBean

use of com.mtm.mrecord.mvp.model.entity.RecordBaseGsonBean in project Mvp-Rxjava-Retrofit-dagger2 by pengMaster.

the class RecordSuperviseListPresenter method downLoadSuperviseRecordBaseInfo.

/**
 * 下载监督记录基本信息
 *
 * @param id
 */
public void downLoadSuperviseRecordBaseInfo(final String id) {
    Observable<SuperviseContentGsonBean> superviseContent = mModel.getSuperviseContentNet(id);
    Observable<superviseForm> recordBaseInfo = mModel.getRecordBaseInfo(id);
    Observable<LawDocumentGsonBean> lawFileNet = mModel.getLawFileNet(id);
    Observable.zip(recordBaseInfo, superviseContent, lawFileNet, new Function3<superviseForm, SuperviseContentGsonBean, LawDocumentGsonBean, RecordBaseGsonBean>() {

        @Override
        public RecordBaseGsonBean apply(@NonNull superviseForm superviseForm, @NonNull SuperviseContentGsonBean categoryResult, @NonNull LawDocumentGsonBean lawDocumentGsonBean) throws Exception {
            // 合并两次请求的结果
            RecordBaseGsonBean baseGsonBean = new RecordBaseGsonBean();
            baseGsonBean.setSuperviseForm(superviseForm);
            baseGsonBean.setCategoryResult(categoryResult);
            baseGsonBean.setLawDocumentGsonBean(lawDocumentGsonBean);
            baseGsonBean.setId(id);
            return baseGsonBean;
        }
    }).subscribeOn(Schedulers.io()).doOnSubscribe(new // 在执行任务前,做准备操作
    Consumer<Disposable>() {

        @Override
        public void accept(Disposable disposable) throws Exception {
            // 在执行任务之前 do some thing ...
            mRootView.showLoading();
        }
    }).observeOn(AndroidSchedulers.mainThread()).doFinally(new // 任务结束 do some thing ...
    Action() {

        @Override
        public void run() throws Exception {
            mRootView.hideLoading();
        }
    }).subscribe(new Consumer<RecordBaseGsonBean>() {

        @Override
        public void accept(@NonNull RecordBaseGsonBean recordBaseGsonBean) throws Exception {
            mRootView.hideLoading();
            mRootView.startActivity(recordBaseGsonBean);
        }
    }, new Consumer<Throwable>() {

        @Override
        public void accept(@NonNull Throwable throwable) throws Exception {
            ToastUtils.showShort(throwable.getMessage());
        }
    });
}
Also used : Disposable(io.reactivex.disposables.Disposable) Action(io.reactivex.functions.Action) Function3(io.reactivex.functions.Function3) SuperviseContentGsonBean(com.mtm.mrecord.mvp.model.entity.SuperviseContentGsonBean) com.mtm.mrecord.mvp.model.entity.superviseForm(com.mtm.mrecord.mvp.model.entity.superviseForm) Consumer(io.reactivex.functions.Consumer) NonNull(io.reactivex.annotations.NonNull) LawDocumentGsonBean(com.mtm.mrecord.mvp.model.entity.LawDocumentGsonBean) RecordBaseGsonBean(com.mtm.mrecord.mvp.model.entity.RecordBaseGsonBean)

Example 3 with RecordBaseGsonBean

use of com.mtm.mrecord.mvp.model.entity.RecordBaseGsonBean in project Mvp-Rxjava-Retrofit-dagger2 by pengMaster.

the class LawFileFragment method initData.

@Override
public void initData(Bundle savedInstanceState) {
    tvItemTitle.setText("文书列表");
    String baseGsonBean = getActivity().getIntent().getStringExtra("baseGsonBean");
    RecordBaseGsonBean recordBaseGsonBean = gson.fromJson(baseGsonBean, RecordBaseGsonBean.class);
    LawDocumentGsonBean lawDocumentGsonBean = recordBaseGsonBean.getLawDocumentGsonBean();
    setViewData(lawDocumentGsonBean);
}
Also used : LawDocumentGsonBean(com.mtm.mrecord.mvp.model.entity.LawDocumentGsonBean) RecordBaseGsonBean(com.mtm.mrecord.mvp.model.entity.RecordBaseGsonBean)

Example 4 with RecordBaseGsonBean

use of com.mtm.mrecord.mvp.model.entity.RecordBaseGsonBean in project Mvp-Rxjava-Retrofit-dagger2 by pengMaster.

the class SuperviseBaseInfoFragment method initData.

@Override
public void initData(Bundle savedInstanceState) {
    String baseGsonBean = getActivity().getIntent().getStringExtra("baseGsonBean");
    View viewById = view.findViewById(R.id.ll_unit_info_title);
    TextView tvUnitName = (TextView) viewById.findViewById(R.id.tv_item_title);
    if (null != tvUnitName) {
        tvUnitName.setText("基本信息");
    }
    View viewBase = view.findViewById(R.id.ll_unit_base_title);
    TextView tvBaseName = (TextView) viewBase.findViewById(R.id.tv_item_title);
    if (null != tvBaseName) {
        tvBaseName.setText("监督内容");
    }
    View viewSpec = view.findViewById(R.id.ll_unit_spec_title);
    TextView tvSpecName = (TextView) viewSpec.findViewById(R.id.tv_item_title);
    if (null != tvSpecName) {
        tvSpecName.setText("监督专业类别");
    }
    View viewCheck = view.findViewById(R.id.ll_check_result);
    TextView tvCheck = (TextView) viewCheck.findViewById(R.id.tv_item_title);
    if (null != tvCheck) {
        tvCheck.setText("检查结果");
    }
    RecordBaseGsonBean recordBaseGsonBean = gson.fromJson(baseGsonBean, RecordBaseGsonBean.class);
    if (null == recordBaseGsonBean) {
        showMessage("基本信息解析出错");
        return;
    }
    // 设置单位基本信息显示
    setUnitBaseInfo(recordBaseGsonBean.getSuperviseForm());
    // 设置监督内容显示
    List<TestBean> viewMap = getViewMap(recordBaseGsonBean.getCategoryResult());
    setViewData(viewMap);
}
Also used : TestBean(com.mtm.mrecord.mvp.model.entity.TestBean) TextView(android.widget.TextView) RecordBaseGsonBean(com.mtm.mrecord.mvp.model.entity.RecordBaseGsonBean) BindView(butterknife.BindView) View(android.view.View) TextView(android.widget.TextView)

Aggregations

RecordBaseGsonBean (com.mtm.mrecord.mvp.model.entity.RecordBaseGsonBean)4 LawDocumentGsonBean (com.mtm.mrecord.mvp.model.entity.LawDocumentGsonBean)2 com.mtm.mrecord.mvp.model.entity.superviseForm (com.mtm.mrecord.mvp.model.entity.superviseForm)2 View (android.view.View)1 TextView (android.widget.TextView)1 BindView (butterknife.BindView)1 SuperviseContentGsonBean (com.mtm.mrecord.mvp.model.entity.SuperviseContentGsonBean)1 TestBean (com.mtm.mrecord.mvp.model.entity.TestBean)1 NonNull (io.reactivex.annotations.NonNull)1 Disposable (io.reactivex.disposables.Disposable)1 Action (io.reactivex.functions.Action)1 Consumer (io.reactivex.functions.Consumer)1 Function3 (io.reactivex.functions.Function3)1