From 7746e77099555a259f905ece694a2d82306aac59 Mon Sep 17 00:00:00 2001
From: xuxiuxi <xuxiuxi@454eff88-639b-444f-9e54-f578c98de674>
Date: 星期日, 23 七月 2017 11:15:45 +0800
Subject: [PATCH] 

---
 VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/PhoneCallMng.java                  |    2 +-
 VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/sqlite/VisitDao.java               |    2 +-
 VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/util/UnknownSurveillanceQueryItemUtil.java |   10 ++++++++--
 VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/util/AppApi.java                           |    2 +-
 VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/discern/common/ResultBean.java             |   19 +++++++++++++++----
 5 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/discern/common/ResultBean.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/discern/common/ResultBean.java
index c285924..a03a102 100644
--- a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/discern/common/ResultBean.java
+++ b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/discern/common/ResultBean.java
@@ -1,11 +1,14 @@
 package cn.com.basic.face.discern.common;
 
+import java.util.ArrayList;
 import java.util.List;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import org.xutils.http.annotation.HttpResponse;
+
+import cn.com.basic.face.base.BaseApplication;
 
 @HttpResponse(parser = JsonResponseParser.class)
 public class ResultBean {
@@ -49,11 +52,19 @@
 	}
 
 	public <T> List<T> getList(Class<T> requiredType) {
-		if (data != null) {
-			if (data instanceof JSONArray) {
-				JSONArray jsonArray = (JSONArray) data;
-				return JSON.parseArray(jsonArray.toJSONString(), requiredType);
+		if (BaseApplication.getInstance().networkAvailable()) {
+			if (data != null) {
+				if (data instanceof JSONArray) {
+					JSONArray jsonArray = (JSONArray) data;
+					return JSON.parseArray(jsonArray.toJSONString(), requiredType);
+				}
 			}
+		} else {
+			List<T> list = (List<T>)getData();
+			if (list == null) {
+				list = new ArrayList<>();
+			}
+			return list;
 		}
 		return null;
 	}
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 034f01f..f08bd5c 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
@@ -51,7 +51,7 @@
                 }
             });
         } else {
-            findPhoneCallLeftListAfterReturn(PhoneCallDao.getInstance().findPhoneCallLeftList(searchText, pageNum), isSortByDept, append);
+             findPhoneCallLeftListAfterReturn(PhoneCallDao.getInstance().findPhoneCallLeftList(searchText, pageNum), isSortByDept, append);
         }
     }
 
diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/sqlite/VisitDao.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/sqlite/VisitDao.java
index c19f35d..6edaa0d 100644
--- a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/sqlite/VisitDao.java
+++ b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/sqlite/VisitDao.java
@@ -82,7 +82,7 @@
             }
             Integer total = null;
             while (c_count.moveToNext()) {
-                total = c.getInt(c.getColumnIndex("count"));
+                total = c.getInt(0);
             }
             resultBean.setTotalPages(getTotalPageSize(total));
             resultBean.setPageNum(pageNum);
diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/util/AppApi.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/util/AppApi.java
index b1dbdfe..e6a5d35 100644
--- a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/util/AppApi.java
+++ b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/util/AppApi.java
@@ -7,7 +7,7 @@
 	public final static String IMAGE_URL_BASE = "http://192.168.1.49:8888/";
 	//public final static String BASE_URL = "http://192.168.1.51/face/";
 //	public final static String BASE_URL = "http://192.168.1.51:8333/face/";
-	public final static String BASE_URL = "http://192.168.1.102:8080/face/";
+	public final static String BASE_URL = "http://192.168.1.101:8080/face/";
 
 	//璁垮娉ㄥ唽娣诲姞
 	public static final String REGISTER_ADD = "Register/o_add.do";
diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/util/UnknownSurveillanceQueryItemUtil.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/util/UnknownSurveillanceQueryItemUtil.java
index 3d4481f..2961c22 100644
--- a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/util/UnknownSurveillanceQueryItemUtil.java
+++ b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/util/UnknownSurveillanceQueryItemUtil.java
@@ -4,6 +4,7 @@
 import java.util.Date;
 import java.util.List;
 
+import cn.com.basic.face.base.MainActivity;
 import cn.com.basic.face.discern.common.CommonVariables;
 import cn.com.basic.face.discern.query.item.SurveillanceQueryItem;
 import cn.com.basic.face.fragment.SurveillanceFragment;
@@ -35,8 +36,13 @@
             }
         }
         allItems.removeAll(itemsToRemove);
-        SurveillanceFragment.getInstance().get_fragment_supervisory_bottom_visitor_list_view().show(UnknownSurveillanceQueryItemUtil.getInstance().getUnknownTwoRows());
-        SurveillanceFragment.getInstance().get_fragment_supervisory_bottom_attendance_list_view().show(new ArrayList());
+        MainActivity.getInstance().runOnUiThread(new Runnable() {
+            @Override
+            public void run() {
+                SurveillanceFragment.getInstance().get_fragment_supervisory_bottom_visitor_list_view().show(UnknownSurveillanceQueryItemUtil.getInstance().getUnknownTwoRows());
+                SurveillanceFragment.getInstance().get_fragment_supervisory_bottom_attendance_list_view().show(new ArrayList());
+            }
+        });
     }
 
     private List getUnknownTwoRows() {

--
Gitblit v1.8.0