k94314517
2025-03-26 e87b711cc267567d8374315dc99ef9780cb25dd8
server/system_service/src/main/java/com/doumee/service/system/impl/NoticesServiceImpl.java
@@ -6,9 +6,8 @@
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;
@@ -18,7 +17,6 @@
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;
@@ -120,7 +118,6 @@
        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)) {
@@ -133,7 +130,6 @@
            queryWrapper.orderByDesc(Notices::getCreateDate);
        }
        PageData<Notices> pageData = PageData.from(noticesMapper.selectJoinPage(page,Notices.class, queryWrapper));
        return pageData;
    }
@@ -170,7 +166,7 @@
            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");
@@ -178,9 +174,15 @@
        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;
    }
@@ -198,14 +200,15 @@
        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(),"非抄送数据,无法进行标记");
//        }
    }
    /**