DESKTOP-71BH0QO\L、ming
2021-04-29 35cc85225a4acfda180f67af1865eac51f3844a6
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java
@@ -6,19 +6,11 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.model.dtos.neighbor.AddComActNeighborCircleAppDTO;
import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAdminDTO;
import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAppDTO;
import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleDetailAppDTO;
import com.panzhihua.common.model.dtos.neighbor.*;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.neighbor.AddNeighborCircleAdminVO;
import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAdminVO;
import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAppVO;
import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleCommentAppVO;
import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleDetailAppVO;
import com.panzhihua.common.model.vos.neighbor.*;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_community.dao.ComActNeighborCircleCommentDAO;
import com.panzhihua.common.model.vos.neighbor.EditNeighborCircleAdminVO;
import com.panzhihua.common.model.vos.user.AdministratorsUserVO;
import com.panzhihua.service_community.dao.ComActNeighborCircleDAO;
import com.panzhihua.service_community.model.dos.ComActNeighborCircleDO;
@@ -31,9 +23,6 @@
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.annotation.Resource;
import java.util.List;
/**
 * @auther lyq
@@ -61,6 +50,7 @@
    /**
     * 分页查询邻里圈列表
     *
     * @param neighborCircleAppDTO  请求参数
     * @return  邻里圈列表
     */
@@ -73,6 +63,7 @@
    /**
     * 用户发布邻里圈审核
     *
     * @param addNeighborCircleAppDTO   邻里圈请求参数
     * @return  发布结果
     */
@@ -186,9 +177,7 @@
        //邻里圈浏览器记录
        neighborCircleBrowseDAO.delete(new LambdaQueryWrapper<ComActNeighborCircleBrowseDO>()
                .eq(ComActNeighborCircleBrowseDO::getNeighborId,id));
        //邻里圈点赞删除
        neighborCircleBrowseDAO.delete(new LambdaQueryWrapper<ComActNeighborCircleBrowseDO>()
                .eq(ComActNeighborCircleBrowseDO::getNeighborId,id));
        //邻里圈点赞删除 需要一层一层删
/*        neighborCircleFabulousDAO.delete(new LambdaQueryWrapper<ComActNeighborCircleFabulousDO>()
                .eq(ComActNeighborCircleFabulousDO::get))*/
            return R.ok();
@@ -197,6 +186,75 @@
    @Override
    public R detailNeighborByAdmin(Long id) {
        return null;
        ComActNeighborCircleDO comActNeighborCircleDO = this.baseMapper.selectById(id);
        if (comActNeighborCircleDO == null) {
            return R.fail("id有误");
        }
        DetailNeighborCircleAdminVO vo = new DetailNeighborCircleAdminVO();
        BeanUtils.copyProperties(comActNeighborCircleDO, vo);
        return R.ok(vo);
    }
    @Override
    public R detailNeighborAllCommentByAdmin(DetailNeighborAllCommentByAdminDTO dto) {
        ComActNeighborCircleDO comActNeighborCircleDO = this.baseMapper.selectById(dto.getId());
        if (comActNeighborCircleDO == null) {
            return R.fail("id有误");
        }
        Page<ComActNeighborCircleCommentDO> page = new Page<>(dto.getPageNum(),dto.getPageSize());
        //1、先查询所有该邻里圈_的评论
        IPage<ComActNeighborCommentByAdminVO> commentDOIPage = neighborCircleCommentDAO.selectPageDetailNeighborComment(page,dto);
        return R.ok(commentDOIPage);
    }
    @Override
    public R changeCommentStatusByAdmin(ChangeCommentStatusByAdminVO dto) {
        ComActNeighborCircleCommentDO commentDO = neighborCircleCommentDAO.selectById(dto.getId());
        if(commentDO==null){
            return R.fail("id有误!");
        }
        commentDO.setStatus(dto.getStatus());
        neighborCircleCommentDAO.updateById(commentDO);
        return R.ok();
    }
    @Override
    public R detailNeighborCommentByAdmin(Long id) {
        ComActNeighborCircleCommentDO commentDO = neighborCircleCommentDAO.selectById(id);
        if(commentDO==null){
            return R.fail("id有误!");
        }
        ComActNeighborCommentByAdminVO vo = new ComActNeighborCommentByAdminVO();
        BeanUtils.copyProperties(commentDO,vo);
        return R.ok(vo);
    }
    @Override
    public R detailNeighborCommentAllReply(DetailNeighborCommentReplyByAdminDTO dto) {
        Page<ComActNeighborCircleCommentReplyDO> page = new Page<>(dto.getPageNum(),dto.getPageSize());
        Page<ComActNeighborCommentReplyByAdminVO> replyPage = neighborCircleCommentReplyDAO.selectListByComment(page, dto);
        return R.ok(replyPage);
    }
    @Override
    public R detailNeighborCommentReply(Long id) {
        ComActNeighborCircleCommentReplyDO replyDO = neighborCircleCommentReplyDAO.selectById(id);
        if(replyDO==null){
            return R.fail("id有误!");
        }
        ComActNeighborCircleCommentReplyDO vo = new ComActNeighborCircleCommentReplyDO();
        BeanUtils.copyProperties(replyDO,vo);
        return R.ok(vo);
    }
    @Override
    public R changeCommentReplyStatusByAdmin(ChangeCommentReplyStatusByAdminVO changeStatusReplyVO) {
        ComActNeighborCircleCommentReplyDO replyDO = neighborCircleCommentReplyDAO.selectById(changeStatusReplyVO.getId());
        if(replyDO==null){
            return R.fail("id有误!");
        }
        replyDO.setStatus(changeStatusReplyVO.getStatus());
        neighborCircleCommentReplyDAO.updateById(replyDO);
        return R.ok();
    }
}