|
|
@@ -180,7 +180,8 @@ public class LinksManFragment extends XutilsFragment implements View.OnClickList
|
|
|
|
|
|
}
|
|
|
|
|
|
- private void getDataByDB(List<Friend> friend) {
|
|
|
+
|
|
|
+ private void getDataByDB(List<Friend> friend) { //企业通讯录好友
|
|
|
if (manager == null)
|
|
|
manager = new DBManager(ct);
|
|
|
String master = CommonUtil.getSharedPreferences(ct, "erp_master"); //待优化 每次都 读取文件耗性能
|
|
|
@@ -189,20 +190,22 @@ public class LinksManFragment extends XutilsFragment implements View.OnClickList
|
|
|
"whichsys=?");
|
|
|
Log.i("gongpengming", "emList.size()=" + emList.size());
|
|
|
List<Friend> friends = new ArrayList<>();
|
|
|
+
|
|
|
+
|
|
|
for (int i = 0; i < emList.size(); i++) {//企业通讯人员
|
|
|
- // friends.add(EnterChatAction(emList.get(i)));
|
|
|
+ // friends.add(EnterChatAction(emList.get(i)));
|
|
|
String fId = String.valueOf(emList.get(i).getEm_IMID());
|
|
|
|
|
|
for (int j = 0; j < friend.size(); j++) {//IM好友
|
|
|
if (fId.equals(friend.get(j).getUserId())) { //当有重复
|
|
|
//改昵称
|
|
|
friend.get(j).setNickName(emList.get(i).getEM_NAME());
|
|
|
+ friend.get(j).setRemarkName(emList.get(i).getEM_NAME());//备注
|
|
|
break;
|
|
|
} else if ((j == (friend.size() - 1)) && !(fId.equals(friend.get(j).getUserId()))) {
|
|
|
friends.add(EnterChatAction(emList.get(i)));
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
friend.addAll(friends);
|
|
|
}
|
|
|
@@ -210,11 +213,13 @@ public class LinksManFragment extends XutilsFragment implements View.OnClickList
|
|
|
private Friend EnterChatAction(EmployeesEntity employee) {
|
|
|
Friend friend = new Friend();
|
|
|
friend.setUserId(String.valueOf(employee.getEm_IMID()));
|
|
|
+
|
|
|
friend.setOwnerId(MyApplication.getInstance().mLoginUser.getUserId());
|
|
|
friend.setRemarkName(employee.getEM_NAME());//备注
|
|
|
friend.setNickName(employee.getEM_NAME());//昵称
|
|
|
// friend.setDescription("企业通讯录人员");
|
|
|
// timeSend作为取群聊离线消息的标志,所以要在这里设置一个初始值
|
|
|
+
|
|
|
friend.setTimeSend(TimeUtils.sk_time_current_time());
|
|
|
friend.setStatus(Friend.STATUS_UNKNOW);
|
|
|
return friend;
|
|
|
@@ -399,9 +404,9 @@ public class LinksManFragment extends XutilsFragment implements View.OnClickList
|
|
|
private void goneView(boolean b) {
|
|
|
if (b) {
|
|
|
my_data_rl.setVisibility(View.GONE);
|
|
|
- // my_friends_rl.setVisibility(View.GONE);
|
|
|
+ // my_friends_rl.setVisibility(View.GONE);
|
|
|
my_friend_rl.setVisibility(View.GONE);
|
|
|
- // local_video_rl.setVisibility(View.GONE);
|
|
|
+ // local_video_rl.setVisibility(View.GONE);
|
|
|
} else {
|
|
|
my_data_rl.setVisibility(View.VISIBLE);
|
|
|
//my_friends_rl.setVisibility(View.VISIBLE);
|
|
|
@@ -437,7 +442,7 @@ public class LinksManFragment extends XutilsFragment implements View.OnClickList
|
|
|
final List<Friend> friends = FriendDao.getInstance().getFriends(mLoginUserId);
|
|
|
Log.i("wang", "friends =" + friends);
|
|
|
Log.i("wang", "friends mloginuserid=" + mLoginUserId);
|
|
|
- // friends.clear();
|
|
|
+ // friends.clear();
|
|
|
getDataByDB(friends);
|
|
|
if (friends != null)
|
|
|
Log.i("wang", "friends size()=" + friends.size());
|