消息通知接口优化
This commit is contained in:
parent
ba520a439a
commit
17f09a69f1
|
@ -23,4 +23,9 @@ public interface SysNoticeDao extends BaseDao<SysNoticeEntity> {
|
|||
* 获取我的通知列表
|
||||
*/
|
||||
List<SysNoticeEntity> getMyNoticeList(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 更新 apply state
|
||||
*/
|
||||
int updateApplyState(Long userId, Integer applyState, String applyId);
|
||||
}
|
|
@ -110,13 +110,7 @@ public class SysNoticeServiceImpl extends CrudServiceImpl<SysNoticeDao, SysNotic
|
|||
|
||||
@Override
|
||||
public void updateApplyStateById(String id, Integer state) {
|
||||
Map params = new HashMap();
|
||||
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);
|
||||
});
|
||||
baseDao.updateApplyState(SecurityUser.getUserId(), state, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -23,4 +23,8 @@
|
|||
</if>
|
||||
order by t2.create_date desc
|
||||
</select>
|
||||
|
||||
<update id="updateApplyState">
|
||||
update sys_notice set apply_state = #{applyState} where receiver_type_ids like concat('%', #{userId}, '%') and apply_id=#{applyId}
|
||||
</update>
|
||||
</mapper>
|
Loading…
Reference in New Issue