From 2ae0446917184b36996823e9dbf452dba82e8994 Mon Sep 17 00:00:00 2001
From: xuxiuxi <xuxiuxi@454eff88-639b-444f-9e54-f578c98de674>
Date: 星期五, 21 四月 2017 12:31:44 +0800
Subject: [PATCH] 

---
 VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/PhoneCallMng.java |   34 +++++++++++++++++++++++++---------
 1 files changed, 25 insertions(+), 9 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 0c7bd05..8d6c74d 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
@@ -38,9 +38,24 @@
         }
         RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.Query.PHONE_CALL_QUERY);
         params.addBodyParameter(PhoneCallQueryCondition.FieldNames.username, searchText);
+        params.addBodyParameter(CommonVariables.Page.PAGE_SIZE, "6");
+        params.addBodyParameter(CommonVariables.Page.PAGE_NUM, pageNum+"");
         x.http().post(params, new BaseCommonCallBack() {
             public void success() {
+
                 List<PhoneCallQueryItem> list = getList(PhoneCallQueryItem.class);
+
+                if (append) {
+                    List prevList = PhoneCallFragment.getInstance().get_fragment_phone_call_left_list_view().getPrevList();
+                    if (prevList != null && prevList.size() > 0) {
+                        for (int i = 0; i < prevList.size(); i++) {
+                            Object item = prevList.get(i);
+                            if (item instanceof PhoneCallQueryItem) {
+                                list.add((PhoneCallQueryItem)item);
+                            }
+                        }
+                    }
+                }
                 sort(list, isSortByDept);
                 List allItems = new ArrayList();
                 String name = "";
@@ -49,12 +64,12 @@
                     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) {
@@ -89,8 +104,8 @@
             @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();
@@ -101,8 +116,8 @@
                         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) {
@@ -123,8 +138,9 @@
             Toast.makeText(MainActivity.getInstance(), "璇峰厛閫夋嫨琚浜�", Toast.LENGTH_SHORT).show();
             return;
         }
+        Toast.makeText(MainActivity.getInstance(), "宸叉坊鍔犲埌鍛煎彨璁板綍", Toast.LENGTH_SHORT).show();
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.Query.PHONE_CALL_QUERY);
+        RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.PHONE_CALL_ADD);
         params.addBodyParameter(PhoneCall.FieldNames.date, sdf.format(new Date()));
         params.addBodyParameter(PhoneCall.FieldNames.calleeId, interviewee.getRegisterId());
         params.addBodyParameter(PhoneCall.FieldNames.deviceId, BaseApplication.getInstance().getDevice().getDeviceId());

--
Gitblit v1.8.0