Commit ac2bfd2a authored by liwei's avatar liwei

修改了留言,互换微信统计数量,增加了黑名单的限制

parent 4552e428
...@@ -738,8 +738,8 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo> ...@@ -738,8 +738,8 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
log.error("释放成功"); log.error("释放成功");
} }
} else { } else {
//不进行留言 //已超出今日对目标用户的点赞限制
throw new CyServiceException(1001,"今日对该用户点赞次数超出限制"); throw new CyServiceException(1001,"今日对该用户点赞次数已达上限,请明日再试!");
} }
} }
//当天 点赞表对应的记录+1 //当天 点赞表对应的记录+1
...@@ -771,7 +771,8 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo> ...@@ -771,7 +771,8 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
memInfoRepository.addLike(likeDTO); memInfoRepository.addLike(likeDTO);
return new CyPersistModel(1); return new CyPersistModel(1);
} else { } else {
throw new CyServiceException(1001,"今日对该用户点赞次数超出限制"); //超出对单个用户的点赞次数
throw new CyServiceException(1001,"今日对该用户点赞次数已达上限,请明日再试!");
} }
} else if (redisUserLikeCountAll == null){ } else if (redisUserLikeCountAll == null){
//当天第一次进行点赞 //当天第一次进行点赞
...@@ -785,7 +786,7 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo> ...@@ -785,7 +786,7 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
return new CyPersistModel(1); return new CyPersistModel(1);
} else { } else {
//超出总次数限制 //超出总次数限制
throw new CyServiceException(1002,"今日点赞次数超出限制"); throw new CyServiceException(1002,"今日点赞次数已达上限,请明日再试!");
} }
} }
......
...@@ -155,7 +155,7 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos ...@@ -155,7 +155,7 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos
} }
} else { } else {
//不进行留言 //不进行留言
throw new CyServiceException(1001,"今日对该用户留言次数超出限制"); throw new CyServiceException(1001,"今日对该用户留言次数已达上限,请明日再试!");
} }
} }
//先插入到留言表 //先插入到留言表
...@@ -233,7 +233,7 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos ...@@ -233,7 +233,7 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos
} }
return new CyPersistModel(line); return new CyPersistModel(line);
} else { } else {
throw new CyServiceException(1001,"今日对该用户留言次数超出限制"); throw new CyServiceException(1001,"今日对该用户留言次数已达上限,请明日再试!");
} }
} else if (redisLeaveMessageCountAll == null){ } else if (redisLeaveMessageCountAll == null){
//当天第一次进行留言 //当天第一次进行留言
...@@ -273,7 +273,7 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos ...@@ -273,7 +273,7 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos
return new CyPersistModel(line1); return new CyPersistModel(line1);
} else { } else {
//超出总次数限制 //超出总次数限制
throw new CyServiceException(1002,"今日留言次数超出限制"); throw new CyServiceException(1002,"今日留言次数已达上限,请明日再试!");
} }
} }
...@@ -343,9 +343,9 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos ...@@ -343,9 +343,9 @@ public class MemLeaveMessageServiceImpl extends ServiceImpl<MemLeaveMessageRepos
public int noReadMessageAllCount() { public int noReadMessageAllCount() {
//获取当前登录人 //获取当前登录人
String userId = CyUserUtil.getAuthenBusinessId(); String userId = CyUserUtil.getAuthenBusinessId();
//查询未读的留言数 //查询未读的留言数 在有一方被拉黑的情况下 不算此数量
int count1 = memLeaveMessageRepository.leaveMessageNoReadAllCount(Integer.valueOf(userId)); int count1 = memLeaveMessageRepository.leaveMessageNoReadAllCount(Integer.valueOf(userId));
//查询互换微信未回应数量 //查询互换微信未回应数量 在有一方被拉黑的情况下 不算此数量
int count2 = memInfoRepository.queryWeChatTaskNoReplyCount(userId); int count2 = memInfoRepository.queryWeChatTaskNoReplyCount(userId);
//查询未读的要微信请求数 //查询未读的要微信请求数
return count1 + count2; return count1 + count2;
......
...@@ -810,14 +810,25 @@ ...@@ -810,14 +810,25 @@
and (create_by = #{createBy} and target_id = #{targetId}) OR (create_by = #{targetId} and target_id = #{createBy}) and (create_by = #{createBy} and target_id = #{targetId}) OR (create_by = #{targetId} and target_id = #{createBy})
and status = '0' and status = '0'
) table1 ) table1
where table1.target_id = #{loginUserId} where 1=1
and table1.target_id = #{loginUserId}
AND NOT EXISTS (
SELECT 1 FROM opm_black_list obl
WHERE (obl.user_id = table1.create_by AND obl.target_id = table1.target_id)
OR (obl.user_id = table1.target_id AND obl.target_id = table1.create_by)
)
</select> </select>
<select id="queryWeChatTaskNoReplyCount" resultType="java.lang.Integer"> <select id="queryWeChatTaskNoReplyCount" resultType="java.lang.Integer">
select count(*) select count(*)
from mem_user_task from mem_user_task mut
where 1=1 where 1=1
and target_id = #{userId} and mut.target_id = #{userId}
and status = '0' and mut.status = '0'
AND NOT EXISTS (
SELECT 1 FROM opm_black_list obl
WHERE (obl.user_id = mut.create_by AND obl.target_id = mut.target_id)
OR (obl.user_id = mut.target_id AND obl.target_id = mut.create_by)
)
</select> </select>
<select id="getUserInfo" resultType="org.rcisoft.business.memInfo.entity.MemInfo"> <select id="getUserInfo" resultType="org.rcisoft.business.memInfo.entity.MemInfo">
select m.business_id as memberId,m.user_id as businessId,m.mem_code,m.mem_sex,m.mem_birthday,m.mem_constellation,m.mem_height,m.mem_weight,m.mem_max_education, select m.business_id as memberId,m.user_id as businessId,m.mem_code,m.mem_sex,m.mem_birthday,m.mem_constellation,m.mem_height,m.mem_weight,m.mem_max_education,
......
...@@ -108,20 +108,31 @@ ...@@ -108,20 +108,31 @@
<select id="queryTalkNoReadCount" resultType="java.lang.Integer"> <select id="queryTalkNoReadCount" resultType="java.lang.Integer">
SELECT count(*) SELECT count(*)
FROM ( FROM (
SELECT mulm.target_id,mulm.read_status SELECT mulm.target_id,mulm.read_status,mulm.create_by
FROM mem_user_leave_message mulm FROM mem_user_leave_message mulm
WHERE WHERE
(mulm.create_by = #{createBy} and mulm.target_id = #{targetId}) (mulm.create_by = #{createBy} and mulm.target_id = #{targetId})
OR (mulm.create_by = #{targetId} and mulm.target_id = #{createBy}) OR (mulm.create_by = #{targetId} and mulm.target_id = #{createBy})
) table1 ) table1
WHERE table1.target_id = #{loginUserId} and table1.read_status = '0' WHERE 1=1
AND table1.target_id = #{loginUserId}
AND table1.read_status = '0'
AND NOT EXISTS (
SELECT 1 FROM opm_black_list obl
WHERE (obl.user_id = table1.create_by AND obl.target_id = table1.target_id)
OR (obl.user_id = table1.target_id AND obl.target_id = table1.create_by)
);
</select> </select>
<select id="leaveMessageNoReadAllCount" resultType="java.lang.Integer"> <select id="leaveMessageNoReadAllCount" resultType="java.lang.Integer">
SELECT COUNT(*) SELECT count(*)
from mem_user_leave_message mulm FROM mem_user_leave_message mulm
where 1=1 WHERE mulm.target_id = #{userId}
and mulm.target_id = #{userId} AND mulm.read_status = '0'
and mulm.read_status = '0' AND NOT EXISTS (
SELECT 1 FROM opm_black_list obl
WHERE (obl.user_id = mulm.create_by AND obl.target_id = mulm.target_id)
OR (obl.user_id = mulm.target_id AND obl.target_id = mulm.create_by)
);
</select> </select>
<delete id="deleteTalkById"> <delete id="deleteTalkById">
delete from mem_user_talk where business_id = #{entity.businessId} delete from mem_user_talk where business_id = #{entity.businessId}
......
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