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);
}
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());
}
});
}
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);
}
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);
}
Aggregations