| | |
| | | }
|
| | | RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.Query.PHONE_CALL_QUERY);
|
| | | params.addBodyParameter(PhoneCallQueryCondition.FieldNames.username, searchText);
|
| | | params.addBodyParameter(CommonVariables.Page.PAGE_SIZE, "5");
|
| | | params.addBodyParameter(CommonVariables.Page.PAGE_SIZE, CommonVariables.Page.DEFAULT_PAGE_SIZE);
|
| | | params.addBodyParameter(CommonVariables.Page.PAGE_NUM, pageNum+"");
|
| | | x.http().post(params, new BaseCommonCallBack() {
|
| | | public void success() {
|
| | |
| | | PhoneCallQueryItem item = list.get(i);
|
| | | try {
|
| | | if (isSortByDept) {
|
| | | if (item.getCallerDept() != null && item.getCallerDept().length() > 0) {
|
| | | name = CharacterParser.getInstance().getSelling(item.getCallerDept()).substring(0, 1);
|
| | | if (item.getCalleeDept() != null && item.getCalleeDept().length() > 0) {
|
| | | name = CharacterParser.getInstance().getSelling(item.getCalleeDept()).substring(0, 1);
|
| | | }
|
| | | } else {
|
| | | if (item.getCaller() != null && item.getCaller().length() > 0) {
|
| | | name = CharacterParser.getInstance().getSelling(item.getCaller()).substring(0, 1);
|
| | | if (item.getCallee() != null && item.getCallee().length() > 0) {
|
| | | name = CharacterParser.getInstance().getSelling(item.getCallee()).substring(0, 1);
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | |
| | | allItems.add(CommonVariables.Page.hasMorePages);
|
| | | } else {
|
| | | if (getPageNum() > 1) {
|
| | | allItems.add(CommonVariables.Page.reachBottom);
|
| | | //allItems.add(CommonVariables.Page.reachBottom);
|
| | | } else {
|
| | | if (allItems.size() > 0) {
|
| | | allItems.add(CommonVariables.Page.reachBottom);
|
| | | //allItems.add(CommonVariables.Page.reachBottom);
|
| | | } else {
|
| | | allItems.add(CommonVariables.Page.noMorePage);
|
| | | //allItems.add(CommonVariables.Page.noMorePage);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | @Override
|
| | | public int compare(PhoneCallQueryItem t1, PhoneCallQueryItem t2) {
|
| | | if (sortedByDept) {
|
| | | String dept1Name = t1.getCallerDept()==null?"":t1.getCallerDept();
|
| | | String dept2Name = t2.getCallerDept()==null?"":t2.getCallerDept();
|
| | | String dept1Name = t1.getCalleeDept()==null?"":t1.getCalleeDept();
|
| | | String dept2Name = t2.getCalleeDept()==null?"":t2.getCalleeDept();
|
| | | if(!dept1Name.equals(dept2Name)) {
|
| | | String dept1Name_a = dept1Name.trim();
|
| | | String dept1Name_b = dept2Name.trim();
|
| | |
| | | return dept1Name_a.compareTo(dept1Name_b);
|
| | | }
|
| | | }
|
| | | String name1 = t1.getCaller()==null?"":t1.getCaller();
|
| | | String name2 = t2.getCaller()==null?"":t2.getCaller();
|
| | | String name1 = t1.getCallee()==null?"":t1.getCallee();
|
| | | String name2 = t2.getCallee()==null?"":t2.getCallee();
|
| | | String dept1Name_a = name1.trim();
|
| | | String dept1Name_b = name2.trim();
|
| | | if (dept1Name_a.length() > 0 && dept1Name_b.length() > 0) {
|