Commit b576d2ba authored by liwei's avatar liwei

修改了互换微信任务未读数量

parent 51060b06
...@@ -206,5 +206,15 @@ public interface MemInfoRepository extends CyBaseMapper<MemInfo> { ...@@ -206,5 +206,15 @@ public interface MemInfoRepository extends CyBaseMapper<MemInfo> {
* 查询当前用户的总被点赞数 * 查询当前用户的总被点赞数
*/ */
Integer selectUserFollowedCount(Integer userId); Integer selectUserFollowedCount(Integer userId);
/**
* 查询当前对话的未回复的微信任务数量
*/
int queryTalkWeChatTaskNoReplyCount(@Param("createBy") Integer createBy,@Param("targetId") Integer targetId,@Param("loginUserId") Integer loginUserId);
/**
* 查询未回复的微信任务数量
*/
int queryWeChatTaskNoReplyCount(String userId);
} }
...@@ -287,8 +287,10 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos ...@@ -287,8 +287,10 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos
talks.forEach(item->{ talks.forEach(item->{
//查询每一个对话的我的未读留言数量 //查询每一个对话的我的未读留言数量
//1.查询该对话的所有留言 并且计算出当前用户对该留言的未读信息数量 对话的createBy和targetId会随时变 所以当前人id要手动获取 //1.查询该对话的所有留言 并且计算出当前用户对该留言的未读信息数量 对话的createBy和targetId会随时变 所以当前人id要手动获取
int count = memLeaveMessageRepository.queryTalkNoReadCount(item.getCreateBy(),item.getTargetId(),Integer.valueOf(CyUserUtil.getAuthenBusinessId())); int count1 = memLeaveMessageRepository.queryTalkNoReadCount(item.getCreateBy(),item.getTargetId(),Integer.valueOf(CyUserUtil.getAuthenBusinessId()));
item.setNoReadCount(count); //查询互换微信未回应数量
int count2 = memInfoRepository.queryTalkWeChatTaskNoReplyCount(item.getCreateBy(),item.getTargetId(),Integer.valueOf(CyUserUtil.getAuthenBusinessId()));
item.setNoReadCount(count1 + count2);
}); });
return userLeaveMessageIPage; return userLeaveMessageIPage;
} }
...@@ -338,8 +340,10 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos ...@@ -338,8 +340,10 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos
//获取当前登录人 //获取当前登录人
String userId = CyUserUtil.getAuthenBusinessId(); String userId = CyUserUtil.getAuthenBusinessId();
//查询未读的留言数 //查询未读的留言数
int count = memLeaveMessageRepository.leaveMessageNoReadAllCount(Integer.valueOf(userId)); int count1 = memLeaveMessageRepository.leaveMessageNoReadAllCount(Integer.valueOf(userId));
//查询互换微信未回应数量
int count2 = memInfoRepository.queryWeChatTaskNoReplyCount(userId);
//查询未读的要微信请求数 //查询未读的要微信请求数
return count; return count1 + count2;
} }
} }
...@@ -806,4 +806,22 @@ ...@@ -806,4 +806,22 @@
where 1=1 where 1=1
and target_id = #{userId} and target_id = #{userId}
</select> </select>
<select id="queryTalkWeChatTaskNoReplyCount" resultType="java.lang.Integer">
SELECT count(*)
FROM (
select *
from mem_user_task
where 1=1
and (create_by = #{createBy} and target_id = #{targetId}) OR (create_by = #{targetId} and target_id = #{createBy})
and status = '0'
) table1
where table1.target_id = #{loginUserId}
</select>
<select id="queryWeChatTaskNoReplyCount" resultType="java.lang.Integer">
select count(*)
from mem_user_task
where 1=1
and target_id = #{userId}
and status = '0'
</select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment