Browse Source

fix 通讯录加载多公司企业架构人员

Arison 8 years ago
parent
commit
5dcc7cc5d0

+ 5 - 2
app_modular/appcontact/src/main/java/com/uas/appcontact/db/ContactsDao.java

@@ -74,7 +74,10 @@ public class ContactsDao {
         List<ContactsModel> models=new ArrayList<>();
         Cursor cursor =db.rawQuery("select * from tbl_contacts a where id=" +
                 "(select min(id) from tbl_contacts where tf_phone=a.tf_phone and tf_ownerId=? ) and (tf_phone<> ? and tf_phone<> ?) " +
-                "  and (tf_whichSys=? or tf_whichSys=? ) ", new String[]{ownerId,"未填写"," ",master,""});
+                "   ", new String[]{ownerId,"未填写"," "});
+//        Cursor cursor =db.rawQuery("select * from tbl_contacts a where id=" +
+//                "(select min(id) from tbl_contacts where tf_phone=a.tf_phone and tf_ownerId=? ) and (tf_phone<> ? and tf_phone<> ?) " +
+//                "  and (tf_whichSys=? or tf_whichSys=? ) ", new String[]{ownerId,"未填写"," ",master,""});
         while (cursor.moveToNext()) {
             ContactsModel model=new ContactsModel();
             model.setName(cursor.getString(cursor.getColumnIndex("tf_name")));
@@ -195,7 +198,7 @@ public class ContactsDao {
     public  void delete(){
         SQLiteDatabase db=  DatabaseManager.getInstance().openDatabase();
         String table = "tbl_contacts";
-        String whereClause = "1=1";
+        String whereClause = "tf_type!=2";
         int row= db.delete(table, whereClause, null);
         DatabaseManager.getInstance().closeDatabase();
     }

+ 5 - 4
app_modular/appcontact/src/main/java/com/uas/appcontact/ui/activity/ContactsActivity.java

@@ -490,9 +490,6 @@ public class ContactsActivity extends OABaseActivity implements ContactsAdapter.
 
                 } else {
                     LogUtil.d("Test", "-----------缓存为空!---------");
-//                   tmodels.clear();
-//                   contactsDao.delete();
-//                  loadIMContacts();
                     if (!ListUtils.isEmpty(tmodels)) {
                         tmodels.clear();
                     }
@@ -560,7 +557,11 @@ public class ContactsActivity extends OABaseActivity implements ContactsAdapter.
                 String message = result.toString();
                 if (!StringUtil.isEmpty(message)) {
                     LogUtil.d("Test", "message:" + message);
-                    hanlderAppQueryuserInThread(message);
+                    try {
+                        hanlderAppQueryuserInThread(message);
+                    } catch (Exception e) {
+                      
+                    }
                 }
             }
         }, String.class, params);