|  |  |  | 
|---|
|  |  |  | if (pageWrap.getModel().getReaded() != null) { | 
|---|
|  |  |  | queryWrapper.eq(Notices::getReaded, pageWrap.getModel().getReaded()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if(CollectionUtils.isNotEmpty(pageWrap.getSorts())){ | 
|---|
|  |  |  | for(PageWrap.SortData sortData: pageWrap.getSorts()) { | 
|---|
|  |  |  | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { | 
|---|
|  |  |  | 
|---|
|  |  |  | queryWrapper.orderByDesc(Notices::getCreateDate); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | PageData<Notices> pageData = PageData.from(noticesMapper.selectJoinPage(page,Notices.class, queryWrapper)); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return pageData; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | if(noticesDTO.getQueryType().equals(Constants.ZERO)){ | 
|---|
|  |  |  | queryWrapper.eq(Notices::getStatus,Constants.ZERO); | 
|---|
|  |  |  | queryWrapper.eq(Notices::getSendacopy,Constants.ZERO); | 
|---|
|  |  |  | queryWrapper.eq(Notices::getParam2,Constants.ZERO); | 
|---|
|  |  |  | queryWrapper.eq(Notices::getUserId, noticesDTO.getMemberId()); | 
|---|
|  |  |  | } else if(noticesDTO.getQueryType().equals(Constants.ONE)){ | 
|---|
|  |  |  | queryWrapper.eq(Notices::getStatus,Constants.ONE); | 
|---|
|  |  |  | queryWrapper.eq(Notices::getSendacopy,Constants.ZERO); | 
|---|
|  |  |  | queryWrapper.eq(Notices::getParam4,noticesDTO.getMemberId()); | 
|---|
|  |  |  | } else if(noticesDTO.getQueryType().equals(Constants.TWO)){ | 
|---|
|  |  |  | queryWrapper.eq(Notices::getParam3, noticesDTO.getMemberId()); | 
|---|
|  |  |  | } else if (noticesDTO.getQueryType().equals(Constants.THREE)) { | 
|---|
|  |  |  | queryWrapper.eq(Notices::getUserId, noticesDTO.getMemberId()); | 
|---|
|  |  |  | queryWrapper.eq(Notices::getSendacopy,Constants.ONE); | 
|---|
|  |  |  | if(Objects.nonNull(noticesDTO.getNoRead())&&Constants.equalsInteger(noticesDTO.getNoRead(),Constants.ONE)){ | 
|---|
|  |  |  | queryWrapper.eq(Notices::getReaded,Constants.ONE); | 
|---|
|  |  |  | queryWrapper.eq(Notices::getReaded,Constants.ZERO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | queryWrapper.eq("1","2"); | 
|---|
|  |  |  | 
|---|
|  |  |  | queryWrapper.ge(noticesDTO.getStartDate() != null, Notices::getCreateDate, Utils.Date.getStart(noticesDTO.getStartDate() )); | 
|---|
|  |  |  | queryWrapper.le(noticesDTO.getEndDate() != null,  Notices::getCreateDate, Utils.Date.getEnd(noticesDTO.getEndDate() )); | 
|---|
|  |  |  | queryWrapper.eq(Objects.nonNull(noticesDTO.getType()),Notices::getType,noticesDTO.getType()); | 
|---|
|  |  |  | queryWrapper.eq(StringUtils.isNotBlank(noticesDTO.getTitle()),Notices::getTitle,noticesDTO.getTitle()); | 
|---|
|  |  |  | //        queryWrapper.eq(Objects.nonNull(noticesDTO.getMemberId()),Notices::getUserId,noticesDTO.getMemberId()); | 
|---|
|  |  |  | queryWrapper.like(StringUtils.isNotBlank(noticesDTO.getTitle()),Notices::getTitle,noticesDTO.getTitle()); | 
|---|
|  |  |  | queryWrapper.orderByDesc(Notices::getCreateDate); | 
|---|
|  |  |  | PageData<Notices> pageData = PageData.from(noticesMapper.selectJoinPage(page,Notices.class, queryWrapper)); | 
|---|
|  |  |  | if(noticesDTO.getQueryType().equals(Constants.ZERO)){ | 
|---|
|  |  |  | for (Notices notices:pageData.getRecords()) { | 
|---|
|  |  |  | notices.setInfo("待我处理"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return pageData; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | if(Objects.isNull(notices)){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.DATA_EMPTY); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(Constants.equalsInteger(notices.getSendacopy(),Constants.ONE)){ | 
|---|
|  |  |  | if(Constants.equalsInteger(Constants.ZERO,notices.getReaded())){ | 
|---|
|  |  |  | noticesMapper.update(null,new UpdateWrapper<Notices>().lambda() | 
|---|
|  |  |  | .set(Notices::getReaded,Constants.ONE).eq(Notices::getId,notices)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非抄送数据,无法进行标记"); | 
|---|
|  |  |  | if(Constants.equalsInteger(Constants.ZERO,notices.getReaded())){ | 
|---|
|  |  |  | noticesMapper.update(null,new UpdateWrapper<Notices>().lambda() | 
|---|
|  |  |  | .set(Notices::getReaded,Constants.ONE).eq(Notices::getId,noticesId)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //        if(Constants.equalsInteger(notices.getSendacopy(),Constants.ONE)){ | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //        }else{ | 
|---|
|  |  |  | //            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非抄送数据,无法进行标记"); | 
|---|
|  |  |  | //        } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|