mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-06 07:21:24 +08:00
the function of modify top have been completed and modify the manageTable index
This commit is contained in:
@@ -31,10 +31,14 @@ public class NoticeReceiveServiceImpl extends ServiceImpl<NoticeReceiveMapper, N
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean modifyNoticeIsRead(Long noticeId,Integer readStatus) {
|
||||
public Boolean modifyNoticeIsRead(Notice notice) {
|
||||
Integer readStatus = null;
|
||||
if (null!=notice.getIsRead()){
|
||||
readStatus=notice.getIsRead()==0?1:0;
|
||||
}
|
||||
LambdaUpdateWrapper<NoticeReceive> luw = new LambdaUpdateWrapper<>();
|
||||
Long userId = WebUtil.getLoginUser().getUser().getId();
|
||||
luw.eq(NoticeReceive::getNoticeId, noticeId).eq(NoticeReceive::getUserId, userId).set(null!=readStatus,NoticeReceive::getAlreadyRead, readStatus);
|
||||
luw.eq(NoticeReceive::getNoticeId, notice.getId()).eq(NoticeReceive::getUserId, userId).set(null!=readStatus,NoticeReceive::getAlreadyRead, readStatus);
|
||||
return noticeReceiveMapper.update(null,luw)>0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.cfive.pinnacle.entity.Notice;
|
||||
import com.cfive.pinnacle.entity.NoticeReceive;
|
||||
import com.cfive.pinnacle.entity.NoticeType;
|
||||
import com.cfive.pinnacle.entity.common.ResponseCode;
|
||||
import com.cfive.pinnacle.entity.common.ResponseResult;
|
||||
import com.cfive.pinnacle.mapper.NoticeMapper;
|
||||
import com.cfive.pinnacle.mapper.NoticeReceiveMapper;
|
||||
import com.cfive.pinnacle.mapper.NoticeTypeMapper;
|
||||
@@ -15,11 +16,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.cfive.pinnacle.utils.WebUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -109,6 +108,12 @@ public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> impleme
|
||||
return this.addNotice(notice);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateNoticeTop(Notice notice) {
|
||||
notice.setTop(notice.getTop() == 1 ? 0 : 1);
|
||||
return noticeMapper.updateById(notice) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean addNotice(Notice notice) {
|
||||
Boolean noticeFlag,noticeRecFlag=false;
|
||||
|
||||
Reference in New Issue
Block a user