| | |
| | | }
|
| | |
|
| | | public void add(RequestParams params, final String visitReasonId) {
|
| | | if (!BaseApplication.deviceAvailable) {
|
| | | return;
|
| | | }
|
| | | params.setUri(AppApi.BASE_URL +AppApi.VISIT_ADD);
|
| | | x.http().post(params, new BaseCommonCallBack() {
|
| | | @Override
|
| | |
| | | }
|
| | |
|
| | | public void findCheckInLeftList(final boolean isVisitorList, final boolean isSortByDept, String searchText, final int pageNum, final boolean append) {
|
| | | if (!BaseApplication.deviceAvailable) {
|
| | | return;
|
| | | }
|
| | | RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.Query.CHECK_IN_QUERY);
|
| | | if (isVisitorList) {
|
| | | params.addBodyParameter(CheckInQueryCondition.FieldNames.visitorCompanyId, BaseApplication.getInstance().getDevice().getDeviceCompanyId());
|
| | |
| | | x.http().post(params, new BaseCommonCallBack() {
|
| | | public void success() {
|
| | | List<CheckInQueryItem> list = getList(CheckInQueryItem.class);
|
| | |
|
| | | List prevList = null;
|
| | | if (append) {
|
| | | if (isVisitorList) {
|
| | | prevList = CheckInFragment.getInstance().get_fragment_check_in_left_visitor().getPrevList();
|
| | | } else {
|
| | | prevList = CheckInFragment.getInstance().get_fragment_check_in_left_interviewee().getPrevList();
|
| | | }
|
| | | for (int i = 0; i < prevList.size(); i++) {
|
| | | Object item = prevList.get(i);
|
| | | if (item instanceof CheckInQueryItem) {
|
| | | list.add(0, (CheckInQueryItem) item);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | sort(list, isSortByDept);
|
| | | List allItems = new ArrayList();
|
| | | String name = "";
|
| | |
| | | }
|
| | |
|
| | | private void sort(List<CheckInQueryItem> list, final boolean sortedByDept) {
|
| | | if (!BaseApplication.deviceAvailable) {
|
| | | return;
|
| | | }
|
| | | Collections.sort(list, new Comparator<CheckInQueryItem>() {
|
| | | @Override
|
| | | public int compare(CheckInQueryItem t1, CheckInQueryItem t2) {
|