From 4101a19a8f119fd4d5408efcfd9db6e90c82ac0c Mon Sep 17 00:00:00 2001
From: xuxiuxi <xuxiuxi@454eff88-639b-444f-9e54-f578c98de674>
Date: 星期三, 19 四月 2017 11:22:03 +0800
Subject: [PATCH] 

---
 VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/PhoneCallMng.java |   36 +++++++++++++++++++++++++-----------
 1 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/PhoneCallMng.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/PhoneCallMng.java
index 0edb454..33284a3 100644
--- a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/PhoneCallMng.java
+++ b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/PhoneCallMng.java
@@ -9,6 +9,7 @@
 import java.util.List;
 
 import cn.com.basic.face.discern.common.BaseCommonCallBack;
+import cn.com.basic.face.discern.common.CommonVariables;
 import cn.com.basic.face.discern.query.condition.PhoneCallQueryCondition;
 import cn.com.basic.face.discern.query.item.PhoneCallQueryItem;
 import cn.com.basic.face.fragment.PhoneCallFragment;
@@ -22,9 +23,9 @@
         return instance;
     }
 
-    public void findPhoneCallLeftList(final boolean isSortByDept, String searchText) {
+    public void findPhoneCallLeftList(final boolean isSortByDept, String searchText, final int pageNum, final boolean append) {
         RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.Query.PHONE_CALL_QUERY);
-        params.addBodyParameter(PhoneCallQueryCondition.FieldNames.name, searchText);
+        params.addBodyParameter(PhoneCallQueryCondition.FieldNames.username, searchText);
         x.http().post(params, new BaseCommonCallBack() {
             public void success() {
                 List<PhoneCallQueryItem> list = getList(PhoneCallQueryItem.class);
@@ -36,12 +37,12 @@
                     PhoneCallQueryItem item = list.get(i);
                     try {
                         if (isSortByDept) {
-                            if (item.getDeptName() != null && item.getDeptName().length() > 0) {
-                                name = CharacterParser.getInstance().getSelling(item.getDeptName()).substring(0, 1);
+                            if (item.getCallerDept() != null && item.getCallerDept().length() > 0) {
+                                name = CharacterParser.getInstance().getSelling(item.getCallerDept()).substring(0, 1);
                             }
                         } else {
-                            if (item.getUsername() != null && item.getUsername().length() > 0) {
-                                name = CharacterParser.getInstance().getSelling(item.getUsername()).substring(0, 1);
+                            if (item.getCaller() != null && item.getCaller().length() > 0) {
+                                name = CharacterParser.getInstance().getSelling(item.getCaller()).substring(0, 1);
                             }
                         }
                     } catch (Exception e) {
@@ -53,7 +54,20 @@
                     allItems.add(item);
                     prev = name;
                 }
-                PhoneCallFragment.getInstance().get_fragment_phone_call_left_list_view().show(isSortByDept, allItems);
+                if (hasMorePages()) {
+                    allItems.add(CommonVariables.Page.hasMorePages);
+                } else {
+                    if (getPageNum() > 1) {
+                        allItems.add(CommonVariables.Page.reachBottom);
+                    } else {
+                        if (allItems.size() > 0) {
+                            allItems.add(CommonVariables.Page.reachBottom);
+                        } else {
+                            allItems.add(CommonVariables.Page.noMorePage);
+                        }
+                    }
+                }
+                PhoneCallFragment.getInstance().get_fragment_phone_call_left_list_view().show(isSortByDept, allItems, append);
             }
         });
     }
@@ -63,8 +77,8 @@
             @Override
             public int compare(PhoneCallQueryItem t1, PhoneCallQueryItem t2) {
                 if (sortedByDept) {
-                    String dept1Name = t1.getDeptName()==null?"":t1.getDeptName();
-                    String dept2Name = t2.getDeptName()==null?"":t2.getDeptName();
+                    String dept1Name = t1.getCallerDept()==null?"":t1.getCallerDept();
+                    String dept2Name = t2.getCallerDept()==null?"":t2.getCallerDept();
                     if(!dept1Name.equals(dept2Name)) {
                         String dept1Name_a = dept1Name.trim();
                         String dept1Name_b = dept2Name.trim();
@@ -75,8 +89,8 @@
                         return dept1Name_a.compareTo(dept1Name_b);
                     }
                 }
-                String name1 = t1.getUsername()==null?"":t1.getUsername();
-                String name2 = t2.getUsername()==null?"":t2.getUsername();
+                String name1 = t1.getCaller()==null?"":t1.getCaller();
+                String name2 = t2.getCaller()==null?"":t2.getCaller();
                 String dept1Name_a = name1.trim();
                 String dept1Name_b = name2.trim();
                 if (dept1Name_a.length() > 0 && dept1Name_b.length() > 0) {

--
Gitblit v1.8.0