|  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
|---|
|  |  |  | import com.doumee.core.constants.ResponseStatus; | 
|---|
|  |  |  | import com.doumee.core.exception.BusinessException; | 
|---|
|  |  |  | import com.doumee.core.model.LoginUserInfo; | 
|---|
|  |  |  | import com.doumee.core.model.PageData; | 
|---|
|  |  |  | import com.doumee.core.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.PageData; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.core.utils.Utils; | 
|---|
|  |  |  | import com.doumee.dao.system.dto.NoticesDTO; | 
|---|
|  |  |  | 
|---|
|  |  |  | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; | 
|---|
|  |  |  | import com.github.yulichang.wrapper.MPJLambdaWrapper; | 
|---|
|  |  |  | import org.apache.commons.lang3.StringUtils; | 
|---|
|  |  |  | import org.apache.shiro.SecurityUtils; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | 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; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | 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(Objects.nonNull(noticesDTO.getMemberId()),Notices::getUserId,noticesDTO.getMemberId()); | 
|---|
|  |  |  | 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)){ | 
|---|