| | |
| | | |
| | | import static com.dayu.baselibrary.view.TitleBar.ClickType_RIGHT_TEXT; |
| | | |
| | | import android.content.Intent; |
| | | import android.os.Bundle; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | |
| | | import com.dayu.baselibrary.view.datepicker.CustomDatePicker; |
| | | import com.dayu.baselibrary.view.datepicker.DateFormatUtils; |
| | | |
| | | import com.dayu.qiheonlinelibrary.QHOnLineApplication; |
| | | import com.dayu.qiheonlinelibrary.adapter.RechargeAdapter; |
| | | import com.dayu.qiheonlinelibrary.databinding.ActivityRechargeListQhlBinding; |
| | | import com.dayu.qiheonlinelibrary.dbBean.RechargeBean; |
| | |
| | | getList(); |
| | | } |
| | | }); |
| | | adapter = new RechargeAdapter(this, rechargeList); |
| | | adapter = new RechargeAdapter(this, rechargeList, position -> { |
| | | Intent intent = new Intent(RechargeListActivity.this, RechargeDetailActivity.class); |
| | | intent.putExtra("rechargeBean", rechargeList.get(position)); |
| | | startActivity(intent); |
| | | }); |
| | | LinearLayoutManager layoutManager = new LinearLayoutManager(this); |
| | | rechargeListBinding.recyclerView.setLayoutManager(layoutManager); |
| | | rechargeListBinding.recyclerView.setAdapter(adapter); |
| | |
| | | // 在这里执行异步操作 |
| | | List<RechargeBean> beanList; |
| | | if (beginTime == 0 && endTime == 0) { |
| | | beanList = asynchBaseDao.rechargeDao().findAll(page * limit, limit); |
| | | beanList = asynchBaseDao.rechargeDao().findAll(QHOnLineApplication.qhAloneApplication.adminId, page * limit, limit); |
| | | } else { |
| | | beanList = asynchBaseDao.rechargeDao().ansyFindByTime(beginTime, endTime); |
| | | beanList = asynchBaseDao.rechargeDao().ansyFindByTime(QHOnLineApplication.qhAloneApplication.adminId, beginTime, endTime); |
| | | } |
| | | // 将结果发送给观察者 |
| | | emitter.onNext(beanList); |
| | |
| | | result -> { |
| | | // 在这里处理结果,这里是在主线程中 |
| | | // System.out.println("Result: " + result); |
| | | if (result.size() < limit) { |
| | | myRefreshLayout.finishLoadMoreWithNoMoreData(); |
| | | } |
| | | if (result != null && result.size() > 0) { |
| | | if (beginTime == 0 && endTime == 0) { |
| | | if (result.size() < limit) { |
| | | myRefreshLayout.finishLoadMoreWithNoMoreData(); |
| | | } |
| | | if (result != null && result.size() > 0) { |
| | | rechargeList.addAll(result); |
| | | } |
| | | } else { |
| | | rechargeList.addAll(result); |
| | | myRefreshLayout.finishLoadMoreWithNoMoreData(); |
| | | } |
| | | adapter.notifyDataSetChanged(); |
| | | getTotal(); |