From 17f09a69f16f271add138073546cc678a902ce0c Mon Sep 17 00:00:00 2001 From: lizhicheng Date: Fri, 28 Oct 2022 17:17:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/renren/modules/notice/dao/SysNoticeDao.java | 5 +++++ .../modules/notice/service/impl/SysNoticeServiceImpl.java | 8 +------- .../src/main/resources/mapper/notice/SysNoticeDao.xml | 4 ++++ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/notice/dao/SysNoticeDao.java b/renren-admin/src/main/java/io/renren/modules/notice/dao/SysNoticeDao.java index 1438a4b9..216577fe 100644 --- a/renren-admin/src/main/java/io/renren/modules/notice/dao/SysNoticeDao.java +++ b/renren-admin/src/main/java/io/renren/modules/notice/dao/SysNoticeDao.java @@ -23,4 +23,9 @@ public interface SysNoticeDao extends BaseDao { * 获取我的通知列表 */ List getMyNoticeList(Map params); + + /** + * 更新 apply state + */ + int updateApplyState(Long userId, Integer applyState, String applyId); } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java index 45b4f6bf..17ba31e3 100644 --- a/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java @@ -110,13 +110,7 @@ public class SysNoticeServiceImpl extends CrudServiceImpl 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 diff --git a/renren-admin/src/main/resources/mapper/notice/SysNoticeDao.xml b/renren-admin/src/main/resources/mapper/notice/SysNoticeDao.xml index c2182de8..a8fedc1c 100644 --- a/renren-admin/src/main/resources/mapper/notice/SysNoticeDao.xml +++ b/renren-admin/src/main/resources/mapper/notice/SysNoticeDao.xml @@ -23,4 +23,8 @@ order by t2.create_date desc + + + update sys_notice set apply_state = #{applyState} where receiver_type_ids like concat('%', #{userId}, '%') and apply_id=#{applyId} + \ No newline at end of file