修复Bug,使留言板红点能够正常消失

This commit is contained in:
wen 2022-01-16 20:22:11 +08:00
parent 7731bcd6cb
commit f123c8b01b
3 changed files with 23 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package com.xhpc.board.mapper;
import com.xhpc.board.domain.QueryUserListRequest; import com.xhpc.board.domain.QueryUserListRequest;
import com.xhpc.board.domain.SendMessageToPlatformRequest; import com.xhpc.board.domain.SendMessageToPlatformRequest;
import com.xhpc.board.domain.UserQueryCondition;
import com.xhpc.board.pojo.XhpcMessageBoardReceiveUser; import com.xhpc.board.pojo.XhpcMessageBoardReceiveUser;
import java.util.List; import java.util.List;
@ -62,4 +63,14 @@ public interface XhpcMessageBoardReceiveUserMapper {
*/ */
Long totalUserNumber(QueryUserListRequest param); Long totalUserNumber(QueryUserListRequest param);
/**
* 消除留言板对应用户的红点
*
* @param userQueryCondition 用户信息
* @author WH
* @date 2022/1/16 20:13
* @since version-1.0
*/
void updateHaveNewInfoIsNull(UserQueryCondition userQueryCondition);
} }

View File

@ -346,9 +346,11 @@ public class XhpcMessageBoardServiceImpl implements XhpcMessageBoardService {
Long messageId = aMonthRecords.get(index).getMessageId(); Long messageId = aMonthRecords.get(index).getMessageId();
messageIdList.add(messageId); messageIdList.add(messageId);
} }
//设置查询出来的记录为已读状态然后再查询保证查询出来的是否有新信息状态被改变 //设置查询出来的记录为已读状态然后再查询保证查询出来的信息状态被改变
messageBoardMapper.setUserReadedStatus(messageIdList); messageBoardMapper.setUserReadedStatus(messageIdList);
aMonthRecords = messageBoardMapper.selectBy(userQueryCondition, nextTimeStr); aMonthRecords = messageBoardMapper.selectBy(userQueryCondition, nextTimeStr);
//消除后台留言板红点
xhpcMessageBoardReceiveUserMapper.updateHaveNewInfoIsNull(userQueryCondition);
//封装数据 //封装数据
ArrayList<QueryUserMassageResponse.DataDTO> dataDTOS = new ArrayList<>(); ArrayList<QueryUserMassageResponse.DataDTO> dataDTOS = new ArrayList<>();
for (XhpcMessageBoard aMonthRecord : aMonthRecords) { for (XhpcMessageBoard aMonthRecord : aMonthRecords) {

View File

@ -87,6 +87,15 @@
AND sender_type = #{senderType} AND sender_type = #{senderType}
AND del_flag IS NULL; AND del_flag IS NULL;
</update> </update>
<update id="updateHaveNewInfoIsNull">
UPDATE xhpc_message_board_receive_user
SET have_new_info = null
WHERE tenant_type = #{tenantType}
AND tenant_id = #{tenantId}
AND sender_account = #{senderAccount}
AND sender_type = #{senderType}
AND del_flag IS NULL;
</update>
<select id="findOneByCondition" resultMap="BaseResultMap"> <select id="findOneByCondition" resultMap="BaseResultMap">
SELECT SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>