|
|
@@ -80,7 +80,8 @@ public class FriendDao {
|
|
|
*/
|
|
|
public void checkSystemFriend(String ownerId) {
|
|
|
try {
|
|
|
- List<Friend> friendsList = friendDao.queryForEq("ownerId", ownerId);
|
|
|
+ //friendDao.queryForEq("ownerId", ownerId);
|
|
|
+ List<Friend> friendsList =getSysFriends(ownerId);
|
|
|
|
|
|
if (friendsList != null && friendsList.size() > 0) {// 说明不是第一次创建,直接返回
|
|
|
Log.i("FriendDao","发现已有系统菜单,直接返回!");
|
|
|
@@ -193,7 +194,7 @@ public class FriendDao {
|
|
|
chatMessage.setMessageState(ChatMessageListener.MESSAGE_SEND_SUCCESS);
|
|
|
// 为了使得初始生成的系统消息排在新朋友前面,所以在时间节点上延迟一点 1s
|
|
|
chatMessage.setTimeSend(TimeUtils.sk_time_current_time() + 6);
|
|
|
- chatMessage.setContent(MyApplication.getInstance().getString(R.string.welcome_user_software));
|
|
|
+ chatMessage.setContent("您有一条新的通知...");
|
|
|
chatMessage.setMySend(false);// 表示不是自己发的
|
|
|
// 往消息表里插入一条记录
|
|
|
ChatMessageDao.getInstance().saveNewSingleChatMessage(ownerId, Friend.ID_ERP_TASK, chatMessage);
|
|
|
@@ -216,7 +217,7 @@ public class FriendDao {
|
|
|
chatMessage.setMessageState(ChatMessageListener.MESSAGE_SEND_SUCCESS);
|
|
|
// 为了使得初始生成的系统消息排在新朋友前面,所以在时间节点上延迟一点 1s
|
|
|
chatMessage.setTimeSend(TimeUtils.sk_time_current_time() + 5);
|
|
|
- chatMessage.setContent(MyApplication.getInstance().getString(R.string.welcome_user_software));
|
|
|
+ chatMessage.setContent("您有一条新的任务...");
|
|
|
chatMessage.setMySend(false);// 表示不是自己发的
|
|
|
// 往消息表里插入一条记录
|
|
|
ChatMessageDao.getInstance().saveNewSingleChatMessage(ownerId, Friend.ID_ERP_ZHIHUI, chatMessage);
|
|
|
@@ -732,6 +733,20 @@ public class FriendDao {
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
+ public List<Friend> getSysFriends(String ownerId) {
|
|
|
+ try {
|
|
|
+ PreparedQuery<Friend> preparedQuery = friendDao.queryBuilder().where().eq("ownerId", ownerId).and()
|
|
|
+ .in("status", new Object[] {Friend.STATUS_SYSTEM }).and().eq("roomFlag", 0).and().eq("companyId", 0)
|
|
|
+ .prepare();
|
|
|
+ return friendDao.query(preparedQuery);
|
|
|
+ } catch (SQLException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
public List<Friend> getAllAttentions(String ownerId) {
|
|
|
try {
|