Procházet zdrojové kódy

修改那个我的UU好友部分,如果有新的问题发生,及时联系

Bitliker před 8 roky
rodič
revize
26d1ff3d93

+ 1 - 1
app_core/common/src/main/java/com/core/app/Constants.java

@@ -28,7 +28,7 @@ public class Constants {
             + "tf_name varchar(50),"
             + "tf_whichSys varchar(50),"
             + "tf_company varchar(50),"
-            + "tf_phone varchar(50),"
+            + "tf_phone varchar(50) ,"
             + "tf_email varchar(50),"
             + "tf_type integer,"
             + "tf_ownerId varchar(50),"

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

@@ -72,22 +72,25 @@ public class ContactsDao {
         String ownerId=MyApplication.getInstance().mLoginUser.getUserId();
         LogUtil.d("Test","master:"+master+" ownerId:"+ownerId);
         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<> ?) " +
-                "   ", 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<> ?) " +
+//                "   ", new String[]{ownerId,"未填写"," "});
+
+        String sql="select * from tbl_contacts where tf_phone  in (select tf_phone from (select tf_phone,max(id) from tbl_contacts  where (tf_phone<> ? and tf_phone<> ?) group by tf_phone)) and tf_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,""});
+        Cursor cursor =db.rawQuery(sql,new String[]{"未填写"," ",ownerId});
         while (cursor.moveToNext()) {
             ContactsModel model=new ContactsModel();
             model.setName(cursor.getString(cursor.getColumnIndex("tf_name")));
-            model.setCompany(cursor.getString(cursor.getColumnIndex("tf_company")));
             model.setWhichsys(cursor.getString(cursor.getColumnIndex("tf_whichSys")));
+            model.setCompany(cursor.getString(cursor.getColumnIndex("tf_company")));
             model.setPhone(cursor.getString(cursor.getColumnIndex("tf_phone")));
             model.setEmail(cursor.getString(cursor.getColumnIndex("tf_email")));
             model.setType(cursor.getInt(cursor.getColumnIndex("tf_type")));
-            model.setImid(cursor.getString(cursor.getColumnIndex("tf_imId")));
             model.setOwnerId(cursor.getString(cursor.getColumnIndex("tf_ownerId")));
+            model.setImid(cursor.getString(cursor.getColumnIndex("tf_imId")));
             models.add(model);
         }
         cursor.close();

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

@@ -331,7 +331,7 @@ public class ContactsActivity extends OABaseActivity implements ContactsAdapter.
 	 *
 	 * @param keyWork
 	 */
-	private void sreachKeyWork(final String keyWork) {
+	private synchronized void sreachKeyWork(final String keyWork) {
 		searchKey = keyWork;
 		LogUtil.i("allModels=" + allModels.size());
 		if (StringUtil.isEmail(keyWork)) {