修改pc消息已读、未读接口

This commit is contained in:
sh
2025-11-06 12:28:19 +08:00
parent 8bbc66e7ff
commit e5ba8fe0e7
6 changed files with 45 additions and 12 deletions

View File

@@ -127,7 +127,7 @@ public class AppNoticeServiceImpl implements IAppNoticeService
Notice notice = new Notice();
notice.setUserId(appUser.getUserId());
notice.setTitle("职位上新");
notice.setIsRead(0);
notice.setIsRead(StringUtil.NOTICE_WD);
notice.setDate(new Date());
//todo update number of job
notice.setSubTitle("这里有10个岗位很适合你快来看看吧");
@@ -169,14 +169,14 @@ public class AppNoticeServiceImpl implements IAppNoticeService
List<Long> longs = StringUtil.convertStringToLongList(ids);
List<Notice> notices = noticeInfoMapper.selectBatchIds(longs);
notices.forEach(notice -> {
notice.setIsRead(1);
notice.setIsRead(StringUtil.NOTICE_YD);
noticeInfoMapper.updateById(notice);
});
List<Notice> notices1 = noticeInfoMapper.selectList(Wrappers.<Notice>lambdaQuery().eq(Notice::getUserId, SiteSecurityUtils.getUserId()).eq(Notice::getRemark, "notice_bar").eq(Notice::getTitle, "系统通知").orderByDesc(Notice::getCreateTime).last("limit 1"));
Notice notice = notices1.get(0);
notice.setNotReadCount(notice.getNotReadCount() - longs.size());
if(notice.getNotReadCount()==0){
notice.setIsRead(1);
notice.setIsRead(StringUtil.NOTICE_YD);
}
noticeInfoMapper.updateById(notice);
}
@@ -186,7 +186,7 @@ public class AppNoticeServiceImpl implements IAppNoticeService
List<Long> longs = StringUtil.convertStringToLongList(ids);
List<Notice> notices = noticeInfoMapper.selectBatchIds(longs);
notices.forEach(notice -> {
notice.setIsRead(1);
notice.setIsRead(StringUtil.NOTICE_YD);
notice.setNotReadCount(0);
noticeInfoMapper.updateById(notice);
});
@@ -201,8 +201,10 @@ public class AppNoticeServiceImpl implements IAppNoticeService
@Override
public List<Notice> selectListAppNotRead(Notice notice) {
List<Notice> sysNoticeList = noticeInfoMapper.selectList(Wrappers.<Notice>lambdaQuery().eq(Notice::getUserId, notice.getUserId()).eq(Notice::getRemark,"notice_bar").eq(Notice::getIsRead,0).orderByDesc(Notice::getCreateTime));
return sysNoticeList;
notice.setRemark(StringUtil.NOTICE_TYPE);
notice.setIsRead(StringUtil.NOTICE_WD);
//List<Notice> sysNoticeList = noticeInfoMapper.selectList(Wrappers.<Notice>lambdaQuery().eq(Notice::getUserId, notice.getUserId()).eq(Notice::getRemark,"notice_bar").eq(Notice::getIsRead,0).orderByDesc(Notice::getCreateTime));
return noticeInfoMapper.getNoticlist(notice);
}
@Override
@@ -210,22 +212,22 @@ public class AppNoticeServiceImpl implements IAppNoticeService
List<Long> longs = StringUtil.convertStringToLongList(ids);
List<Notice> notices = noticeInfoMapper.selectBatchIds(longs);
notices.forEach(notice -> {
notice.setIsRead(1);
notice.setIsRead(StringUtil.NOTICE_YD);
noticeInfoMapper.updateById(notice);
});
List<Notice> notices1 = noticeInfoMapper.selectList(Wrappers.<Notice>lambdaQuery().eq(Notice::getUserId, userId).eq(Notice::getRemark, "notice_bar").eq(Notice::getTitle, "系统通知").orderByDesc(Notice::getCreateTime).last("limit 1"));
Notice notice = notices1.get(0);
notice.setNotReadCount(notice.getNotReadCount() - longs.size());
if(notice.getNotReadCount()==0){
notice.setIsRead(1);
notice.setIsRead(StringUtil.NOTICE_YD);
}
noticeInfoMapper.updateById(notice);
}
@Override
public List<Notice> selectListAppNotics(Notice notice) {
List<Notice> sysNoticeList = noticeInfoMapper.selectList(Wrappers.<Notice>lambdaQuery().eq(Notice::getUserId, notice.getUserId()).eq(Notice::getRemark,"notice_bar").orderByDesc(Notice::getCreateTime));
return sysNoticeList;
notice.setRemark(StringUtil.NOTICE_TYPE);
return noticeInfoMapper.getNoticlist(notice);
}
}