消息通知接口优化

This commit is contained in:
lizhicheng 2022-10-28 17:17:31 +08:00
parent ba520a439a
commit 17f09a69f1
3 changed files with 10 additions and 7 deletions

View File

@ -23,4 +23,9 @@ public interface SysNoticeDao extends BaseDao<SysNoticeEntity> {
* 获取我的通知列表 * 获取我的通知列表
*/ */
List<SysNoticeEntity> getMyNoticeList(Map<String, Object> params); List<SysNoticeEntity> getMyNoticeList(Map<String, Object> params);
/**
* 更新 apply state
*/
int updateApplyState(Long userId, Integer applyState, String applyId);
} }

View File

@ -110,13 +110,7 @@ public class SysNoticeServiceImpl extends CrudServiceImpl<SysNoticeDao, SysNotic
@Override @Override
public void updateApplyStateById(String id, Integer state) { public void updateApplyStateById(String id, Integer state) {
Map params = new HashMap(); baseDao.updateApplyState(SecurityUser.getUserId(), state, id);
params.put("apply_id", id);
List<SysNoticeDTO> list = this.list(params);
list.stream().filter(it -> it.getReceiverTypeIds().contains(SecurityUser.getUserId().toString())).forEach(it -> {
it.setApplyState(state);
this.update(it);
});
} }
@Override @Override

View File

@ -23,4 +23,8 @@
</if> </if>
order by t2.create_date desc order by t2.create_date desc
</select> </select>
<update id="updateApplyState">
update sys_notice set apply_state = #{applyState} where receiver_type_ids like concat('%', #{userId}, '%') and apply_id=#{applyId}
</update>
</mapper> </mapper>