| | |
| | | import com.dayu.pipirrapp.bean.db.LatLonBean; |
| | | import com.dayu.pipirrapp.bean.db.MarkerBean; |
| | | import com.dayu.pipirrapp.bean.net.CenterPointResult; |
| | | import com.dayu.pipirrapp.bean.net.DivideResult; |
| | | import com.dayu.pipirrapp.bean.net.InsectionResult; |
| | | import com.dayu.pipirrapp.bean.net.InspectionRequest; |
| | | import com.dayu.pipirrapp.bean.net.MarkerListResult; |
| | |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 获取分水房 |
| | | */ |
| | | private void getDivideList() { |
| | | ApiManager.getInstance().requestPost(MapFragment.this.getContext(), BASE_URL + "/project/divide/getDivides", DivideResult.class, null, new SubscriberListener<BaseResponse<DivideResult>>() { |
| | | @Override |
| | | public void onNext(BaseResponse<DivideResult> t) { |
| | | try { |
| | | if (t.isSuccess()) { |
| | | // if (t.getContent().) |
| | | // |
| | | // |
| | | // // 使用 RxJava 异步插入数据 |
| | | // DaoSingleton.getAsynchInstance(MapFragment.this.getContext()).markerDao().insertAll() |
| | | // .subscribeOn(Schedulers.io()) // 在 IO 线程上执行 |
| | | // .observeOn(AndroidSchedulers.mainThread()) // 在主线程上观察 |
| | | // .subscribe(() -> { |
| | | // // 插入成功 |
| | | // Log.i("mWebView", "数据插入成功"); |
| | | // }, throwable -> { |
| | | // // 插入失败 |
| | | // Log.e("mWebView", "数据插入失败: " + throwable.getMessage()); |
| | | // }); |
| | | } else { |
| | | ToastUtil.showToastLong(MapFragment.this.getContext(), t.getMsg()); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | CrashReport.postCatchedException(e); |
| | | } |
| | | } |
| | | |
| | | }); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void onDestroy() { |