use of com.mtm.mrecord.mvp.model.entity.LawDocumentGsonBean in project Mvp-Rxjava-Retrofit-dagger2 by pengMaster.
the class LawFileFragment method setViewData.
/**
* 设置布局显示
*
* @param gsonBean
*/
private void setViewData(LawDocumentGsonBean gsonBean) {
// 卫生监督意见书
LawDocumentGsonBean.SuperviseViewBean superviseView = gsonBean.getSuperviseView();
// 现场笔录
LawDocumentGsonBean.SitenotesBean sitenotes = gsonBean.getSitenotes();
List<LawDocumentGsonBean.AskListBean> askList = gsonBean.getAskList();
if (null != sitenotes) {
tvXcbl.setText("现场笔录 " + sitenotes.getNcreatetime());
tvXcbl.setTag(new Gson().toJson(sitenotes));
}
if (null != superviseView) {
tvWsjdYjs.setText("卫生监督意见书 " + superviseView.getVcreatetime());
tvWsjdYjs.setTag(new Gson().toJson(superviseView));
}
if (null != askList && askList.size() > 0) {
llXwblContent.removeAllViews();
for (int i = 0; i < askList.size(); i++) {
View inflate = LayoutInflater.from(getActivity()).inflate(R.layout.layout_file_item, null);
TextView viewById = (TextView) inflate.findViewById(R.id.tv_item_name);
viewById.setText("询问笔录 " + askList.get(i).getCreateTime());
llXwblContent.addView(inflate);
final LawDocumentGsonBean.AskListBean askListBean = askList.get(i);
inflate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Bundle bundle = new Bundle();
bundle.putString("tag", new Gson().toJson(askListBean));
bundle.putString("type", "xwbl");
Intent intent = new Intent();
intent.setClass(getActivity(), LawDocumentDetailAct.class);
intent.putExtras(bundle);
startActivity(intent);
}
});
}
}
}
use of com.mtm.mrecord.mvp.model.entity.LawDocumentGsonBean 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.LawDocumentGsonBean 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);
}
Aggregations