| | |
| | |
|
| | | import cn.com.basic.face.base.BaseApplication;
|
| | | import cn.com.basic.face.discern.common.CommonVariables;
|
| | | import cn.com.basic.face.discern.common.ResultBean;
|
| | | import cn.com.basic.face.discern.query.condition.CheckInQueryCondition;
|
| | | import cn.com.basic.face.fragment.CheckInFragment;
|
| | | import cn.com.basic.face.service.sqlite.CheckInDao;
|
| | | import cn.com.basic.face.util.AppApi;
|
| | |
|
| | | import org.xutils.http.RequestParams;
|
| | |
| | | if (!BaseApplication.deviceAvailable) {
|
| | | return;
|
| | | }
|
| | | if (BaseApplication.getInstance().networkAvailable()) {
|
| | | RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.Query.CHECK_IN_QUERY);
|
| | | String deviceCompanyId = BaseApplication.getInstance().getAndroidDevice().getCompanyId();
|
| | | if (isVisitorList) {
|
| | |
| | | params.addBodyParameter(CommonVariables.Page.PAGE_SIZE, CommonVariables.Page.DEFAULT_PAGE_SIZE);
|
| | | x.http().post(params, new BaseCommonCallBack() {
|
| | | public void success() {
|
| | | List<CheckInQueryItem> list = getList(CheckInQueryItem.class);
|
| | | findCheckInLeftListAfterReturn(resultBean, isVisitorList, isSortByDept, append);
|
| | | }
|
| | | });
|
| | | } else {
|
| | | findCheckInLeftListAfterReturn(CheckInDao.getInstance().findCheckInLeftList(isVisitorList, searchText, pageNum), isVisitorList, isSortByDept, append);
|
| | | }
|
| | | }
|
| | |
|
| | | public void findCheckInLeftListAfterReturn(ResultBean resultBean, boolean isVisitorList, boolean isSortByDept, boolean append) {
|
| | | List<CheckInQueryItem> list = resultBean.getList(CheckInQueryItem.class);
|
| | |
|
| | | List prevList = null;
|
| | | if (append) {
|
| | |
| | | itemList.add(item);
|
| | | prev = name;
|
| | | }
|
| | | addPageFooter(hasMorePages(), getPageNum(), itemList);
|
| | | addPageFooter(resultBean.hasMorePages(), resultBean.getPageNum(), itemList);
|
| | | if (isVisitorList) {
|
| | | CheckInFragment.getInstance().get_fragment_check_in_left_visitor().show(itemList);
|
| | | } else {
|
| | | CheckInFragment.getInstance().get_fragment_check_in_left_interviewee().show(itemList, isSortByDept, append);
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | private void sort(List<CheckInQueryItem> list, final boolean sortedByDept) {
|