| | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.NoticeMapper; |
| | | import com.doumee.dao.business.join.MemberJoinMapper; |
| | |
| | | ; |
| | | IPage<Notice> noticeIPage = noticeMapper.selectPage(page, queryWrapper); |
| | | List<NoticeCardDTO> noticeCardDTOs = new ArrayList<>(); |
| | | if (CollectionUtils.isEmpty(noticeIPage.getRecords())){ |
| | | if (com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(noticeIPage.getRecords())){ |
| | | noticeCardDTOs = noticeIPage.getRecords().stream().map(s -> { |
| | | NoticeCardDTO noticeCardDTO = new NoticeCardDTO(); |
| | | BeanUtils.copyProperties(s, noticeCardDTO); |
| | | return noticeCardDTO; |
| | | |
| | | }).collect(Collectors.toList()); |
| | | } |
| | | PageData<NoticeCardDTO> pageData = new PageData<>(); |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void autoRead(Integer memberId,Integer noticeType){ |
| | | noticeMapper.update(new UpdateWrapper<Notice>().lambda() |
| | | .set(Notice::getStatus,Constants.ONE) |
| | | .set(Notice::getEditDate, DateUtil.getCurrDateTime()) |
| | | .eq(Notice::getMemberId,memberId) |
| | | .ne(Objects.nonNull(noticeType)&&Constants.equalsInteger(noticeType,Constants.ZERO),Notice::getObjType,Constants.TWO) |
| | | .eq(Objects.nonNull(noticeType)&&Constants.equalsInteger(noticeType,Constants.ONE),Notice::getObjType,Constants.TWO) |
| | | .eq(Notice::getStatus,Constants.ZERO) |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |